Eric V. Smith <e...@trueblade.com> added the comment:
New changeset 98d50cb8f57eb227c373cb94b8680b12ec8aade5 by Eric V. Smith in
branch 'master':
bpo-32216: Add documentation for dataclasses (GH-6886)
https://github.com/python/cpython/commit/98d50cb8f57eb227c373cb94b8680b12ec
Eric V. Smith <e...@trueblade.com> added the comment:
I'd forgotten about this issue and created #33493. I'll close it. Copied here
is my comment from that issue:
I've had several requests for keyword-only arguments. This is a placeholder to
remind me to work on it. I have not decided i
Change by Eric V. Smith <e...@trueblade.com>:
--
keywords: +patch
pull_requests: +6567
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
Eric V. Smith <e...@trueblade.com> added the comment:
I've added some initial documentation. Most of it is text from the PEP, cleaned
up and sphinx-ized. It no doubt needs a lot of work, but I think it's good
enough to close this issue and remove the release blocker. C
Eric V. Smith <e...@trueblade.com> 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-
Eric V. Smith <e...@trueblade.com> added the comment:
The behavior used to be that we'd raise an error if you tried to overwrite a
dunder method. Then we decided that the existence of a dunder method meant you
didn't want it overwritten, so now we don't need to explicitly set a flag to
Change by Eric V. Smith <e...@trueblade.com>:
--
keywords: +patch
pull_requests: +6574
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
Eric V. Smith <e...@trueblade.com> added the comment:
New changeset 4e81296b1874829912c687eba4d39361ab51e145 by Eric V. Smith in
branch 'master':
bpo-33536: Validate make_dataclass() field names. (GH-6906)
https://github.com/python/cpython/commit/4e81296b1874829912c687eba4d39361ab
Change by Eric V. Smith <e...@trueblade.com>:
--
keywords: +patch
pull_requests: +6532
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
Change by Eric V. Smith <e...@trueblade.com>:
--
priority: release blocker ->
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker <rep...@bugs.python.org>
<https:/
New submission from Eric V. Smith <e...@trueblade.com>:
With the recent (and ongoing) change to string annotations, it's no longer
obvious what the type of a field is (normal, ClassVar, or InitVar).
I propose exposing the heretofore undocumented _field_type to the repr. Instead
of w
Eric V. Smith <e...@trueblade.com> added the comment:
New changeset 01abc6ec3a61769c55ee86834a432fb97801d28f by Eric V. Smith in
branch 'master':
bpo-33517: dataclasses: Add the field type to Field repr (GH-6858)
https://github.com/python/cpython/commit/01abc6ec3a61769c55ee86834a432fb978
Eric V. Smith <e...@trueblade.com> added the comment:
New changeset 9285835a05ad0319acef111340266c0f85ed549c by Eric V. Smith in
branch 'master':
bpo-33534: Remove unneeded test. (GH-6897)
https://github.com/python/cpython/commit/9285835a05ad0319acef111340266c0f85
New submission from Eric V. Smith <e...@trueblade.com>:
I'm going to make this a release blocker, since it's basically a code injection
vector, although I know of no way to exploit it. The fix is easy enough.
--
nosy: +ned.deily
priority: high -> releas
Change by Eric V. Smith <e...@trueblade.com>:
--
priority: release blocker ->
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker <rep...@bugs.python.org>
<https:/
Change by Eric V. Smith <e...@trueblade.com>:
--
assignee: eric.smith
nosy: eric.smith
priority: high
severity: normal
status: open
title: dataclasses.make_dataclass does not validate fields for being valid
identifiers
type: behavior
versions: Python 3.7, Pyth
Change by Eric V. Smith <e...@trueblade.com>:
--
priority: release blocker ->
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker <rep...@bugs.python.org>
<https:/
Eric V. Smith <e...@trueblade.com> added the comment:
Duplicate of #33129.
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> Add kwarg-only option to dataclass
___
Python tracker <rep...@bu
Eric V. Smith <e...@trueblade.com> added the comment:
This seems like a reasonable request.
--
nosy: +eric.smith
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
Change by Eric V. Smith <e...@trueblade.com>:
--
keywords: +patch
pull_requests: +6560
stage: needs patch -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
Eric V. Smith <e...@trueblade.com> 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 -> close
Eric V. Smith <e...@trueblade.com> 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 &l
Eric V. Smith <e...@trueblade.com> added the comment:
Larry points out that one potential use case is a base class that defines some
awesome __init__ that you want to use. Without init=False, there’s no good way
to use it.
--
___
Python t
Eric V. Smith <e...@trueblade.com> added the comment:
The concern is that you've created an awesome base class, and you've written
500 dataclasses that are derived from it, but you want to use the base class's
__init__ for all 500. Do you really want to add a __init__ to each of t
Eric V. Smith <e...@trueblade.com> added the comment:
I think the concern is:
from dataclasses import *
class B:
def __init__(self, a, b, c):
# do something with a, b, c, and maybe use fields(self) to figure out
we have a "i" field
self.i = a + b + c
@data
Eric V. Smith <e...@trueblade.com> added the comment:
New changeset 2a7bacbd913cf2bf568b3c0f85a758946d3cf4e9 by Eric V. Smith in
branch 'master':
bpo-33453: Handle string type annotations in dataclasses. (GH-6768)
https://github.com/python/cpython/
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 the second
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 collection
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.python.org/issue33
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 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.python.
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 coming from the remote
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:
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):
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:
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/issu
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.org/issue33
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/e7adf2ba41832404100313f9ac9d9f7fabedc1fd
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
___
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 improve
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
___
Python
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
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:
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 :
--
title: dataclasses should use NFKD to find duplicate members -> dataclasses
should use NFKC to find duplicate members
___
Python tracker
<https://bugs.python.org/issu
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'])
Traceback (most recent call last):
File "",
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:
>>> F
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
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/issue33
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.
--
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-party
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://bugs.python.
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'
--
___
Python tracker
<ht
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 probably involve a new letter,
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
status: open
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 Windows
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.python.org
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/cpython/commit
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.smith, vinay.sajip
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.
--
___
Pyth
Change by Eric V. Smith :
--
nosy: +eric.smith
versions: +Python 3.8
___
Python tracker
<https://bugs.python.org/issue33961>
___
___
Python-bugs-list mailin
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue33946>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Eric V. Smith :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
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/3d70f7aef614c396f516b5fccedeebe98598714d
Eric V. Smith added the comment:
Thanks, Raymond. I'm working on a patch.
--
versions: +Python 3.8
___
Python tracker
<https://bugs.python.org/issue33
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/cpython/commit
Eric V. Smith <e...@trueblade.com> added the comment:
Your patch would break the usual and useful behavior of x == eval(repr(x))
>>> f = Fraction(1,2)
>>> repr(f)
'Fraction(1, 2)'
>>> eval(repr(f))
Fraction(1, 2)
>>> f == eval(repr(f))
True
Plus, I'm
Eric V. Smith <e...@trueblade.com> added the comment:
I'd bring it up on python-ideas, and point the discussion to this issue. I
think the primary complain will be using non-ASCII characters in a function
that normally doesn't return non-ASCII. But maybe people will be willing to
Change by Eric V. Smith <e...@trueblade.com>:
--
nosy: +eric.smith
versions: +Python 3.8 -Python 3.7
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
Eric V. Smith <e...@trueblade.com> added the comment:
The problem is that type.__format__ doesn't exist, so object.__format__ is
being called, and it throws an error if you provide a format spec. This is done
for future expansion: if we do want to add type.__format__ in the future, we
Eric V. Smith <e...@trueblade.com> added the comment:
Operator precedence cannot change without breaking existing code.
--
nosy: +eric.smith
type: behavior -> enhancement
versions: +Python 3.8 -Python 3.5
___
Python tracker <rep...@bug
Eric V. Smith <e...@trueblade.com> added the comment:
This has to be a 3.8 feature.
It would be best if you could convert this to a github pull request, and use
blurb to generate the news entry. But those aren't strictly necessary, someone
else can do the mechanics of that. I'm willing
Eric V. Smith <e...@trueblade.com> added the comment:
You'll need to use blurb:
https://pypi.org/project/blurb/
https://devguide.python.org/committing/#what-s-new-and-news-entries
Well, technically it's possible to not use blurb and do it manually, but you'll
want
Change by Eric V. Smith <e...@trueblade.com>:
--
keywords: +patch
pull_requests: +4926
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
Change by Eric V. Smith <e...@trueblade.com>:
--
resolution: -> fixed
stage: patch review -> resolved
type: -> behavior
___
Python tracker <rep...@bugs.python.org>
<https://bu
Eric V. Smith <e...@trueblade.com> added the comment:
New changeset 03220fdb26c0b6a50ce5ed1fdfbf232094b66db6 by Eric V. Smith in
branch 'master':
bpo-32427: Expose dataclasses.MISSING object. (#5045)
https://github.com/python/cpython/commit/03220fdb26c0b6a50ce5ed1fdfbf232094
New submission from Eric V. Smith <e...@trueblade.com>:
See https://mail.python.org/pipermail/python-dev/2018-January/151628.html and
prior for the discussion.
Add dataclasses.is_dataclass(obj) that returns True if obj is a dataclass class
or instance, else returns False.
--
as
Change by Eric V. Smith <e...@trueblade.com>:
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker <rep...@bugs.python.org>
<https://bu
Eric V. Smith <e...@trueblade.com> added the comment:
It's described here:
https://docs.python.org/3/reference/datamodel.html#special-lookup
Maybe we should have a glossary entry for "special method lookup", and somehow
link mentions like __dir__ to it?
This is slightly diffe
Change by Eric V. Smith <e...@trueblade.com>:
--
keywords: +patch
pull_requests: +4979
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
Eric V. Smith <e...@trueblade.com> added the comment:
I've updated the PEP, too.
--
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
Eric V. Smith <e...@trueblade.com> added the comment:
New changeset e7ba013d870012157f695ead7e3645c2828a7fc5 by Eric V. Smith in
branch 'master':
bpo-32499: Add dataclasses.is_dataclass(obj), which returns True if obj is a
dataclass or an instance of one. (#5113)
https://github.com/
Change by Eric V. Smith <e...@trueblade.com>:
--
status: open -> closed
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32427>
___
_
Change by Eric V. Smith <e...@trueblade.com>:
--
pull_requests: +4981
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32278>
___
_
Eric V. Smith <e...@trueblade.com> added the comment:
This is a duplicate of #32216, which is no doubt hard to find because the
subject doesn't contain "dataclasses". I've fixed that.
--
resolution: -> duplicate
stage: -> resolved
Change by Eric V. Smith <e...@trueblade.com>:
--
title: Document PEP 557 Data Classes -> Document PEP 557 Data Classes
(dataclasses module)
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
Change by Eric V. Smith <e...@trueblade.com>:
--
keywords: +patch
pull_requests: +4991
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
Eric V. Smith <e...@trueblade.com> added the comment:
New changeset d13889214a4c81b78fa8683d35bdbd17ff22f4fe by Eric V. Smith in
branch 'master':
bpo-32506: Change dataclasses from OrderedDict to plain dict. (gh-5131)
https://github.com/python/cpython/
Change by Eric V. Smith <e...@trueblade.com>:
--
pull_requests: +4992
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32506>
___
_
New submission from Eric V. Smith <e...@trueblade.com>:
Modify dataclasses to make it easier to specify special methods.
For example: currently, if you want to override __repr__, you need to specify
@dataclass(repr=False), and also provide your own __repr__. Also, it's current
an
Eric V. Smith <e...@trueblade.com> added the comment:
I tend to agree with you about pre-scanning the arguments to find options. But
at this point, our options to change the code are limited. The last time I
looked at this (and it's been years), I came to the conclusion that the
argume
Eric V. Smith <e...@trueblade.com> added the comment:
Correct. I'm working on that one now. I'll open it tonight or tomorrow.
--
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
Eric V. Smith <e...@trueblade.com> added the comment:
New changeset ed7d429ebb591f65cef558760fb4ebdc4fc8f8b0 by Eric V. Smith in
branch 'master':
bpo-32278: Allow dataclasses.make_dataclass() to omit type information.
(gh-5115)
https://github.com/python/cpython/
901 - 1000 of 2689 matches
Mail list logo