Change by Eric V. Smith :
--
priority: release blocker ->
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python
Change by Eric V. Smith :
--
keywords: +patch
pull_requests: +6560
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
Eric V. Smith 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/commit/2a7bacbd913cf2bf568b3c0f85a758
Change by Eric V. Smith :
--
priority: release blocker ->
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8
___
Python tracker
<https://bugs.python
New submission from Eric V. Smith :
There's an unnecessary test for "if typing" in _is_classvar. I added this
function yesterday, and due to some refactoring it picked up some superfluous
text. I'm going to remove it.
--
assignee: eric.smith
components: Library (L
Eric V. Smith 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/98d50cb8f57eb227c373cb94b8680b
Eric V. Smith 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 if it'
Eric V. Smith added the comment:
Yes, due to backward compatibility constraints, the behavior is immutable.
You might be able to argue for another method, say all_hosts(), or something.
Or maybe even a optional parameter to hosts() that defaults to the existing
behavior, but if provided, lets
Eric V. Smith added the comment:
You lost me at "some Windows mentality". I come from a networking background.
Sorry, I don't care enough about this issue to pursue it.
--
___
Python tracker
<https://bugs.pyt
Eric V. Smith added the comment:
Loïc Le Loarer: Note that your use case isn't possible, anyway. There's no way
to know the number of groups until the input is exhausted, at which point
you've already iterated through all of the data.
--
no
Eric V. Smith added the comment:
This is a daylight savings time folding problem. Without a timezone, those are
in fact the same point in time, at least in my timezone (US Eastern).
If you specify a timezone, you'll see the difference:
datetime.datetime(2014,3,9,2,tzinfo=datetime.tim
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue31634>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
I think it's fixed. Closing.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.pyth
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue31684>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
A library implementing this should definitely go on PyPI first to shake out
design issues. Then we'd need a PEP.
As someone who has a simplistic version of this code around, and who's done a
bit of string formatting, I can assure you that there ar
Eric V. Smith added the comment:
Removing versions 3.4 and 3.8.
Attaching a reproducing script. Run it with a parameter of the number of
arguments to add. The behavior changes between 7 and 8, although I'm not sure
either is wrong, just different. This is from Windows:
% python3 31768
Eric V. Smith added the comment:
Good point.
--
___
Python tracker
<https://bugs.python.org/issue31768>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
I agree there's no need for tests, since we usually don't guarantee such
messages going forward. Also, I think skipping the news blurb is reasonable for
this change.
--
___
Python tracker
<https://bu
Eric V. Smith added the comment:
Hi, Francesco.
This isn't the appropriate place to ask for help with your script.
I suggest trying the python-list mailing list.
--
nosy: +eric.smith
resolution: -> not a bug
stage: -> resolved
status: ope
Eric V. Smith added the comment:
It does seem like overkill for something that's rarely used. I'm -0 on the
structseq version.
--
___
Python tracker
<https://bugs.python.o
Eric V. Smith added the comment:
I don't have clr installed in order to test this. It would be good if you could
produce it without us having to install additional software.
Could you please copy the entire stack traceback you get when this error occurs?
Does this error happen on 3.6
Eric V. Smith added the comment:
I agree with David. And since the PR says "not other", then it makes even less
sense, since it's checking for any False-y object.
I recommend closing this as "not a bug".
--
nosy: +eric.smith
_
Eric V. Smith added the comment:
How would you distinguish this from the case where an actually missing
attribute was given?
>>> "{0.ctimex}".format(d)
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'datetime.datetime' objec
Eric V. Smith added the comment:
Guido's suggestion in
https://mail.python.org/pipermail/python-dev/2017-October/150055.html is to not
change anything.
Assuming we do that, it's still an open issue as to if/how we should document
and test the current behavior. I'd be su
Eric V. Smith added the comment:
I cannot imagine this ever happening, for performance reasons.
You should write your own wrapper around items, if you want this behavior.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue31
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue32018>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
Can you reproduce this with a much smaller example?
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue32
Eric V. Smith added the comment:
That's too much code for me to run without analyzing it first. If I have time,
I'll look at it.
--
___
Python tracker
<https://bugs.python.o
Eric V. Smith added the comment:
Despite the fact that as of now (or 6+ years ago!) the only way to trigger the
malloc() is via VT_LPSTR, I still think the way the free() call is written is
bad. What if another type is added?
If that were fixed, I still think the basic idea of this patch in
Eric V. Smith added the comment:
dict makes no guarantees on ordering, so I think the example is fine. There is
no "correct" ordering.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.o
Eric V. Smith added the comment:
No problem. Welcome to Python!
--
___
Python tracker
<https://bugs.python.org/issue32127>
___
___
Python-bugs-list mailin
Eric V. Smith added the comment:
dict.update() returns None, so this is expected. Maybe you want:
>>> x = {"X":123}
>>> x.update({"abc":123})
>>> x
{'X': 123, 'abc': 123}
>>>
--
nosy: +eri
Eric V. Smith added the comment:
The heap invariant is also required in order to even meet the documented
behavior of returning the smallest item.
>>> import heapq
>>> li = [5, 7, 9, 1, 4, 3]
>>> heapq.heapify(li)
>>> li
[1, 4, 3, 7, 5, 9]
>>> li[2
Eric V. Smith added the comment:
By "sorted" I meant "sorted by the heap functions so as to maintain their
invariants".
I don't have any suggestion for the actual specific language to use.
--
___
Python tracker
<https:
Eric V. Smith added the comment:
This is defined behavior. Try searching for "mutable default parameter". For
example, here's an old post on it:
http://www.effbot.org/zone/default-values.htm
This isn't related to class vs. instance attributes, but rather the default
par
Change by Eric V. Smith :
--
resolution: fixed -> not a bug
___
Python tracker
<https://bugs.python.org/issue32191>
___
___
Python-bugs-list mailing list
Un
New submission from Eric V. Smith :
PR to follow. Development was at https://github.com/ericvsmith/dataclasses
--
assignee: eric.smith
components: Library (Lib)
messages: 307596
nosy: eric.smith, ned.deily
priority: normal
severity: normal
status: open
title: Implement PEP 557: Data
Change by Eric V. Smith :
--
keywords: +patch
pull_requests: +4616
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32214>
___
___
Py
Eric V. Smith added the comment:
New changeset f0db54a0a1823534606ed5ce5a772365ba694c41 by Eric V. Smith in
branch 'master':
bpo-32214: Implement PEP 557: Data Classes (#4704)
https://github.com/python/cpython/commit/f0db54a0a1823534606ed5ce5a7723
Change by Eric V. Smith :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
New submission from Eric V. Smith :
The documentation needs to be added.
--
assignee: docs@python
components: Documentation
messages: 307614
nosy: docs@python, eric.smith
priority: high
severity: normal
status: open
title: Document PEP 557 Data Classes
versions: Python 3.7
Eric V. Smith added the comment:
The error message is correct, but I'm sorry it's confusing.
Here's an equivalent error:
a, b = 3
You'll get the error "TypeError: 'int' object is not iterable". That's because
Python sees 2 items to the left of th
New submission from Eric V. Smith :
Make the typing information optional.
>From Raymond Hettinger:
The make_dataclass() factory function in the dataclasses module currently
requires type declarations. It would be nice if the type declarations were
optional.
With typing (currently wo
New submission from Eric V. Smith :
make_dataclass() should take optional keyword only arguments and pass them to
@dataclass() when it uses it after it creates a new class.
The parameters are:
init=True, repr=True, eq=True, order=False, hash=None, frozen=False
Obviously, these should reflect
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue32297>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue32305>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue32303>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue31554>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
The PR looks okay to me. I'm also not sure it's worth the change, though.
--
___
Python tracker
<https://bugs.python.o
Eric V. Smith added the comment:
I'm going to use "typing.Any" (as a string) if the type information is omitted
in the call to make_dataclass(). That way I don't need to import typing.
--
___
Python tracker
<https://bug
Eric V. Smith added the comment:
Yes, this is a real problem. I think there's already an issue for this, but I
can't find it.
Unfortunately, to fix it requires a bit of refactoring on how line numbers and
errors are tracked. It's on my list of things to do.
--
no
Eric V. Smith added the comment:
The example above (msg289501) has been fixed. I think it was in #30465.
It also fixes some of these other cases, but I haven't reviewed them all.
--
___
Python tracker
<https://bugs.python.org/is
Change by Eric V. Smith :
--
title: Document PEP 557 Data Classes -> Document PEP 557 Data Classes
(dataclasses module)
___
Python tracker
<https://bugs.python.org/issu
Eric V. Smith 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
status: open -> closed
_
New submission from Eric V. Smith :
There are occasions where you want to know the missing value, such as
introspection and in cases like: Field(default=a if a is not None else
_MISSING).
I'll rename _MISSING to MISSING.
--
assignee: eric.smith
components: Library (Lib)
mes
New submission from Eric V. Smith :
For this class:
@dataclass
class C:
x: int = 0
y = 0
Generate a TypeError. 'y' is not a field (as defined by @dataclass). It should
either be a regular field (by giving it a type annotation) or a ClassVar field.
--
assignee:
Eric V. Smith added the comment:
I'm not sure I understand the distinction. You have to look through everything
in `__dict__`, then exclude those things that are any type of field (so, real
fields or pseudo-fields). Those are the things that are in `__annotations__`,
anyway.
The tri
Eric V. Smith added the comment:
I'm not sure how pathlib.Path('Z:\foo') gives an answer with 'foo' in it, since
'\f' is a formfeed. Is this the exact output that you're showing?
Can you try with r'Z:\foo', 'Z:\\foo', or '
Change by Eric V. Smith :
--
keywords: +patch
pull_requests: +4926
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32427>
___
___
Py
Eric V. Smith 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/03220fdb26c0b6a50ce5ed1fdfbf23
Change by Eric V. Smith :
--
resolution: -> fixed
stage: patch review -> resolved
type: -> behavior
___
Python tracker
<https://bugs.python.or
Change by Eric V. Smith :
--
versions: -Python 3.8
___
Python tracker
<https://bugs.python.org/issue32474>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Eric V. Smith :
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.
--
assignee: eric.smith
Change by Eric V. Smith :
--
keywords: +patch
pull_requests: +4979
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32499>
___
___
Py
Eric V. Smith 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 different from
https://do
Eric V. Smith added the comment:
I've updated the PEP, too.
--
___
Python tracker
<https://bugs.python.org/issue32499>
___
___
Python-bugs-list mailing list
Eric V. Smith 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/python/cpyt
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 :
--
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue32427>
___
___
Python-bugs-list mailing list
Unsubscrib
Change by Eric V. Smith :
--
pull_requests: +4981
___
Python tracker
<https://bugs.python.org/issue32278>
___
___
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
Eric V. Smith 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/commit/ed7d429ebb591f65cef558760fb4eb
Change by Eric V. Smith :
--
keywords: +patch
pull_requests: +4982
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32279>
___
___
Py
Change by Eric V. Smith :
--
pull_requests: +4983
___
Python tracker
<https://bugs.python.org/issue32279>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
New changeset d80b443f02e087dd289ffefd04179c675304d76d by Eric V. Smith in
branch 'master':
bpo-32279: Add additional params to make_dataclass(), pass through to
dataclass(). (gh-5117)
https://github.com/python/cpyt
Change by Eric V. Smith :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
type: -> behavior
___
Python tracker
<https://bugs.python
New submission from Eric V. Smith :
This is an attractive nuisance, especially when coming from attrs. Make it an
error, since it's using field() with no annotation:
@dataclass
class C:
x = field()
--
assignee: eric.smith
messages: 309586
nosy: eric.smith, gvanrossum, levki
New submission from Eric V. Smith :
There are several places where OrderedDict escapes from dataclasses. Switching
to dict means we don't have to use OrderedDict forever.
For the 3.6 backport, I'm also going to use dict. I saw an analysis (from
Raymond, maybe?) that says there
Eric V. Smith added the comment:
I'm closing this, and will open another issue to raise an error for:
@dataclass
class C:
x = field()
--
resolution: -> wont fix
stage: -> resolved
status: open -> closed
___
Python t
Change by Eric V. Smith :
--
versions: +Python 3.7
___
Python tracker
<https://bugs.python.org/issue32505>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
Correct. I'm working on that one now. I'll open it tonight or tomorrow.
--
___
Python tracker
<https://bugs.python.o
Change by Eric V. Smith :
--
keywords: +patch
pull_requests: +4991
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32506>
___
___
Py
Change by Eric V. Smith :
--
pull_requests: +4992
___
Python tracker
<https://bugs.python.org/issue32506>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Eric V. Smith :
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 error to not specify repr=
Eric V. Smith 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/commit/d13889214a4c81b78fa8683d35bdbd
Eric V. Smith 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
argument pre-scannin
Eric V. Smith added the comment:
Duplicate of #33129.
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> Add kwarg-only option to dataclass
___
Python tracker
<https://bugs.python
Eric V. Smith 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. Changes to the
documentation c
Change by Eric V. Smith :
--
keywords: +patch
pull_requests: +6567
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue33534>
___
___
Py
Eric V. Smith 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/9285835a05ad0319acef111340266c
Change by Eric V. Smith :
--
priority: release blocker ->
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python
Change by Eric V. Smith :
--
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, Python 3.8
New submission from Eric V. Smith :
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 -> re
Change by Eric V. Smith :
--
keywords: +patch
pull_requests: +6574
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue33536>
___
___
Py
Eric V. Smith 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/4e81296b1874829912c687eba4d393
Eric V. Smith 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
Fal
Change by Eric V. Smith :
--
priority: release blocker ->
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python
Eric V. Smith 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 tracker
<ht
Eric V. Smith 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
@dataclass(init=False)
class
Eric V. Smith 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 the 500
classes?
1801 - 1900 of 2699 matches
Mail list logo