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: +
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
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
Change by Julian Berman :
--
nosy: +Julian
___
Python tracker
<https://bugs.python.org/issue36384>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Julian Berman :
--
nosy: +Julian
___
Python tracker
<https://bugs.python.org/issue22282>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
Change by Julian Berman :
--
nosy: +Julian
___
Python tracker
<https://bugs.python.org/issue43154>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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 recent
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
>
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
Change by Julian Berman :
--
nosy: +yselivanov
versions: -Python 3.8, Python 3.9
___
Python tracker
<https://bugs.python.org/issue41745>
___
___
Python-bug
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, **boun
Change by Julian Berman :
--
nosy: +Julian
___
Python tracker
<https://bugs.python.org/issue40379>
___
___
Python-bugs-list mailing list
Unsubscribe:
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,
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
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
>
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
`run
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
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
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
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"}.value
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
a
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 stuff.
As
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 f
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
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,
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.
Julian Berman added the comment:
+1 to lists all over, this is just confusing.
--
nosy: +Julian
___
Python tracker
<http://bugs.python.org/issue20598>
___
___
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 J
Julian Berman added the comment:
Created issue22088 to address not having fixed Py2 here.
--
nosy: +Julian
___
Python tracker
<http://bugs.python.org/issue1466
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 to
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
<http://bugs.python.org/is
Changes by Julian Berman :
--
nosy: +Julian
___
Python tracker
<http://bugs.python.org/issue17909>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Julian Berman :
--
nosy: +Julian
___
Python tracker
<http://bugs.python.org/issue19645>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Julian Berman :
--
nosy: +Julian
___
Python tracker
<http://bugs.python.org/issue18335>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
<http://bugs.python.org/is
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.
---
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.
--
___
P
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 runn
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
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
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
lookin
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 mi
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 po
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 thoug
Changes by Julian Berman :
--
keywords: +patch
Added file: http://bugs.python.org/file30437/minmaxdefault.patch
___
Python tracker
<http://bugs.python.org/issue18
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 inc
Changes by Julian Berman :
--
nosy: +Julian
___
Python tracker
<http://bugs.python.org/issue18050>
___
___
Python-bugs-list mailing list
Unsubscribe:
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:\x01>8.2f}".format(12)
'\x01\x01\x0112.00'
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
Changes by Julian Berman :
--
nosy: +Julian
___
Python tracker
<http://bugs.python.org/issue9584>
___
___
Python-bugs-list mailing list
Unsubscribe:
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).
--
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 b
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
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" fo
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, bre
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
Changes by Julian Berman :
--
nosy: +Julian
___
Python tracker
<http://bugs.python.org/issue7559>
___
___
Python-bugs-list mailing list
Unsubscribe:
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&
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
pat
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`
Changes by Julian Berman :
--
nosy: +Julian
___
Python tracker
<http://bugs.python.org/issue15627>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Julian Berman :
--
nosy: +Julian
___
Python tracker
<http://bugs.python.org/issue9253>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Julian Berman :
--
nosy: +Julian
___
Python tracker
<http://bugs.python.org/issue11385>
___
___
Python-bugs-list mailing list
Unsubscribe:
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 ne
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 iss
Changes by Julian Berman :
--
type: -> enhancement
___
Python tracker
<http://bugs.python.org/issue15867>
___
___
Python-bugs-list mailing list
Unsubscri
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
New submission from Julian Berman:
Mock's assertion failures can be extremely hard to read for a few reasons --
mostly the noisy default repr that mock objects have, but also because they
don't give you the hints that `unittest.TestCase`'s `assert*` methods give you
(things l
Changes by Julian Berman :
--
nosy: +Julian
___
Python tracker
<http://bugs.python.org/issue11664>
___
___
Python-bugs-list mailing list
Unsubscribe:
Julian Berman added the comment:
Oh, and, with apologies for the double post, tuple does the same, while set,
dict, collections.deque do not.
--
___
Python tracker
<http://bugs.python.org/issue15
New submission from Julian Berman :
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 being done in listextend, it
Julian Berman added the comment:
Hey there. Check out #2651
--
nosy: +Julian
___
Python tracker
<http://bugs.python.org/issue14086>
___
___
Python-bugs-list m
Julian Berman 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
<http://bugs.python.org/is
New submission from Julian Berman :
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 a list to provide the
args, so if
New submission from Julian Berman :
>>> import json
>>> json.loads("{}", [1, 2, 3])
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/Cellar/python/2.7.2/lib/python2.7/json/__init__.py", line
339, in loads
return cls
Changes by Julian Berman :
--
nosy: +Julian
___
Python tracker
<http://bugs.python.org/issue7897>
___
___
Python-bugs-list mailing list
Unsubscribe:
Julian Berman 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:
with
Julian Berman 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
nearly push broken code) despite
Julian Berman 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,
it
Julian Berman 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 at it :)
New submission from Julian Berman :
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.
With a quick perusal, I
Julian Berman added the comment:
Never mind, yes, you're correct, somehow my build dir must have been dirty.
Sorry bout that.
--
___
Python tracker
<http://bugs.python.org/is
Julian Berman 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 (compiler versions in
Changes by Julian Berman :
--
nosy: +Julian
___
Python tracker
<http://bugs.python.org/issue13241>
___
___
Python-bugs-list mailing list
Unsubscribe:
Julian Berman 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
<http://bugs.python.org/issue12
Julian Berman 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 be a gramm
New submission from Julian Berman :
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):
Changes by Julian Berman :
--
nosy: +Julian
___
Python tracker
<http://bugs.python.org/issue2651>
___
___
Python-bugs-list mailing list
Unsubscribe:
Julian Berman 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&q
91 matches
Mail list logo