Eric V. Smith added the comment:
Okay. I'm sure Ned is relieved!
--
priority: release blocker ->
resolution: -> wont fix
stage: -> resolved
status: open -> closed
type: -> behavior
___
Python tracker
<https://bug
Eric V. Smith added the comment:
The way to avoid this problem is to not assign to str. You should not shadow
python builtins that you want to continue using.
--
nosy: +eric.smith
resolution: -> not a bug
stage: -> resolved
status: open -> closed
type: compile error
Eric V. Smith added the comment:
I think you're seeing identifier normalization. See this SO question for a
description of the issue:
https://stackoverflow.com/questions/34097193/identifier-normalization-why-is-the-micro-sign-converted-into-the-greek-letter
--
nosy: +eric.
Eric V. Smith added the comment:
This seems like a reasonable request.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue33569>
___
___
Pytho
Eric V. Smith added the comment:
This was a deliberate design choice, and as Serhiy notes, at least partially
driven by translations. It seems to me it would be a job for a linter to point
out a problem, if the string is a constant.
--
nosy: +eric.smith
Eric V. Smith added the comment:
I still think it's a job for a linter, even if the compiler optimizes away the
call to .format().
--
___
Python tracker
<https://bugs.python.org/is
Eric V. Smith added the comment:
To be clear: os.path.exists('a\x00b') raises ValueError on both Windows and
Linux.
I think we should just document this behavior and not change it.
--
nosy: +eric.smith
___
Python tracker
<https://bu
Eric V. Smith added the comment:
'n' is defined as the same as 'g', for floats (modulo the locale-specific
characters, of course):
>>> format(1.89, '.2n')
'1.9'
>>> format(1.89, '.2g')
'1.9'
--
__
Eric V. Smith added the comment:
I'm going to close this. If you still think there's an issue, we can re-open it.
--
assignee: -> eric.smith
components: +Interpreter Core -Extension Modules
resolution: -> not a bug
stage: -> resolved
sta
Eric V. Smith added the comment:
You can always use the locale module, although of course that's not as
convenient:
>>> locale.format('%.2f', 1.891)
'1.89'
I'm open to suggests on backward compatible ways to implement this for python
3.8. It would pro
Eric V. Smith added the comment:
I don't know of any OS that supports NULs in filenames (not that my knowledge
is encyclopedic).
My reason for suggesting we document it is that os.path.exists() returns False
for otherwise invalid filenames, where something like open() raises. On Wi
Eric V. Smith added the comment:
What is the goal here? Are you just trying to simplify ast.c?
My concern is that there are many, many edge cases, and that you'll be
unknowingly changing the behavior of f-strings.
One of the goals of the f-string specification is for a simple third-
Eric V. Smith added the comment:
I'm not completely opposed to it, but I need to understand the benefits and
side effects.
And I wouldn't exactly describe the multiple passes over the string as
"parsing", but I see your point.
--
__
Change by Eric V. Smith :
--
assignee: -> eric.smith
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue33796>
___
___
Python-bugs-list mai
Eric V. Smith added the comment:
Thanks for the report. This is the same error you get when using any non-field:
>>> @dataclass
... class C:
... i: int
...
>>> c = C(4)
>>> replace(c, i=3)
C(i=3)
>>> replace(c, j=3)
Traceback (most recent call last):
Eric V. Smith added the comment:
Ah, you're right. I did misunderstand. Thanks for correcting me. PR soon.
--
nosy: +ned.deily
priority: normal -> release blocker
___
Python tracker
<https://bugs.python.org
Change by Eric V. Smith :
--
title: dataclasses.replace broken with class variables -> dataclasses.replace
broken if a class has any ClassVars
versions: +Python 3.8
___
Python tracker
<https://bugs.python.org/issu
Eric V. Smith added the comment:
Ned: How do you feel about backporting this to 3.7?
It's an unfortunate bug, but it's your call for 3.7.0 vs. 3.7.1.
--
___
Python tracker
<https://bugs.python.o
Change by Eric V. Smith :
--
keywords: +patch
pull_requests: +7113
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue33796>
___
___
Py
Eric V. Smith added the comment:
New changeset e7adf2ba41832404100313f9ac9d9f7fabedc1fd by Eric V. Smith in
branch 'master':
bpo-33796: Ignore ClassVar for dataclasses.replace(). (GH-7488)
https://github.com/python/cpython/commit/e7adf2ba41832404100313f9ac9d9f
Eric V. Smith added the comment:
Thanks, Ned. I've backported it.
--
components: +Library (Lib)
priority: release blocker -> normal
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
type: -> behavior
__
New submission from Eric V. Smith :
If a dataclass contains an InitVar without a default value, that InitVar must
be specified in the call to replace(). This is because replace() works by first
creating a new object, and InitVars without defaults, by definition, must be
specified when
Eric V. Smith added the comment:
Which link are you referring to?
I don't see any code you've provided where you're reopening a connection. It
looks like you're opening a new connection, reading, writing, and nothing else.
It also looks like the output you show is co
Eric V. Smith added the comment:
This sounds like an application-level issue, not a telnetlib problem. As far as
I can tell, you're opening a new connection, not reusing an existing connection.
--
___
Python tracker
<https://bugs.py
Eric V. Smith added the comment:
It would be helpful if you could show what output you see, and how it differs
from what you expect.
I think you're just seeing reference cycles or some other delayed garbage
collection. If you put in a gc.collect() in your loops to force a colle
Eric V. Smith added the comment:
To elaborate on Zach's comment:
Notice that your first example repeats 0 19 times. The second example repeats
nothing 19 times.
If you first example returned a list with [0] repeated 19 (that is: [[0], [0],
[0], ..., [0]]), then you're correct
Eric V. Smith added the comment:
Agreed with Stefan about this not being appropriate for the bug tracker.
And I'm saying that I don't agree with you. There's no bug here.
--
___
Python tracker
<https://bugs.pyt
Eric V. Smith added the comment:
This is happening because the string "ID" is special to the SYLK format:
https://en.wikipedia.org/wiki/SYmbolic_LinK_(SYLK)
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.o
Eric V. Smith added the comment:
This is because Exception does not define __format__, so object.__format__ is
being called. object.__format__ does not allow any format specifier to be used.
You get the same error for any object without its own __format__, when you
supply a format spec
Change by Eric V. Smith :
--
resolution: works for me -> not a bug
___
Python tracker
<https://bugs.python.org/issue33844>
___
___
Python-bugs-list mai
Eric V. Smith added the comment:
You should ask your question on this mailing list:
https://mail.python.org/mailman/listinfo/python-list
The bug tracker is not a place for asking how to use Python. If you actually
find a bug in Python, you can re-open this issue. I do not believe that what
Eric V. Smith added the comment:
Not that it really matters to this issue, but here's how dataclasses and attrs
deal with this:
dataclasses has the same issue, via make_dataclass().
attrs gives a syntax error with your field names, but interestingly this
succeeds:
>>&
New submission from Eric V. Smith :
See issue 33880 for the same issue with namedtuple.
This shows up on dataclasses only through make_dataclass. This is an expected
ValueError:
>>> make_dataclass('a', ['a', 'b', 'c', 'a'])
Trace
Eric V. Smith added the comment:
See issue 33881 for the corresponding dataclasses issue.
--
nosy: +rhettinger
___
Python tracker
<https://bugs.python.org/issue33
Eric V. Smith added the comment:
Actually, should this be NKFC?
>From https://docs.python.org/3.6/reference/lexical_analysis.html#identifiers :
"All identifiers are converted into the normal form NFKC while parsing;
comparison of identifiers is based
Change by Eric V. Smith :
--
title: dataclasses should use NFKD to find duplicate members -> dataclasses
should use NFKC to find duplicate members
___
Python tracker
<https://bugs.python.org/issu
Eric V. Smith added the comment:
"If tempdir is unset or None" means "If tempdir has not been assigned to, or if
it has been assigned the value None". "Unset" doesn't mean "delete from the
module".
I agree the documentation wording could be im
Eric V. Smith added the comment:
I like philiprowlands' version:
- If tempdir is unset or None at any call to
+ If tempdir is None (the default) at any call to
Care to produce a PR?
--
versions: +Python 2.7, Python 3.6, Python 3.7
___
P
Eric V. Smith added the comment:
New changeset b225cb770fb17596298f5a05c41a7c90c470c4f8 by Eric V. Smith (Miss
Islington (bot)) in branch '3.6':
bpo-33894: Clarified the tempfile.tempdir documentation (GH-7829) (GH-7842)
https://github.com/python/cpyt
Eric V. Smith added the comment:
Also +1.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue33944>
___
___
Python-bugs-list mailin
Eric V. Smith added the comment:
My understanding about symlinks on Windows is that they require a permission
("Create symbolic links"), that normal users by default do not have. I'm not
sure if this has changed recently.
--
___
Change by Eric V. Smith :
--
assignee: -> eric.smith
___
Python tracker
<https://bugs.python.org/issue33569>
___
___
Python-bugs-list mailing list
Unsubscrib
New submission from Eric V. Smith :
>>> @dataclass
... class C:
... f: "C"
...
>>> c = C(None)
>>> c.f = c
>>> c
Traceback (most recent call last):
File "", line 1, in
File "", line 2, in __repr__
File "", line
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue33946>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
New changeset 3d70f7aef614c396f516b5fccedeebe98598714d by Eric V. Smith
(Dong-hee Na) in branch 'master':
bpo-33805: Improve error message of dataclasses.replace() (GH-7580)
https://github.com/python/cpython/commit/3d70f7aef614c396f516b5fccedeeb
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:
Thanks, Raymond. I'm working on a patch.
--
versions: +Python 3.8
___
Python tracker
<https://bugs.python.org/is
Change by Eric V. Smith :
--
nosy: +eric.smith
versions: +Python 3.8
___
Python tracker
<https://bugs.python.org/issue33961>
___
___
Python-bugs-list mailin
Eric V. Smith added the comment:
The dict and OrderedDict APIs are slightly different, although I'm not sure
anyone cares. See #32339. In that PR
https://github.com/python/cpython/pull/4904, Guido said to not make this
change. See also the python-dev discussion at
https://mail.pytho
Eric V. Smith added the comment:
Unfortunately, I don't see how we can do this without breaking code that
assumes the default log format doesn't have the timestamp in it.
In particular, I'm thinking of external log file parsers.
--
nosy: +eric.smi
Eric V. Smith added the comment:
New changeset 24d74bd8377d38528566437e70fcd72229695ac7 by Eric V. Smith (Chris
Cogdon) in branch '3.7':
bpo-33961: Adjusted dataclasses docs to correct exceptions raised. (GH-7917)
https://github.com/python/cpyt
Eric V. Smith added the comment:
I do not believe this is a problem. The marshal documentation includes this:
Warning The marshal module is not intended to be secure against erroneous or
maliciously constructed data. Never unmarshal data received from an untrusted
or unauthenticated source
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue34067>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue34091>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue32430>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Eric V. Smith :
--
assignee: -> eric.smith
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue34213>
___
___
Python-bugs-list mai
Eric V. Smith added the comment:
I unassigned myself from this a few months ago. If someone wants to fix it, I'm
not opposed. But the issue is 12 years old and doesn't cause any real problems
as far as I can see, so it's hard to get excited about it. And as we've seen
Change by Eric V. Smith :
--
resolution: -> wont fix
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/
Eric V. Smith added the comment:
Python thinks that `g` inside `f()` is a local variable. See
https://stackoverflow.com/questions/9264763/unboundlocalerror-in-python#9264845
for an explanation.
This is working as intended.
--
nosy: +eric.smith
resolution: -> not a bug
st
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue34311>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
Would my suggestion in #33731 of adding another letter in the format spec for
float and decimal.Decimal solve your problem? I guess if you're using
monetary=True you'd need two additional letters: like 'f' but locale aware, and
like
Eric V. Smith added the comment:
I'm not sure the effort and code is justified for a trivial fix to an error
message. Is this causing some actual problem?
--
nosy: +eric.smith
type: -> behavior
___
Python tracker
<https://bugs
Eric V. Smith added the comment:
Actually, this one is probably easier to fix. In my opinion, #34127 is more
important to fix, since it's seen much more often than the message about
abstract base classes.
I wouldn't necessarily object to fixing this one, I just personally think
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue34363>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Eric V. Smith :
--
assignee: -> eric.smith
components: +Library (Lib) -Interpreter Core
versions: +Python 3.8
___
Python tracker
<https://bugs.python.org/issu
Eric V. Smith added the comment:
Oops, didn't see that you commented on this, Ivan.
I'll do some analysis tomorrow.
--
___
Python tracker
<https://bugs.python.o
Eric V. Smith added the comment:
I think this is a duplicate, but I can't find the exact issue. I don't think
it's exactly the same as #29051.
--
assignee: -> eric.smith
components: +Interpreter Core
nosy: +eric.smith
stage: -> needs patch
type: -> behavi
Eric V. Smith added the comment:
Thanks for the pointer, Ivan.
I haven't really thought it through yet, but this fixes the problem at hand:
diff --git a/dataclasses.py b/dataclasses.py
index ba34f6b..54916ee 100644
--- a/dataclasses.py
+++ b/dataclasses.py
@@ -1019,7 +1019,7 @
Eric V. Smith added the comment:
Maybe do both, then. Also, it's probably better for performance reasons (I
know: premature optimization and all that ...):
@@ -1018,8 +1018,10 @@ def _asdict_inner(obj, dict_factory):
value = _asdict_inner(getattr(obj, f.name), dict_fa
Change by Eric V. Smith :
--
keywords: +patch
pull_requests: +8212
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34363>
___
___
Py
Eric V. Smith added the comment:
Hmm, for some reason I'm not getting mail from this issue, so I made my PR
before I saw the comments since my last comment.
Raymond has resisted adding a base class to namedtuple. I believe the preferred
way to identify a namedtuple is to look for a _f
Eric V. Smith added the comment:
For the record, I don't disagree with namedtuples not having a base class.
Maybe it's best to let copy.deepcopy() deal with namedtuples, instead of trying
to detect them here. So just special case exact tuples and lists, and pass
everythi
Eric V. Smith added the comment:
New changeset 4d12e4dc28b7c782c368bae2e8fd3815167ed37d by Eric V. Smith (Vadim
Pushtaev) in branch 'master':
bpo-34213: Allow dataclasses to work with a field named 'object'. (GH-8452)
https://github.com/p
Eric V. Smith added the comment:
I think this is just normal behavior with classes. But since you haven't shown
any code, I can't tell exactly what you're doing and what you're expecting.
When providing bug reports, you need to provide:
- Exactly what code you're
Eric V. Smith added the comment:
I assume this is the behavior you're seeing:
>>> @dataclass
... class C:
... i: int = 0
...
>>> c = C(10)
>>> c
C(i=10)
>>> del c.i
>>> c
C(i=0)
>>> del c.i
Traceback (most recent call last):
Fi
Eric V. Smith added the comment:
There are too many types of compression for this to be built-in to json.
There's zlib, gzip, bzip, zip, and no doubt dozens of others. How would we
chose one, or several? Which to leave out? How to pass in the many parameters
to all of these compre
Eric V. Smith added the comment:
If you really want to see this added to Python, then I suggest you put together
a proposal on what the API would be, what options you would or wouldn't
support, and post that on python-ideas. But I'll warn you that your chances of
success are
Eric V. Smith added the comment:
Could you show some example dataclass instances? Also, show the output you get
with asdict(), and show what output you'd like to get instead.
I'm not sure I understand it correctly from the description you've given.
Thanks!
--
no
Change by Eric V. Smith :
--
assignee: -> eric.smith
___
Python tracker
<https://bugs.python.org/issue34409>
___
___
Python-bugs-list mailing list
Unsubscrib
Eric V. Smith added the comment:
See https://docs.python.org/3/tutorial/modules.html#the-module-search-path
Calling this a "hack", and "crazy", is not the way to get volunteers to help
you with your issue. Please show a little more tolerance, please.
Eric V. Smith added the comment:
I agree this is the desired behavior, and not a bug.
Because you are not specifying a __format__ in your class, object.__format__ is
being called. By design, it does not understand any formatting specifiers,
instead reserving them for your class to implement
Eric V. Smith added the comment:
New changeset 93b5655c040a33f9ba4cdbd303afc8398c8413c7 by Eric V. Smith (Andrés
Delfino) in branch 'master':
bpo-34432: doc Mention complex and decimal.Decimal on str.format not about
locales (GH-8808)
https://github.com/python/cpyt
Eric V. Smith added the comment:
New changeset fbd0a14cc941e340df0979d94ac55191dd31ad00 by Eric V. Smith (Miss
Islington (bot)) in branch '3.6':
bpo-34432: doc Mention complex and decimal.Decimal on str.format not about
locales (GH-8808) (GH-8810)
https://github.com/python/cpyt
Eric V. Smith added the comment:
New changeset 0fd6f832a9c30404bf595a4af36e171d11fab024 by Eric V. Smith (Miss
Islington (bot)) in branch '3.7':
bpo-34432: doc Mention complex and decimal.Decimal on str.format note about
locales (GH-8808) (GH-8809)
https://github.com/python/cpyt
Eric V. Smith added the comment:
Thanks, Andrés!
--
assignee: docs@python -> eric.smith
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python
Eric V. Smith added the comment:
I'm not asking to be difficult, I'm asking because a full specification would
be required in order to implement this.
For example, you're excluding the "compresslevel" parameter, so presumably
you'd want the default of 9, which
Eric V. Smith added the comment:
About translating ":s" to "":
> The library seems
willing to do this for the empty format string, but not when the client
code specifically asks for a string
You're not asking for a string when you specify ":s". You
Eric V. Smith added the comment:
Forgot to add: I haven't looked at the docs yet, but I agree they should be
clear on this issue.
The docs should say: for types that implement the documented mini-language, "s"
is the same as "". It's just that not all typ
Eric V. Smith added the comment:
I believe you're seeing this:
https://docs.python.org/3/reference/executionmodel.html#naming-and-binding
See the paragraph that starts with "Class definition blocks and arguments to
exec() and eval() are special in the context of name resolution
Eric V. Smith added the comment:
Can you create a pull request? It's easier to review that way.
--
___
Python tracker
<https://bugs.python.org/is
Eric V. Smith added the comment:
test message, please ignore
--
___
Python tracker
<https://bugs.python.org/issue33569>
___
___
Python-bugs-list mailin
Eric V. Smith added the comment:
I'll close this. I'm still reviewing the docs on it, and I might open a
documentation issue once I understand it better.
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
Eric V. Smith added the comment:
Can you be more specific?
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue34524>
___
___
Python-bug
Eric V. Smith added the comment:
What's the difference between "namespace packages and implicit non-namespace
packages"? I think those are the same thing, aren't they?
--
nosy: +barry, brett.cannon, eric.smith
___
Py
Eric V. Smith added the comment:
I don't think you have to worry about %T being used by other formatting
functions. If (heaven forbid) dates were ever supported by
PyUnicode_FromFormat(), there would have to be a way to switch from "normal"
argument processing to ar
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue34605>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
I'm not sure this is an improvement. While it's true that 'complex' is a class,
it's described here as a function. Same as 'int'. The fact that it's a function
or class isn't so important here.
I suspect it will
Eric V. Smith added the comment:
Ah, you're correct. I just looked for the word "class" inside the "int" text,
and it doesn't appear there: I thought it was deliberately left out. But it
does show up in the sub-section header (before "int" itself).
Change by Eric V. Smith :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8
___
Python tracker
<https://bugs.python.or
Change by Eric V. Smith :
--
pull_requests: +8598
___
Python tracker
<https://bugs.python.org/issue34363>
___
___
Python-bugs-list mailing list
Unsubscribe:
1901 - 2000 of 2699 matches
Mail list logo