[issue44986] Date formats in help messages of argparse

2021-08-25 Thread Julian Berman
Julian Berman added the comment: This is documented already I believe: https://docs.python.org/3/library/argparse.html#help > As the help string supports %-formatting, if you want a literal % to appear > in the help string, you must escape it as %%. -- nosy: +

[issue44995] "Hide the prompts and output" works abnormal

2021-08-25 Thread Julian Berman
Change by Julian Berman : -- keywords: +patch nosy: +Julian nosy_count: 2.0 -> 3.0 pull_requests: +26384 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27939 ___ Python tracker <https://bugs.python.org/i

[issue44994] datetime's C implementation verifies fromisoformat is ASCII, but the pure python implementation does not

2021-08-24 Thread Julian Berman
New submission from Julian Berman : This line (which contains a non-ASCII digit): python3.9 -c "import datetime; datetime.date.fromisoformat('1963-06-1৪')" raises: Traceback (most recent call last): File "", line 1, in ValueError: Invalid isoformat

[issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal

2021-04-11 Thread Julian Berman
Change by Julian Berman : -- nosy: +Julian ___ Python tracker <https://bugs.python.org/issue36384> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22282] ipaddress module accepts octal formatted IPv4 addresses in IPv6 addresses

2021-04-11 Thread Julian Berman
Change by Julian Berman : -- nosy: +Julian ___ Python tracker <https://bugs.python.org/issue22282> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43148] Call sys.unraisablehook in the REPL when sys.excepthook is broken

2021-02-15 Thread Julian Berman
Julian Berman added the comment: Thanks Victor. Yes likely happy to send a PR (have to clear a few things off the yak stack first) On Tue, Feb 9, 2021 at 5:38 AM STINNER Victor wrote: > > STINNER Victor added the comment: > > It makes sense to call _PyErr_WriteUnraisab

[issue43154] code.InteractiveConsole can crash if sys.excepthook is broken

2021-02-07 Thread Julian Berman
Change by Julian Berman : -- nosy: +Julian ___ Python tracker <https://bugs.python.org/issue43154> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43148] Call sys.unraisablehook in the REPL when sys.excepthook is broken

2021-02-06 Thread Julian Berman
New submission from Julian Berman : At the REPL, when sys.excepthook is broken (below by setting it to a non-callable), one sees: ``` ⊙ python3.9

[issue41745] BoundArguments.arguments used in the recommended way to call a callable silently succeeds for nonexistent arguments

2020-09-12 Thread Julian Berman
Julian Berman added the comment: Totally fair! Sorry, was just making sure the label change wasn't intended to say it *wasn't* enough to warrant a design change :) (which I agree should be discussed with folks who do use that functionality, of which I only recently had

[issue41745] BoundArguments.arguments used in the recommended way to call a callable silently succeeds for nonexistent arguments

2020-09-11 Thread Julian Berman
Julian Berman added the comment: Not sure I agree with it being just a doc issue -- happy to clarify if something was unclear, not sure from your message if it was or if you disagree, but e.g.: > However, your 'two' function takes no arguments, so valid values of args and > kwarg

[issue41745] BoundArguments.arguments used in the recommended way to call a callable silently succeeds for nonexistent arguments

2020-09-08 Thread Julian Berman
Julian Berman added the comment: As a secondary behavior here, which is actually the one that matters more for my use case, the following seems surprising as well: import inspect s = inspect.signature(lambda **kwargs: kwargs).bind() s.arguments["foo"] = 12 will similarly silently

[issue41745] BoundArguments.arguments used in the recommended way to call a callable silently succeeds for nonexistent arguments

2020-09-08 Thread Julian Berman
Change by Julian Berman : -- nosy: +yselivanov versions: -Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue41745> ___ ___ Python-bug

[issue41745] BoundArguments.arguments used in the recommended way to call a callable silently succeeds for nonexistent arguments

2020-09-08 Thread Julian Berman
New submission from Julian Berman : The following code succeeds "silently", which seems undesirable: from inspect import signature def two(): return 2 bound = signature(two).bind() bound.arguments["does_not_exist"] = 12 two(*bound.args, **

[issue40379] multiprocessing's default start method of fork()-without-exec() is broken

2020-06-24 Thread Julian Berman
Change by Julian Berman : -- nosy: +Julian ___ Python tracker <https://bugs.python.org/issue40379> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21724] resetwarnings doesn't reset warnings registry

2020-05-24 Thread Julian Berman
Julian Berman added the comment: Just ran into this myself -- not sure what the intended fix is (hopefully it's "add a function that restores the warnings configuration to its defaults?" Changing resetwarnings seems likely to be not doable I assume.) But in the meanwhile, is a

[issue37941] python -m and runpy.run_module set different __name__ by default

2019-09-12 Thread Julian Berman
Julian Berman added the comment: That all makes sense, I understand that in the general case you can't really promise someone that if you mutate global state in-process that the runpy module has any way of preventing that. Except IMO, the module gives exactly the impression you're saying

[issue37941] python -m and runpy.run_module set different __name__ by default

2019-09-03 Thread Julian Berman
Julian Berman added the comment: Is there no desire to have an API that works like -m (entirely. In this and any other way)? On Tue, Sep 3, 2019, 09:41 Nick Coghlan wrote: > > Change by Nick Coghlan : > > > -- > stage: -> resolved >

[issue37941] python -m and runpy.run_module set different __name__ by default

2019-08-24 Thread Julian Berman
New submission from Julian Berman : This seems brutally simple, to the point where I'm concerned I'm missing something (or have seen this issue filed elsewhere but can't find it), but `python -m` and `runpy.run_module` don't set the same __name__ -- specifically `runpy.run_module`, when

[issue37805] json.dump(..., skipkeys=True) has no unit tests

2019-08-09 Thread Julian Berman
New submission from Julian Berman : Looks like there possibly are upstream tests that could be pulled in with modification: https://github.com/simplejson/simplejson/blob/00ed20da4c0e5f0396661f73482418651ff4d8c7/simplejson/tests/test_dump.py#L53-L66 (Found via https://bitbucket.org/pypy/pypy

[issue30754] textwrap.dedent mishandles empty lines

2019-06-12 Thread Julian Berman
Julian Berman added the comment: I still disagree :) but docs are better than nothing. On Wed, Jun 12, 2019, 18:05 Guido van Rossum wrote: > > Change by Guido van Rossum : > > > -- > nosy: +gvanrossum > > ___ &g

[issue12445] dict view values objects are missing tp_richcmp and tp_as_number

2019-03-28 Thread Julian Berman
Julian Berman added the comment: Yes I know *why* it worked in Py2 -- still seems like an oversight :) To me, comparing (multi)set-like is the only reasonable behavior there which is what IIRC the patch did, but even without that, for a given dict, d.values() != d.values(). So, it's not like

[issue12445] dict view values objects are missing tp_richcmp and tp_as_number

2019-03-28 Thread Julian Berman
Julian Berman added the comment: Well, surely there are reasonable semantics :), because dict.values == dict.values was comparable before we had view objects. It's been awhile since I filed this, and still seems rather silly that: >>>> {"a": "foo"}.values

[issue17894] Edits to descriptor howto

2018-06-30 Thread Julian Berman
Julian Berman added the comment: This seems very very slightly overly conversational (specifically the "That's all there is to it" sentence), but overall like a pretty decent improvement here. Personally I'd axe that sentence but then seems like this should be merged as-is and a

[issue30754] textwrap.dedent mishandles empty lines

2017-06-26 Thread Julian Berman
Julian Berman added the comment: @Terry IMHO it conflicts with the fundamental description of the function. > Remove any common leading whitespace from every line in text. If this behavior is intentional, textwrap.dedent does not do that, it does that, but also some other st

[issue30754] textwrap.dedent mishandles empty lines

2017-06-25 Thread Julian Berman
New submission from Julian Berman: ⊙ python2 -c 'from textwrap import dedent; print repr(dedent(" " * 2 + "\n" + " " * 4 + "\n"))' '\n\n' instead of the presumed '\n \n' The same appears to be the case for py3.6. (At first glance, this seems unrela

[issue29182] Remove the warning in urllib docs that it doesn't do certificate validate by default.

2017-01-27 Thread Julian Berman
Julian Berman added the comment: Cool! If I can nitpick one last time, in the versionchanged block, you have `HTTPS URIs` but in the warning you use `HTTPS Urls` -- probably best to use consistent casing and URL vs URI. Other than that, lgtm to merge

[issue29182] Remove the warning in urllib docs that it doesn't do certificate validate by default.

2017-01-25 Thread Julian Berman
Julian Berman added the comment: The change note belongs outside the seealso. I think also that wasn't exactly what Martin had in mind, I think he meant a `.. versionchanged` directive -- and given that this was originally a warning, personally I'd leave the warning but reword it, it's still

[issue19959] argparse.FileType does not expand tilde "~"

2016-03-28 Thread Julian Berman
Julian Berman added the comment: My support (or really, asking for a more generic callable) was to enable other use cases, not this one specifically -- e.g., allowing for constructing a pathlib Path or a twisted.python.filepath.FilePath without needing to write one's own argparse action

[issue20598] argparse docs: '7'.split() is confusing magic

2015-02-16 Thread Julian Berman
Julian Berman added the comment: +1 to lists all over, this is just confusing. -- nosy: +Julian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20598

[issue11664] Add patch method to unittest.TestCase

2014-10-12 Thread Julian Berman
Julian Berman added the comment: My opinion is already here re: patch vs patch.object, so I won't repeat it, but @Michael, if you really want .patch, are you open to adding .patch_object as well? (Regardless, thanks for working on this Julien

[issue22088] base64 module still ignores non-alphabet characters

2014-07-26 Thread Julian Berman
New submission from Julian Berman: The base64 module documentation claims that decode methods raise exceptions for non-base64 input, but they do not. There was a patch for Py3 done in issue1466065, but the documentation was not updated for Py2. I have not read that ticket carefully enough

[issue1466065] base64 module ignores non-alphabet characters

2014-07-26 Thread Julian Berman
Julian Berman added the comment: Created issue22088 to address not having fixed Py2 here. -- nosy: +Julian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1466065

[issue19959] argparse.FileType does not expand tilde ~

2013-12-14 Thread Julian Berman
Julian Berman added the comment: Why not take this a step further and make it take a callable that's expected to take the command line argument and coerce it into a path -- nosy: +Julian ___ Python tracker rep...@bugs.python.org http

[issue17909] Autodetecting JSON encoding

2013-12-01 Thread Julian Berman
Changes by Julian Berman julian+python@grayvines.com: -- nosy: +Julian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17909 ___ ___ Python-bugs

[issue19645] decouple unittest assertions from the TestCase class

2013-11-29 Thread Julian Berman
Changes by Julian Berman julian+python@grayvines.com: -- nosy: +Julian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19645 ___ ___ Python-bugs

[issue18335] Add textwrap.dedent, .indent, as str methods.

2013-08-15 Thread Julian Berman
Changes by Julian Berman julian+python@grayvines.com: -- nosy: +Julian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18335 ___ ___ Python-bugs

[issue18111] Add a default argument to min max

2013-06-08 Thread Julian Berman
Julian Berman added the comment: New patchset addressing review. Not sure why upload.py isn't working for me (I assume it should?) -- Added file: http://bugs.python.org/file30510/minmax.patch ___ Python tracker rep...@bugs.python.org http

[issue18111] Add a default argument to min max

2013-06-05 Thread Julian Berman
Julian Berman added the comment: Thanks for the offer Raymond. Here's a patch with some tests and doc updates, incorporating Nick's suggestion (but without a note in the docs, I didn't feel it's notable). Please let me know if anything needs tidying. -- Added file: http

[issue18054] Add more exception related assertions to unittest

2013-06-04 Thread Julian Berman
Julian Berman added the comment: I don't either really off the top of my head, though I've toyed with some things. If there's support for some exploration I wouldn't mind attempting a POC externally though. -- ___ Python tracker rep

[issue18111] Add a default argument to min max

2013-06-03 Thread Julian Berman
Julian Berman added the comment: Raymond, I respect that in your opinion this seems to be overcomplexity, but you haven't addressed any of the arguments made, nor responded to any of the arguments against this being added complexity. I really don't understand the parallels you're making

[issue18111] Add a default argument to min max

2013-06-03 Thread Julian Berman
Julian Berman added the comment: Personally I don't care either way, I basically never use the multiple positional arg form, but what are we trying to prevent exactly? It's bad code, but it (would) do what the person was expecting. Am I not getting the point that's being made about that case

[issue18054] Add more exception related assertions to unittest

2013-06-03 Thread Julian Berman
Julian Berman added the comment: Can I throw in, and hopefully not in a way that's too out of place, that I think that unittest might want to rethink it's strategy re: assertion methods? The fact that the object that has all the assertions and the object that has the logic for running a test

[issue18111] Add a default argument to min max

2013-06-02 Thread Julian Berman
Julian Berman added the comment: I don't really care to push this much harder, but I'll just repeat that I've already made an argument against catching the exception. Calling this making the API too complex also seems quite silly to me. It's a thing that someone looking for would find

[issue18111] Add a default argument to min max

2013-06-01 Thread Julian Berman
Julian Berman added the comment: Thanks for finding that, I thought there was an issue that came out of that p-i thread but couldn't find it. I'd like to be more concrete, but calling max on an iterable seems concrete enough to me. If you'd like to know more though, personally I've wanted

[issue18111] Add a default argument to min max

2013-06-01 Thread Julian Berman
Julian Berman added the comment: Yes that's a good description. I'm not sure the type of exception is the thing to look at as much as the behavior, I.e. I think next() is a good precedent. And it's not really pleasant to do this with a try/except. Of course everything's possible, but to catch

[issue18111] Add a default argument to min max

2013-06-01 Thread Julian Berman
Julian Berman added the comment: It's not exactly the same of course, but calling next on a thing that might be empty would be somewhat close, and also is replacing an exception with a sentinel (an exception that is much easier to differentiate). You can always get a ValueError out of min/max

[issue18111] Add a default argument to min max

2013-05-31 Thread Julian Berman
New submission from Julian Berman: This has come up a number of times I'm aware, but no one has ever written a patch for it as far as a quick look uncovered. So here's one (written by Thomas Wouters but with permission to submit). Submitting without tests and docs, but those are incoming when

[issue18111] Add a default argument to min max

2013-05-31 Thread Julian Berman
Changes by Julian Berman julian+python@grayvines.com: -- keywords: +patch Added file: http://bugs.python.org/file30437/minmaxdefault.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18111

[issue18050] embedded interpreter or virtualenv fails with ImportError: cannot import name MAXREPEAT

2013-05-27 Thread Julian Berman
Changes by Julian Berman julian+python@grayvines.com: -- nosy: +Julian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18050 ___ ___ Python-bugs

[issue17705] Fill Character cannot be \0

2013-04-12 Thread Julian Berman
New submission from Julian Berman: The docs say: The fill character can be any character other than ‘{‘ or ‘}’. http://docs.python.org/dev/library/string.html#format-specification-mini-language But: {0:\x018.2f}.format(12) '\x01\x01\x0112.00' whereas: {0:\x008.2f}.format(12) ' 12.00

[issue15351] Add to unittest.TestCase support for using context managers

2013-04-06 Thread Julian Berman
Julian Berman added the comment: Now that we have contextlib.ExitStack, I think we should consider that here. I.e., I think ExitStack deserves a method that calls its __enter__ and __exit__, say .enter() and .exit(), and then the idiom for this wouldn't require anything on TestCase, it'd

[issue9584] Allow curly brace expansion

2013-02-22 Thread Julian Berman
Changes by Julian Berman julian+python@grayvines.com: -- nosy: +Julian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9584 ___ ___ Python-bugs

[issue13349] Non-informative error message in index() and remove() functions

2012-11-10 Thread Julian Berman
Julian Berman added the comment: test_issuewhatever is a bit indescriptive. It'd be easier for someone glancing at the test to see what it claims to be testing if there were a more descriptive name given, like perhaps test_exception_message (or something even more verbose). -- nosy

[issue16293] curses.ungetch raises OverflowError when given -1

2012-10-21 Thread Julian Berman
Julian Berman added the comment: Hi, sorry for being terse :). After checking a bit, man 3 getch says that it returns ERR (-1) in non-blocking mode if no input is available. I think you're right though -- calling ungetch without checking for the error value seems like it should be a bug

[issue16293] curses.ungetch raises OverflowError when given -1

2012-10-20 Thread Julian Berman
New submission from Julian Berman: The following code now raises an OverflowError on 3.3: import curses def test_screen(screen): screen.nodelay(True) key = screen.getch() screen.nodelay(False) curses.ungetch(key) curses.wrapper(test_screen) or equivalently just def

[issue16279] namedtuple should compare equality with field names taken into account

2012-10-18 Thread Julian Berman
New submission from Julian Berman: I find the following to be unintuitive: Python 3.3.0rc1 (default, Sep 6 2012, 16:02:32) [GCC 4.2.1 Compatible Apple Clang 3.1 (tags/Apple/clang-318.0.58)] on darwin Type help, copyright, credits or license for more information. from collections import

[issue15987] Provide a way to compare AST nodes for equality recursively

2012-09-21 Thread Julian Berman
Julian Berman added the comment: I'd say yes (to both lineno/col_offset). And yeah that sounds like what I had in mind (a helper function). If I'm specific for a moment about implementation, perhaps something like `ast.diff`, which yielded tuples of differing nodes (in say, breadth first

[issue15987] Provide a way to compare AST nodes for equality recursively

2012-09-20 Thread Julian Berman
New submission from Julian Berman: As is, as far as I can tell, there's no way to easily compare two AST nodes to see if they have the same children and same fields (recursively). I'm writing some unit tests for a NodeTransformers, so I've settled for comparing `ast.dump()`s of each, which

[issue11664] Add patch method to unittest.TestCase

2012-09-18 Thread Julian Berman
Julian Berman added the comment: It's slightly less confusing -- Where do I patch is the question that will never go away, and the fact that you don't have the `sys` module imported is a small hint that you should be doing patch(mymodule.sys, path) not patch(sys.path). Also, the fact

[issue11664] Add patch method to unittest.TestCase

2012-09-18 Thread Julian Berman
Julian Berman added the comment: With all due respect, your response pretty much ignored mine completely. That's OK, I've agreed with you that patch seems more common. I'll point you additionally though to the fact that Éric's original post also used patch.object's semantics, as does

[issue7559] TestLoader.loadTestsFromName swallows import errors

2012-09-18 Thread Julian Berman
Changes by Julian Berman julian+python@grayvines.com: -- nosy: +Julian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7559 ___ ___ Python-bugs

[issue11664] Add patch method to unittest.TestCase

2012-09-15 Thread Julian Berman
Julian Berman added the comment: It's kind of unfortunate that `mock.patch` is called `mock.patch`. I was thinking about this a bit more yesterday, and `mock.patch.object` is the one that I think would be most appropriate to put on `TestCase`, and the best name for it is probably `patch

[issue15627] Add a method to importlib.abc.SourceLoader for converting source to a code object

2012-09-14 Thread Julian Berman
Changes by Julian Berman julian+python@grayvines.com: -- nosy: +Julian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15627 ___ ___ Python-bugs

[issue9253] argparse: optional subparsers

2012-09-13 Thread Julian Berman
Changes by Julian Berman julian+python@grayvines.com: -- nosy: +Julian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___ ___ Python-bugs

[issue11385] TextTestRunner methods are not documented

2012-09-12 Thread Julian Berman
Changes by Julian Berman julian+python@grayvines.com: -- nosy: +Julian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11385 ___ ___ Python-bugs

[issue15891] A public facing API for __unittest = True

2012-09-09 Thread Julian Berman
New submission from Julian Berman: Can `__unittest = True`, which is used to hide stack frames from tracebacks inside the testing framework, be documented as being public, or, if that's not acceptable, be replaced by something that is? `_exc_info_to_string` is a hairy function to need

[issue15867] make importlib documentation easier to use

2012-09-07 Thread Julian Berman
Julian Berman added the comment: Eric: Yeah I've seen that, it's the one thing that I kept open as I was turning back and forth through the various parts of importlib. So yeah I like that document certainly at least a bit :). Also thanks to both you and Brett for linking that issue, that's

[issue15867] It's hard to decypher how to build off of the provided objects from the importlib docs

2012-09-05 Thread Julian Berman
New submission from Julian Berman: I find that the importlib documentation is a bit too low level. Import hooks are not that common, so requiring a bit of reading is OK with me, but I somewhat *understand* PEP 302, so I have a general idea of *what* I want to do and what kind of objects can

[issue15867] It's hard to decypher how to build off of the provided objects from the importlib docs

2012-09-05 Thread Julian Berman
Changes by Julian Berman julian+python@grayvines.com: -- type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15867

[issue11664] Add patch method to unittest.TestCase

2012-09-04 Thread Julian Berman
Changes by Julian Berman julian+python@grayvines.com: -- nosy: +Julian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11664 ___ ___ Python-bugs

[issue15023] listextend (and therefore list.extend and list.__init__) peek at len before iter

2012-06-06 Thread Julian Berman
New submission from Julian Berman julian+python@grayvines.com: The following code raises an unexpected exception: class Foo(object): def __len__(self): raise Exception() def __iter__(self): return iter([]) list(Foo()) In the optimizations

[issue15023] listextend (and therefore list.extend and list.__init__) peek at len before iter

2012-06-06 Thread Julian Berman
Julian Berman julian+python@grayvines.com added the comment: Oh, and, with apologies for the double post, tuple does the same, while set, dict, collections.deque do not. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue14086] str(KeyError(Foo)) Unexpected Result

2012-02-22 Thread Julian Berman
Julian Berman julian+python@grayvines.com added the comment: Hey there. Check out #2651 -- nosy: +Julian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14086

[issue13826] Having a shlex example in the subprocess.Popen docs is confusing

2012-01-19 Thread Julian Berman
New submission from Julian Berman julian+python@grayvines.com: The example at http://docs.python.org/dev/library/subprocess.html#popen-constructor seems a bit misplaced, as it seems to suggest that one should use the shlex module. Most of the other examples in the module seem to use

[issue13826] Having a shlex example in the subprocess.Popen docs is confusing

2012-01-19 Thread Julian Berman
Julian Berman julian+python@grayvines.com added the comment: Sounds reasonable to me. I'll take a look at adding one unless someone manages to beat me to it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13826

[issue13774] json.loads raises a SystemError for invalid encoding on 2.7.2

2012-01-11 Thread Julian Berman
New submission from Julian Berman julian+python@grayvines.com: import json json.loads({}, [1, 2, 3]) Traceback (most recent call last): File input, line 1, in module File /usr/local/Cellar/python/2.7.2/lib/python2.7/json/__init__.py, line 339, in loads return cls(encoding=encoding

[issue7897] Support parametrized tests in unittest

2011-12-15 Thread Julian Berman
Changes by Julian Berman julian+python@grayvines.com: -- nosy: +Julian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7897 ___ ___ Python-bugs

[issue13585] Add contextlib.CleanupManager

2011-12-12 Thread Julian Berman
Julian Berman julian+python@grayvines.com added the comment: For reference, the implementation that I posted in the other thread is: @contextlib.contextmanager def maybe(got, contextfactory, *args, checkif=bool, **kwargs): if checkif(got): yield got else

[issue13523] Python does not warn in module .py files does not exist if there is still a .pyc file

2011-12-03 Thread Julian Berman
Julian Berman julian+python@grayvines.com added the comment: I know this is a feature, and on occasion as pointed out a useful one. But in some cases it can be a tad annoying as the OP probably considered it. I had a recent example where a lingering .pyc made my test suite pass (and me

[issue13437] Provide links to the source code for every module in the documentation

2011-11-26 Thread Julian Berman
Julian Berman julian+python@grayvines.com added the comment: Well, if there's opposition I don't know how strongly I feel about this then, but I generally agree with you Ezio, if there's an occasion where 1) applies fixing the docs is certainly reasonable. If I'm checking the source though

[issue13437] Provide links to the source code for every module in the documentation

2011-11-20 Thread Julian Berman
Julian Berman julian+python@grayvines.com added the comment: Here's first a quick list from one pass over the docs. I've attempted to limit myself to a few like you've suggested, though I'll wait for confirmation that Raymond is not willing to simply add them to everything once we're

[issue13437] Provide links to the source code for every module in the documentation

2011-11-19 Thread Julian Berman
New submission from Julian Berman julian+python@grayvines.com: The documentation occasionally contains a link to the source code for a module in the stdlib. See for instance http://docs.python.org/library/urlparse.html and http://docs.python.org/library/collections.html , or many others

[issue13241] llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7)

2011-10-27 Thread Julian Berman
Changes by Julian Berman julian+python@grayvines.com: -- nosy: +Julian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13241 ___ ___ Python-bugs

[issue13241] llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7)

2011-10-27 Thread Julian Berman
Julian Berman julian+python@grayvines.com added the comment: I was unsuccessful building tip with any of the 3 compilers. Full paste of output from ./configure and make, along with haypo's test file are attached. http://paste.pound-python.org/show/14320/ I'm on 10.7.2, XCode is 4.1

[issue13241] llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7)

2011-10-27 Thread Julian Berman
Julian Berman julian+python@grayvines.com added the comment: Never mind, yes, you're correct, somehow my build dir must have been dirty. Sorry bout that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13241

[issue12941] add random.pop()

2011-09-08 Thread Julian Berman
Julian Berman julian+python@grayvines.com added the comment: Considering this is pretty easily written more or less as r = range(20) r.pop(random.randrange(0, len(r))) is it really worth adding? -- nosy: +Julian ___ Python tracker rep

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2011-08-22 Thread Julian Berman
Julian Berman julian+python@grayvines.com added the comment: we explicitly advise against importing too many modules in a single import statement, but importing multiple names from a single location is often a useful thing to do. Cool. I imagined this had to do with it. there may

[issue12760] Add create mode to open()

2011-08-18 Thread Julian Berman
Julian Berman julian+python@grayvines.com added the comment: A minor documentation error in io.rst line 475 which was changed to: + The *mode* can be ``'c'``, ``'r'``, ``'w'`` or ``'a'`` for reading + (default), writing, or appending. and should have creating at the front I assume

[issue2651] Strings passed to KeyError do not round trip

2011-08-18 Thread Julian Berman
Changes by Julian Berman julian+python@grayvines.com: -- nosy: +Julian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2651 ___ ___ Python-bugs

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2011-08-18 Thread Julian Berman
New submission from Julian Berman julian+python@grayvines.com: Using multiple `with` statements across multiple lines does not support using parens to break them up: with (open(a_really_long_foo) as foo, open(a_really_long_bar) as bar): pass Traceback (most recent call last