[issue33517] dataclasses: Add the field type to Field repr

2018-05-15 Thread Eric V. Smith
Change by Eric V. Smith : -- priority: release blocker -> resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python

[issue32216] Document PEP 557 Data Classes (dataclasses module)

2018-05-15 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +6560 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue33453] from __future__ import annotations breaks dataclasses ClassVar and InitVar handling

2018-05-15 Thread Eric V. Smith
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

[issue33453] from __future__ import annotations breaks dataclasses ClassVar and InitVar handling

2018-05-16 Thread Eric V. Smith
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

[issue33534] dataclasses: unneeded test in _is_classvar

2018-05-16 Thread Eric V. Smith
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

[issue32216] Document PEP 557 Data Classes (dataclasses module)

2018-05-16 Thread Eric V. Smith
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

[issue33129] Add kwarg-only option to dataclass

2018-05-16 Thread Eric V. Smith
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'

[issue31597] ipaddress.hosts() doesn't return anything on a /32 "network"

2017-09-26 Thread Eric V. Smith
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

[issue31597] ipaddress.hosts() doesn't return anything on a /32 "network"

2017-09-26 Thread Eric V. Smith
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

[issue31614] can't list groupby generator without breaking the sub groups generators

2017-09-28 Thread Eric V. Smith
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

[issue31644] bug in datetime.datetime.timestamp

2017-09-29 Thread Eric V. Smith
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

[issue31634] Consider installing wheel in ensurepip by default

2017-10-01 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue31634> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue30465] FormattedValue expressions have wrong lineno and col_offset information

2017-10-04 Thread Eric V. Smith
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

[issue31684] Scientific formatting of decimal 0 different from float 0

2017-10-04 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue31684> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31749] Request: Human readable byte amounts in the standard library

2017-10-10 Thread Eric V. Smith
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

[issue31768] argparse drops '|'s when the arguments are too long

2017-10-11 Thread Eric V. Smith
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

[issue31768] argparse drops '|'s when the arguments are too long

2017-10-11 Thread Eric V. Smith
Eric V. Smith added the comment: Good point. -- ___ Python tracker <https://bugs.python.org/issue31768> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31780] Using format spec ',x' displays incorrect error message

2017-10-13 Thread Eric V. Smith
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

[issue31797] Python 3.6.3: JSON loop fails using elif

2017-10-16 Thread Eric V. Smith
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

[issue29696] Use namedtuple in string.Formatter.parse iterator response

2017-10-17 Thread Eric V. Smith
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

[issue31798] `site.abs__file__` fails for modules where `__file__` cannot be modified

2017-10-17 Thread Eric V. Smith
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

[issue31905] IPv4Networkcontains raises exception on None

2017-10-30 Thread Eric V. Smith
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 _

[issue31907] Clarify error message when attempting to call function via str.format()

2017-10-31 Thread Eric V. 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

[issue31907] Clarify error message when attempting to call function via str.format()

2017-11-02 Thread Eric V. Smith
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

[issue31992] Make iteration over dict_items yield namedtuples

2017-11-09 Thread Eric V. Smith
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

[issue32018] inspect.signature does not respect PEP 8

2017-11-13 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue32018> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32022] Python problem - == RESTART: Shell =====

2017-11-14 Thread Eric V. Smith
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

[issue32022] Python problem - == RESTART: Shell =====

2017-11-14 Thread Eric V. Smith
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

[issue1104] msilib.SummaryInfo.GetProperty() truncates the string by one character

2017-11-19 Thread Eric V. Smith
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

[issue32127] tutorial on dictionaries has error in example

2017-11-24 Thread Eric V. Smith
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

[issue32127] tutorial on dictionaries has error in example

2017-11-24 Thread Eric V. Smith
Eric V. Smith added the comment: No problem. Welcome to Python! -- ___ Python tracker <https://bugs.python.org/issue32127> ___ ___ Python-bugs-list mailin

[issue32135] Dict creation with update will result to NoneType

2017-11-25 Thread Eric V. Smith
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

[issue32142] heapq.heappop - documentation misleading or doesn't work

2017-11-26 Thread Eric V. Smith
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

[issue32142] heapq.heappop - documentation misleading or doesn't work

2017-11-26 Thread Eric V. Smith
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:

[issue32168] Mutable instance variables don't get new references with args.

2017-11-29 Thread Eric V. Smith
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

[issue32191] TypeError does not work when function with type hint

2017-12-01 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: fixed -> not a bug ___ Python tracker <https://bugs.python.org/issue32191> ___ ___ Python-bugs-list mailing list Un

[issue32214] Implement PEP 557: Data Classes

2017-12-04 Thread Eric V. Smith
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

[issue32214] Implement PEP 557: Data Classes

2017-12-04 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +4616 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue32214> ___ ___ Py

[issue32214] Implement PEP 557: Data Classes

2017-12-04 Thread Eric V. Smith
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

[issue32214] Implement PEP 557: Data Classes

2017-12-04 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue32216] Document PEP 557 Data Classes

2017-12-04 Thread Eric V. Smith
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

[issue32259] Misleading "not iterable" Error Message when generator return a "simple" type, and a tuple is expected

2017-12-09 Thread Eric V. Smith
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

[issue32278] Allow dataclasses.make_dataclass() to omit type information

2017-12-11 Thread Eric V. Smith
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

[issue32279] Pass keyword arguments from dataclasses.make_dataclass() to @dataclass.

2017-12-11 Thread Eric V. Smith
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

[issue32297] Few misspellings found in Python source code comments.

2017-12-12 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue32297> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32305] Namespace packages have inconsistent __file__ and __spec__.origin

2017-12-13 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue32305> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32303] Namespace packages have inconsistent __loader__ and __spec__.loader

2017-12-13 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue32303> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31554] Warn when __loader__ != __spec__.loader

2017-12-13 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue31554> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32259] Misleading "not iterable" Error Message when generator return a "simple" type, and a tuple is expected

2017-12-17 Thread Eric V. Smith
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

[issue32278] Allow dataclasses.make_dataclass() to omit type information

2017-12-18 Thread Eric V. Smith
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

[issue32376] Unusable syntax error reported when Python keyword in a f-string

2017-12-19 Thread Eric V. Smith
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

[issue29051] Improve error reporting involving f-strings (PEP 498)

2017-12-19 Thread Eric V. Smith
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

[issue32216] Document PEP 557 Data Classes (dataclasses module)

2017-12-21 Thread Eric V. Smith
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

[issue32406] Doc: The new dataclasses module is not documented

2017-12-21 Thread Eric V. Smith
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 _

[issue32427] Rename and expose dataclasses._MISSING

2017-12-26 Thread Eric V. Smith
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

[issue32428] dataclasses: make it an error to have initialized non-fields in a dataclass

2017-12-26 Thread Eric V. Smith
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:

[issue32428] dataclasses: make it an error to have initialized non-fields in a dataclass

2017-12-26 Thread Eric V. Smith
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

[issue32442] Result of pathlib.Path.resolve() with UNC path is not very useful

2017-12-28 Thread Eric V. Smith
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 '

[issue32427] Rename and expose dataclasses._MISSING

2017-12-29 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +4926 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue32427> ___ ___ Py

[issue32427] Rename and expose dataclasses._MISSING

2017-12-29 Thread Eric V. Smith
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

[issue32427] Rename and expose dataclasses._MISSING

2017-12-29 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> fixed stage: patch review -> resolved type: -> behavior ___ Python tracker <https://bugs.python.or

[issue32474] argparse nargs should support string wrapped integers too

2018-01-01 Thread Eric V. Smith
Change by Eric V. Smith : -- versions: -Python 3.8 ___ Python tracker <https://bugs.python.org/issue32474> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32499] Add dataclasses.is_dataclass(obj)

2018-01-05 Thread Eric V. Smith
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

[issue32499] Add dataclasses.is_dataclass(obj)

2018-01-06 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +4979 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue32499> ___ ___ Py

[issue32501] Documentation for dir([object])

2018-01-06 Thread Eric V. Smith
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

[issue32499] Add dataclasses.is_dataclass(obj)

2018-01-06 Thread Eric V. Smith
Eric V. Smith added the comment: I've updated the PEP, too. -- ___ Python tracker <https://bugs.python.org/issue32499> ___ ___ Python-bugs-list mailing list

[issue32499] Add dataclasses.is_dataclass(obj)

2018-01-06 Thread Eric V. Smith
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

[issue32499] Add dataclasses.is_dataclass(obj)

2018-01-06 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue32427] Rename and expose dataclasses._MISSING

2018-01-06 Thread Eric V. Smith
Change by Eric V. Smith : -- status: open -> closed ___ Python tracker <https://bugs.python.org/issue32427> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue32278] Allow dataclasses.make_dataclass() to omit type information

2018-01-06 Thread Eric V. Smith
Change by Eric V. Smith : -- pull_requests: +4981 ___ Python tracker <https://bugs.python.org/issue32278> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32278] Allow dataclasses.make_dataclass() to omit type information

2018-01-06 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue32278] Allow dataclasses.make_dataclass() to omit type information

2018-01-06 Thread Eric V. Smith
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

[issue32279] Pass keyword arguments from dataclasses.make_dataclass() to @dataclass.

2018-01-06 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +4982 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue32279> ___ ___ Py

[issue32279] Pass keyword arguments from dataclasses.make_dataclass() to @dataclass.

2018-01-06 Thread Eric V. Smith
Change by Eric V. Smith : -- pull_requests: +4983 ___ Python tracker <https://bugs.python.org/issue32279> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32279] Pass keyword arguments from dataclasses.make_dataclass() to @dataclass.

2018-01-06 Thread Eric V. Smith
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

[issue32279] Pass keyword arguments from dataclasses.make_dataclass() to @dataclass.

2018-01-06 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior ___ Python tracker <https://bugs.python

[issue32505] dataclasses: make field() with no annotation an error

2018-01-06 Thread Eric V. Smith
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

[issue32506] dataclasses: no need for OrderedDict now that dict guarantees to keep insertion order

2018-01-06 Thread Eric V. Smith
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

[issue32428] dataclasses: make it an error to have initialized non-fields in a dataclass

2018-01-06 Thread Eric V. Smith
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

[issue32505] dataclasses: make field() with no annotation an error

2018-01-06 Thread Eric V. Smith
Change by Eric V. Smith : -- versions: +Python 3.7 ___ Python tracker <https://bugs.python.org/issue32505> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32428] dataclasses: make it an error to have initialized non-fields in a dataclass

2018-01-06 Thread Eric V. Smith
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

[issue32506] dataclasses: no need for OrderedDict now that dict guarantees to keep insertion order

2018-01-07 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +4991 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue32506> ___ ___ Py

[issue32506] dataclasses: no need for OrderedDict now that dict guarantees to keep insertion order

2018-01-07 Thread Eric V. Smith
Change by Eric V. Smith : -- pull_requests: +4992 ___ Python tracker <https://bugs.python.org/issue32506> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32513] dataclasses: make it easier to use user-supplied special methods

2018-01-07 Thread Eric V. Smith
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=

[issue32506] dataclasses: no need for OrderedDict now that dict guarantees to keep insertion order

2018-01-07 Thread Eric V. Smith
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

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2018-01-09 Thread Eric V. Smith
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

[issue33493] dataclasses: allow keyword-only arguments

2018-05-16 Thread Eric V. Smith
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

[issue32216] Document PEP 557 Data Classes (dataclasses module)

2018-05-16 Thread Eric V. Smith
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

[issue33534] dataclasses: unneeded test in _is_classvar

2018-05-16 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +6567 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33534> ___ ___ Py

[issue33534] dataclasses: unneeded test in _is_classvar

2018-05-16 Thread Eric V. Smith
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

[issue33534] dataclasses: unneeded test in _is_classvar

2018-05-16 Thread Eric V. Smith
Change by Eric V. Smith : -- priority: release blocker -> resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python

[issue33536] dataclasses.make_dataclass does not validate fields for being valid identifiers

2018-05-16 Thread Eric V. Smith
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

[issue33536] dataclasses.make_dataclass does not validate fields for being valid identifiers

2018-05-16 Thread Eric V. Smith
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

[issue33536] dataclasses.make_dataclass does not validate fields for being valid identifiers

2018-05-16 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +6574 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33536> ___ ___ Py

[issue33536] dataclasses.make_dataclass does not validate fields for being valid identifiers

2018-05-16 Thread Eric V. Smith
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

[issue33539] Remove `init` flag from @dataclass?

2018-05-16 Thread Eric V. Smith
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

[issue33536] dataclasses.make_dataclass does not validate fields for being valid identifiers

2018-05-16 Thread Eric V. Smith
Change by Eric V. Smith : -- priority: release blocker -> resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python

[issue33539] Remove `init` flag from @dataclass?

2018-05-16 Thread Eric V. Smith
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

[issue33539] Remove `init` flag from @dataclass?

2018-05-16 Thread Eric V. Smith
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

[issue33539] Remove `init` flag from @dataclass?

2018-05-16 Thread Eric V. Smith
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?

<    14   15   16   17   18   19   20   21   22   23   >