Eric V. Smith added the comment:
I think having two ways to do the same thing in a module targeted toward
beginners would be too confusing.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue42
Eric V. Smith added the comment:
It would figure it out automatically. See
https://github.com/ericvsmith/dataclasses/blob/master/dataclass_tools.py for a
decorator that already does this.
I'll have a PR ready soon, I hope.
--
___
Python tr
Eric V. Smith added the comment:
If the implementation compares the classes, then I think the "roughly
equivalent" version should, too.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.o
Eric V. Smith added the comment:
New changeset bbeb2d266d6fc1ca9778726d0397d9d6f7a946e3 by Jürgen Gmach in
branch 'master':
bpo-42344: Improve pseudo implementation for SimpleNamespace (GH-23264)
https://github.com/python/cpython/commit/bbeb2d266d6fc1ca9778726d0397d9
Change by Eric V. Smith :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Eric V. Smith added the comment:
New changeset cb2b2035ca752529755440990c4073d5164e80df by Miss Islington (bot)
in branch '3.8':
bpo-42344: Improve pseudo implementation for SimpleNamespace (GH-23264)
(GH-23269)
https://github.com/python/cpyt
Eric V. Smith added the comment:
New changeset 4defeb007195d2d17ea404b0b6291d1d233010f4 by Miss Islington (bot)
in branch '3.9':
bpo-42344: Improve pseudo implementation for SimpleNamespace (GH-23264)
(GH-23270)
https://github.com/python/cpyt
Eric V. Smith added the comment:
I think you should bring this up on the python-ideas mailing list if you'd like
to see it discussed. It will likely also require a PEP, similar to PEP 584.
--
nosy: +eric.smith
___
Python tracker
&
Eric V. Smith added the comment:
I'm changing from "crash" to "behavior". We use "crash" for a segfault or
equivalent. I realize that most people are unlikely to know this, but we
consider "crash" to be more alarming, so I want to make sure
Eric V. Smith added the comment:
This is defined behavior in the language, so it's not a bug. The "pythonic" way
to deal with this is usually:
def funct(self, array = None):
if array is None:
array = []
--
components: +Interpreter Core -ctypes
no
Change by Eric V. Smith :
--
nosy: +eric.snow
___
Python tracker
<https://bugs.python.org/issue40998>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
Too many Eric S's!
--
___
Python tracker
<https://bugs.python.org/issue40998>
___
___
Python-bugs-list mailing list
Change by Eric V. Smith :
--
assignee: -> eric.smith
___
Python tracker
<https://bugs.python.org/issue42414>
___
___
Python-bugs-list mailing list
Unsubscrib
Eric V. Smith added the comment:
How would you expect to extract this docstring?
I'm not sure how this would work in practice, since both of these are errors:
>>> class A:
...def __init__(self):
...self.x = 3
...self.x.__doc__ = 'foo'
...
>&g
Eric V. Smith added the comment:
@property has a place to attach the docstring, dataclasses in general do not. I
wouldn't want to add a descriptor just to have the ability to add a docstring.
There are performance issues involved, and I'm sure some corner cases where
functiona
Change by Eric V. Smith :
--
resolution: not a bug -> fixed
___
Python tracker
<https://bugs.python.org/issue28002>
___
___
Python-bugs-list mailing list
Un
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue42422>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
A few things:
- There is no %-formatting for Decimal types. They're being converted to float
first. That's why it appears that %-formatting with 'g' works the same for
decimal and float: you're really just calling the float version
Eric V. Smith added the comment:
This seems to be a question for Google.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue42436>
___
___
Eric V. Smith added the comment:
requests is a third-party library, and this isn't the right place to report
issues with it. It looks like the requests issue tracker is at
https://github.com/psf/requests/issues
If you can duplicate this problem with only using the python standard li
Eric V. Smith added the comment:
Thanks for the reproducer and the research!
https://tools.ietf.org/html/rfc2616#section-3.1 says the result header is
"HTTP", and doesn't say anything else is acceptable. I'd be interested in what
other frameworks (probably in other lang
Eric V. Smith added the comment:
@BTaskaya: do you think this is too similar to bogus_code_obj.py? That's the
only crasher I can see it being similar to.
--
versions: +Python 3.10 -Python 3.6, Python 3.7
___
Python tracker
&
Change by Eric V. Smith :
--
status: open -> pending
___
Python tracker
<https://bugs.python.org/issue42436>
___
___
Python-bugs-list mailing list
Unsubscrib
Eric V. Smith added the comment:
This isn't a bug. All of your nested lists are the same. See for example:
https://stackoverflow.com/questions/44195396/initializing-an-m-x-n-array-of-0s-in-python
--
components: -Regular Expressions
nosy: +eric.smith
resolution: -> not a b
Eric V. Smith added the comment:
I don't think the readability of the examples would be improved by triple
quotes. In fact, I think it would be reduced.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/is
Eric V. Smith added the comment:
I just stumbled across this. I don't think the idea is totally without merit,
although maybe it's too niche to warrant being in the stdlib. It should
probably be discussed on python-ideas first.
--
versions: +Python 3.10 -Python 2.7,
Change by Eric V. Smith :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue42462>
___
___
Eric V. Smith added the comment:
Although I do have to say it wouldn't offend me if the partition and
nth_combination examples were changed to double quotes to be consistent! But
it's not important.
--
___
Python tracker
<https://bu
Eric V. Smith added the comment:
I'm not sure what you mean by iterating over the interfaces in a subnet. Could
you give an example?
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/is
Eric V. Smith added the comment:
I agree it's not the best error message. What's happening is that these types
(list, tuple, etc.) do not implement __format__, so object.__format__ is used.
It returns str(self). Then the resulting string is formatted with the given
format_spec.
Eric V. Smith added the comment:
Changing to a documentation issue.
--
assignee: eric.smith -> docs@python
components: +Documentation -Interpreter Core
keywords: +easy
nosy: +docs@python
versions: +Python 2.7
___
Python tracker
&l
Eric V. Smith added the comment:
What is the expected output, and why?
I think the error message might be incorrect, possibly it should be "invalid
format specifier".
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.o
Eric V. Smith added the comment:
I'm not sure what you're saying here. Is it that 'xx' should be ignored? The
documentation says that 'xx' isn't fill and alignment, not that they don't
exist. If they're not fill and
Eric V. Smith added the comment:
The only error is the text of the ValueError. I'll look into fixing that. These
characters will not be ignored.
--
___
Python tracker
<http://bugs.python.org/is
Eric V. Smith added the comment:
Changing to 3.3: I don't think applying this to 3.2 would be appropriate.
--
assignee: -> eric.smith
keywords: +easy
priority: normal -> low
stage: -> needs patch
title: In str.format an incorrect alignment option doesn't make fi
Eric V. Smith added the comment:
As I look at it a little closer, I think I'm going to change the message to:
"Invalid format type specified". The code has determined that instead of a type
that's a single character long, it's received "xx10d". That
Eric V. Smith added the comment:
The existing exceptions use the text "format code" for what the documentation
calls "type":
>>> format(9, "h")
Traceback (most recent call last):
File "", line 1, in
ValueError: Unknown format code
Eric V. Smith added the comment:
I don't think "{}" is the correct way to document this. These all have an empty
format specifier:
"{}".format(foo)
"{:}".format(foo)
"{0}".format(foo)
"{0:}".format(foo)
"{name}".format(
Eric V. Smith added the comment:
While looking at object.__format__, I recall that we've already addressed this,
sort of. For a different reason, this is already deprecated in 3.3 and will
become an error in 3.4. See issues 9856 and 7994.
$ ./python -Wd
Python 3.3.0a0 (default:40e1be1
Eric V. Smith added the comment:
The error message will be: "non-empty format string passed to
object.__format__".
I agree with your comment about Terry's patch.
--
___
Python tracker
<http://bugs.pyt
Eric V. Smith added the comment:
See issue #7098 for a discussion.
I propose to close this issue.
--
nosy: +eric.smith, mark, skrah
___
Python tracker
<http://bugs.python.org/issue13
Changes by Eric V. Smith :
--
nosy: +mark.dickinson -mark
___
Python tracker
<http://bugs.python.org/issue13838>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric V. Smith :
--
resolution: -> duplicate
status: open -> closed
superseder: -> Add alternate float formatting styles to new-style formatting.
___
Python tracker
<http://bugs.python.or
Changes by Eric V. Smith :
--
nosy: +eric.smith, mark.dickinson
___
Python tracker
<http://bugs.python.org/issue13889>
___
___
Python-bugs-list mailing list
Unsub
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue13882>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric V. Smith :
--
nosy: +bethard, eric.smith
___
Python tracker
<http://bugs.python.org/issue13922>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
That's definitely the expected behavior. It's the same as the C library version
of ctime().
But I couldn't find it documented in the Python docs, so I'm changing this to a
documentation issue.
Thanks for the report.
--
assig
Eric V. Smith added the comment:
This is working as defined in PEP 3101: it calls PySequence_GetItem() or
PyObject_GetItem() on the value inside the brackets. There is indeed no item in
d that is the string "0" (including the quotes).
--
assignee: -> eric.smi
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue14019>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue14057>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue14123>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
I can't reproduce this. Can you please post the entire traceback? It would be
preferable if you could also show the exact code that's causing the problem,
typed from a python command prompt (see my example below).
I can reproduce the error if I pass
Eric V. Smith added the comment:
I'm going to close this. Feel free to re-open it if you can give a small
example showing the problem.
--
resolution: -> invalid
status: open -> closed
type: crash -> behavior
___
Python
Eric V. Smith added the comment:
I don't think it's worth checking that you've passed in the correct type for
the default parameter. That's not something that Python code typically does.
The error you get:
AttributeError: 'tuple' object has no attribute 'a
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue14243>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue2377>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Eric V. Smith :
Presumably this needs to use requires_zlib.
$ time ./python -m test test_logging
[1/1] test_logging
test test_logging crashed -- Traceback (most recent call last):
File "/home/eric/local/python/cpython/Lib/test/regrtest.py", line 1229, in
run
Changes by Eric V. Smith :
--
title: regex.finditer() doesn't accept keyword arguments -> re.finditer()
doesn't accept keyword arguments
___
Python tracker
<http://bugs.pytho
Changes by Eric V. Smith :
--
title: regex.groupindex available for modification and continues to work,
having incorrect data inside it -> re.groupindex available for modification and
continues to work, having incorrect data inside it
___
Pyt
Changes by Eric V. Smith :
--
assignee: -> eric.smith
___
Python tracker
<http://bugs.python.org/issue14256>
___
___
Python-bugs-list mailing list
Unsubscri
Changes by Eric V. Smith :
--
stage: -> patch review
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue14256>
___
___
Python-bugs-list
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue14331>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue14339>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
I agree with David. It's a bug. I have programs (not using argparse yet) that
do exactly what he describes.
--
___
Python tracker
<http://bugs.python.org/is
Eric V. Smith added the comment:
No. parse_known_args assumes you have known and unknown args intermixed.
Going back to the original example, what if "hack" and ":target" had
overlapping parameter names (say, they both supported "--arg1")? I think
pars
Changes by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue14425>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
Can we change this to a documentation bug? I was unaware of the use of '-', and
I think most other people are, too.
Although having just checked, it doesn't work under Windows :(. So maybe we
shouldn't document it.
Thinking out loud: I
Eric V. Smith added the comment:
Heh. You're correct about 3173. And I'm even nosy on that issue!
--
___
Python tracker
<http://bugs.python.o
Eric V. Smith added the comment:
While I still think raising those errors is a good thing, we should also look
at Nick's shell-command:
http://shell-command.readthedocs.org/en/latest/index.html
--
___
Python tracker
<http://bugs.py
Eric V. Smith added the comment:
See also issue 14243.
--
nosy: +eric.smith
___
Python tracker
<http://bugs.python.org/issue14514>
___
___
Python-bugs-list mailin
Eric V. Smith added the comment:
list.reverse() does not reverse a list, it reverses its current values.
>>> help([].reverse)
Help on built-in function reverse:
reverse(...)
L.reverse() -- reverse *IN PLACE*
>>>
--
nosy: +eric.smith
resolution: -> invalid
Eric V. Smith added the comment:
Thanks, Mark.
Indeed, my answer as written is meaningless. I meant it doesn't sort in
reverse, it just reverses.
--
___
Python tracker
<http://bugs.python.org/is
Eric V. Smith added the comment:
You could add a flag in the exception to tell the default handler where to
write the message. It would default to stderr.
This would make it possible to catch the exception before it was written out,
and customize the behavior.
--
nosy: +eric.smith
Eric V. Smith added the comment:
Unfortunately your change isn't backward compatible with the existing
(namedtuple) version.
I expect this to fail in the dataclass version:
>>> finder, name, ispkg = list(pkgutil.iter_modules(None))[0]
And since this is an enhancement, it can
Eric V. Smith added the comment:
I'm not sure all of this churn is worth it for an unusual use case that can be
satisfied by:
>>> sorted(pkgutil.iter_modules(None), key=lambda x: (x[1], x[2])
or even:
>>> sorted(pkgutil.iter_modules(None), key=operator.itemgetter(1)
Eric V. Smith added the comment:
I agree. Sorry, BTaskaya, but I just don't think the benefit of this change is
worth the disruption.
--
resolution: -> wont fix
stage: patch review -> resolved
status: open -> closed
___
Python t
Eric V. Smith added the comment:
Please show us what command you are running when you try to specify
--requirement, and what the result is.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue36
Change by Eric V. Smith :
--
stage: -> test needed
status: open -> pending
type: -> behavior
___
Python tracker
<https://bugs.python.org/issue36978>
___
___
Eric V. Smith added the comment:
I don’t think this is worth changing. I’m planning on removing the expr_text
field before beta 1. At which point I don’t think there will be any work to do
here.
See https://mail.python.org/pipermail/python-dev/2019-May/157493.html
Also, can you explain
Eric V. Smith added the comment:
Never mind on the failing code. I see your test cases now.
--
___
Python tracker
<https://bugs.python.org/issue37003>
___
___
Eric V. Smith added the comment:
Thanks for the recap, Matthias. Once I remove expr_text (hopefully this
weekend!), we should still at least add tests to make sure nothing fails, even
with the ast-expanded version of the = f-strings
New submission from Eric V. Smith :
I added the expr_text optional field to the FormattedValue node in order to
implement the '=' feature of f-strings (see issue 36817).
However, the expr_text field isn't strictly needed. Instead, the same feature
could be added with another
Eric V. Smith added the comment:
Line 41 is indented 4 spaces past line 38, but should not be.
You'd be better served by first asking questions like this on the python-list
mailing list.
--
nosy: +eric.smith
resolution: -> not a bug
stage: -> resolved
status: ope
Eric V. Smith added the comment:
I'm pretty sure there's already an issue for this, but I don't have time to
search for it now.
This is not an easy problem to solve. I've been working on it on and off for
almost a year. I'll eventually get to it, but the ch
Change by Eric V. Smith :
--
keywords: +patch
pull_requests: +13504
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/13597
___
Python tracker
<https://bugs.python.org/issu
Eric V. Smith added the comment:
I think this would be better suited for a linter.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue37
Eric V. Smith added the comment:
New changeset 6f6ff8a56518a80da406aad6ac8364c046cc7f18 by Eric V. Smith in
branch 'master':
bpo-37050: Remove expr_text from FormattedValue ast node, use Constant node
instead (GH-13597)
https://github.com/python/cpyt
Change by Eric V. Smith :
--
priority: release blocker ->
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
type: -> behavior
___
Python tracker
<https://bugs.pyt
New submission from Eric V. Smith :
This addresses a few issues Serhiy found in the review for issue 37050 at
https://github.com/python/cpython/pull/13597. Patch to follow.
--
assignee: eric.smith
components: Interpreter Core
messages: 343722
nosy: eric.smith, serhiy.storchaka
Change by Eric V. Smith :
--
keywords: +patch
pull_requests: +13513
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/13607
___
Python tracker
<https://bugs.python.org/issu
Eric V. Smith added the comment:
mbussonn: can you re-check this in light of the changes for issue37050? I'm not
sure if there's still a problem that needs fixing or not.
--
___
Python tracker
<https://bugs.python.o
Eric V. Smith added the comment:
New changeset f83d1dbd3bfbde940117c85f5c70de00e47b7e6e by Eric V. Smith in
branch 'master':
bpo-37070: Cleanup fstring debug handling (GH-13607)
https://github.com/python/cpython/commit/f83d1dbd3bfbde940117c85f5c70de
Change by Eric V. Smith :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Eric V. Smith added the comment:
I think it's reasonable to change the TypeError to say integer or float. That's
what _PyTime_FromObject is looking for.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.o
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue37103>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
Could you show a problem caused by the characters that are unescaped? I assume
you're talking about the ` and ' characters, since that's what your example
shows. But those aren't listed as "special characters"
(https://docs.
Eric V. Smith added the comment:
re.escape() is designed to only escape characters that have special meaning in
regular expressions. It is not a general purpose escaping mechanism, and it is
especially dangerous to use it for building SQL statements.
You should be using parameterized SQL
Eric V. Smith added the comment:
See http://unicode.org/faq/casemap_charprop.html, search for "Why does ß
(U+00DF LATIN SMALL LETTER SHARP S) not uppercase to U+1E9E LATIN CAPITAL
LETTER SHARP S by default?"
--
nosy: +eric.smith
___
Pyth
Eric V. Smith added the comment:
New changeset 01ee12ba35a333e8a6a25c4153c4a21838e9585c by Eric V. Smith
(Augusto Hack) in branch 'master':
bpo-33569 Preserve type information with dataclasses.InitVar (GH-8927)
https://github.com/python/cpython/commit/01ee12ba35a333e8a6a25c4153c4a2
Eric V. Smith added the comment:
Thanks for the PR!
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
type: -> behavior
___
Python tracker
<https://bugs.python
1301 - 1400 of 2699 matches
Mail list logo