[issue32960] dataclasses: disallow inheritance between frozen and non-frozen classes

2018-03-18 Thread Eric V. Smith
Eric V. Smith added the comment: Resolved by issue 32953. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior ___ Python tracker <https://bugs.python

[issue33100] dataclasses and __slots__ - non-default argument (member_descriptor)

2018-03-19 Thread Eric V. Smith
Eric V. Smith added the comment: This is the same reason that this fails: class Base: __slots__ = ('x',) x = 3 with: ValueError: 'x' in __slots__ conflicts with class variable In the dataclasses case, the error needs to be improved, and moved to when the base cl

[issue33100] dataclasses and __slots__ - non-default argument (member_descriptor)

2018-03-19 Thread Eric V. Smith
Eric V. Smith added the comment: My point is that the problem is that after: @dataclass class Base: __slots__ = ('x',) x: Any Base.x has a value (it's the member_descriptor for x). That's what's causing the problem that when adding a field to the derive

[issue33102] get the nth folder of a given path

2018-03-19 Thread Eric V. Smith
Eric V. Smith added the comment: Path.parents will do what you want. I don't have a Windows box handy, but this is on MacOS: >>> from pathlib import Path >>> p = >>> Path("/Users/User/AppData/Local/Programs/Python/Python36/Lib/asyncio/__init__.py"

[issue33100] dataclasses and __slots__ - non-default argument (member_descriptor)

2018-03-19 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks, but I'm already looking at this in the context of a different bug. -- ___ Python tracker <https://bugs.python.org/is

[issue33100] dataclasses and __slots__ - non-default argument (member_descriptor)

2018-03-19 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +5910 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33100> ___ ___ Py

[issue33100] dataclasses and __slots__ - non-default argument (member_descriptor)

2018-03-19 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 7389fd935c95b4b6f094312294e703ee0de18719 by Eric V. Smith in branch 'master': bpo-33100: Dataclasses now handles __slots__ and default values correctly. (GH-6152) https://github.com/python/cpython/commit/7389fd935c95b4b6f094312294e703

[issue1467929] %-formatting and dicts

2018-03-19 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: eric.smith -> ___ Python tracker <https://bugs.python.org/issue1467929> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue33094] dataclasses: ClassVar attributes are not working properly

2018-03-19 Thread Eric V. Smith
Eric V. Smith added the comment: Are there any remaining issues here? If not, I'm going to close this issue. -- status: open -> pending ___ Python tracker <https://bugs.python.org

[issue33100] dataclasses and __slots__ - non-default argument (member_descriptor)

2018-03-19 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 3d41f482594b6aab12a316202b3c06757262109a by Eric V. Smith (Miss Islington (bot)) in branch '3.7': bpo-33100: Dataclasses now handles __slots__ and default values correctly. (GH-6152) (GH-6153) https://github.com/python/cpyt

[issue33100] dataclasses and __slots__ - non-default argument (member_descriptor)

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

[issue33084] Computing median, median_high an median_low in statistics library

2018-03-20 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue33084> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33094] dataclasses: ClassVar attributes are not working properly

2018-03-20 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue33094> ___ ___

[issue32896] Error when subclassing a dataclass with a field that uses a defaultfactory

2018-03-20 Thread Eric V. Smith
Change by Eric V. Smith : -- priority: deferred blocker -> release blocker versions: +Python 3.8 ___ Python tracker <https://bugs.python.org/issue32896> ___ _

[issue32896] Error when subclassing a dataclass with a field that uses a defaultfactory

2018-03-20 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +5925 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue32896> ___ ___ Py

[issue32896] Error when subclassing a dataclass with a field that uses a defaultfactory

2018-03-20 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 8f6eccdc64cab735c47620fea948e64b19f83684 by Eric V. Smith in branch 'master': bpo-32896: Fix error when subclassing a dataclass with a field that uses a default_factory (GH-6170) https://github.com/python/cpyt

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

2018-03-21 Thread Eric V. Smith
Change by Eric V. Smith : -- dependencies: -Dict order is now guaranteed, so add tests and doc for it resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue32896] Error when subclassing a dataclass with a field that uses a defaultfactory

2018-03-21 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 22136c94b6e43c8c584a54f3a513b83b753b96ee by Eric V. Smith (Miss Islington (bot)) in branch '3.7': bpo-32896: Fix error when subclassing a dataclass with a field that uses a default_factory (GH-6170) (GH-6171) https://github.com/pyth

[issue32896] Error when subclassing a dataclass with a field that uses a defaultfactory

2018-03-21 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks again for the bug report. This ended up being a simple fix, but an important one. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bug

[issue33102] get the nth folder of a given path

2018-03-21 Thread Eric V. Smith
Eric V. Smith added the comment: Yes, it's cross platform. For a plain string version, you can use a utility function: >>> for i in range(n+1): ... path = os.path.dirname(path) ... I'm not sure it's worth adding this to os.path. -- __

[issue33116] Field is not exposed in dataclasses.__all__

2018-03-21 Thread Eric V. Smith
New submission from Eric V. Smith : 'Field' needs to be added to __all__. -- assignee: eric.smith messages: 314222 nosy: eric.smith priority: normal severity: normal status: open title: Field is not exposed in dataclasses.__all__ type: behavior versions: Python 3.7,

[issue33116] Field is not exposed in dataclasses.__all__

2018-03-21 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +5930 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33116> ___ ___ Py

[issue33116] Field is not exposed in dataclasses.__all__

2018-03-21 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 4ddc99d15963b0374f9dbfd57f14e6194ad65669 by Eric V. Smith (Miss Islington (bot)) in branch '3.7': bpo-33116: Add 'Field' to dataclasses.__all__. (GH-6182) (GH-6183) https://github.com/python/cpython/commit/4ddc99d15963b0374f9d

[issue33116] Field is not exposed in dataclasses.__all__

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

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

2018-03-21 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not sure this is worth preventing. I can certainly make it an error, but since dataclasses ignores anything without a type annotation, I don't think it's a big deal. Basically I'd have to look through all class attributes that are of t

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

2018-03-21 Thread Eric V. Smith
Eric V. Smith added the comment: But surely when you instantiate this: c = C(1) you'll notice that's an error? -- ___ Python tracker <https://bugs.python.o

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

2018-03-22 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for the offer. I've already got the code written, I just need to write some tests. I'll get it done real soon now. -- components: +Library (Lib) versions: +Python 3.8 ___ Python track

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

2018-03-22 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +5939 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue32505> ___ ___ Py

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

2018-03-22 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 56970b8ce9d23269d20a76f13c80e670c856ba7f by Eric V. Smith in branch 'master': bpo-32505: dataclasses: raise TypeError if a member variable is of type Field, but doesn't have a type annotation. (GH-6192) https://github.com/python

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

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

[issue33129] Add kwarg-only option to dataclass

2018-03-23 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> eric.smith ___ Python tracker <https://bugs.python.org/issue33129> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue33129] Add kwarg-only option to dataclass

2018-03-23 Thread Eric V. Smith
Eric V. Smith added the comment: Changing this to 3.8: there's not enough time to add this to 3.7. -- versions: -Python 3.7 ___ Python tracker <https://bugs.python.org/is

[issue33134] dataclasses: use function dispatch instead of multiple tests for adding __hash__

2018-03-24 Thread Eric V. Smith
New submission from Eric V. Smith : There's already a table lookup for what action to take when adding __hash__. Change it to a function dispatch table, instead of using strings and testing them. -- assignee: eric.smith components: Library (Lib) messages: 314385 nosy: eric.

[issue33134] dataclasses: use function dispatch instead of multiple tests for adding __hash__

2018-03-24 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +5963 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33134> ___ ___ Py

[issue33134] dataclasses: use function dispatch instead of multiple tests for adding __hash__

2018-03-24 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 01d618c5606a239b03ad1269541eddb6e724775d by Eric V. Smith in branch 'master': bpo-33134: dataclasses: use function dispatch table for hash, instead of a string lookup which then is tested with if tests. (GH-6222) https://github.

[issue33134] dataclasses: use function dispatch instead of multiple tests for adding __hash__

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

[issue33141] descriptor __set_name__ feature broken for dataclass descriptor fields

2018-03-26 Thread Eric V. Smith
Eric V. Smith added the comment: That's a tough one. Because C.d is not set to a descriptor at type creation time (it's set to a Field object), the __set_name__ behavior is never invoked. It's when the @dataclass decorator is called that C.d is set to D(). https://docs.python.

[issue33141] descriptor __set_name__ feature broken for dataclass descriptor fields

2018-03-26 Thread Eric V. Smith
Eric V. Smith added the comment: I suppose I could, when overwriting the class member, check for inspect.ismethoddescriptor and call __set_name__ myself. -- components: +Library (Lib) versions: +Python 3.8 ___ Python tracker <ht

[issue33141] descriptor __set_name__ feature broken for dataclass descriptor fields

2018-03-26 Thread Eric V. Smith
Eric V. Smith added the comment: Nick Coghlan suggested (on python-dev) to have Field implement __set_name__ and call through to the default value, if it exists. That approach seems to work fine. I'll generate a PR with tests sometime before today'

[issue33141] descriptor __set_name__ feature broken for dataclass descriptor fields

2018-03-26 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +5984 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33141> ___ ___ Py

[issue33141] descriptor __set_name__ feature broken for dataclass descriptor fields

2018-03-26 Thread Eric V. Smith
Eric V. Smith added the comment: I don't expect there to be too much usage of Field objects, so I'm not so worried about it. If you can, try out the code in the PR. Thanks. -- ___ Python tracker <https://bugs.python.o

[issue33141] descriptor __set_name__ feature broken for dataclass descriptor fields

2018-03-26 Thread Eric V. Smith
Eric V. Smith added the comment: Yes, I noticed the same thing. I'll remove the test. -- ___ Python tracker <https://bugs.python.org/issue33141> ___ ___

[issue33141] descriptor __set_name__ feature broken for dataclass descriptor fields

2018-03-26 Thread Eric V. Smith
Eric V. Smith added the comment: I've updated the PR. I left those lines in, and added a different test. After all, it does need to work with real descriptors. -- ___ Python tracker <https://bugs.python.org/is

[issue33141] descriptor __set_name__ feature broken for dataclass descriptor fields

2018-03-26 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset de7a2f04d6b9427d568fcb43b6f512f9b4c4bd84 by Eric V. Smith in branch 'master': bpo-33141: Have dataclasses.Field pass through __set_name__ to any default argument. (GH-6260) https://github.com/python/cpyt

[issue33141] descriptor __set_name__ feature broken for dataclass descriptor fields

2018-03-26 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for the bug report. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue33175] dataclasses should look up __set_name__ on class, not instance

2018-03-29 Thread Eric V. Smith
New submission from Eric V. Smith : Reported by Jelle Zijlstra at https://github.com/python/cpython/pull/6260#pullrequestreview-107905037 -- assignee: eric.smith components: Library (Lib) messages: 314636 nosy: eric.smith priority: normal severity: normal stage: needs patch status

[issue33175] dataclasses should look up __set_name__ on class, not instance

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

[issue33175] dataclasses should look up __set_name__ on class, not instance

2018-03-29 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 521995205a2cb6b504fe0e39af22a81f785350a3 by Eric V. Smith in branch 'master': bpo-33175: dataclasses should look up __set_name__ on class, not instance (GH-6305) https://github.com/python/cpython/commit/521995205a2cb6b504fe0e39af22a8

[issue33175] dataclasses should look up __set_name__ on class, not instance

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

[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-03-30 Thread Eric V. Smith
Eric V. Smith added the comment: You can also cause this same error without dataclasses: from typing import TypeVar, Generic from types import new_class MyTypeVar = TypeVar("MyTypeVar") MyParent = new_class("MyParent", (Generic[MyTypeVar],), {}) c = type(

[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-03-30 Thread Eric V. Smith
Eric V. Smith added the comment: If we're going to call new_class in make_dataclass, then we should change the signature of make_dataclass to have the new_class parameters. -- ___ Python tracker <https://bugs.python.org/is

[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-03-31 Thread Eric V. Smith
Eric V. Smith added the comment: Yeah, no need to change the API. I was over-generalizing. -- ___ Python tracker <https://bugs.python.org/issue33188> ___ ___

[issue33262] Deprecate shlex.split(None) to read from stdin.

2018-04-11 Thread Eric V. Smith
Eric V. Smith added the comment: I agree that it should be deprecated. That's crazy behavior. I'd also recommend that shlex.shlex with instream=None be deprecated, but maybe that's too radical. It seems way too easy to accidentally pass in None. -- no

[issue33265] contextlib.ExitStack abuses __self__

2018-04-11 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +ncoghlan ___ Python tracker <https://bugs.python.org/issue33265> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33268] iteration over attrs in metaclass' __new__ affects class' __name__

2018-04-12 Thread Eric V. Smith
Eric V. Smith added the comment: In the loop, you're reassigning the value of name, then using it in the super call. If you change the name of the loop variable, your code works. -- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -&g

[issue33266] 2to3 doesn't parse all valid string literals

2018-04-12 Thread Eric V. Smith
Eric V. Smith added the comment: Is 2to3 supposed to be able to parse non-python2 files? I don't recall. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/is

[issue33272] Which are reasonable reason for recursion limit in function _vformat of class Formatter lib string?

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

[issue33340] Inaccurate docs on `import` behaviour

2018-04-23 Thread Eric V. Smith
Eric V. Smith added the comment: "built-in modules" has the specific meaning of modules that are compiled in to the python executable. It doesn't mean modules in the standard library. See https://docs.python.org/3.6/library/sys.html#sys.builtin_module_names Python 3.6.4 (defau

[issue33340] Inaccurate docs on `import` behaviour

2018-04-23 Thread Eric V. Smith
Eric V. Smith added the comment: If you have a suggested improvement, please create a pull request. Thanks! -- ___ Python tracker <https://bugs.python.org/issue33

[issue33211] lineno and col_offset are wrong on function definitions with decorators

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

[issue33390] matmul @ operator precedence

2018-04-29 Thread Eric V. Smith
Eric V. Smith 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 <https://bugs.python.org/issu

[issue33402] Change the fractions.Fraction class to convert to a unicode fraction string

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

[issue33402] Change the fractions.Fraction class to convert to a unicode fraction string

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

[issue33408] AF_UNIX is now supported in Windows

2018-05-02 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith versions: +Python 3.8 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue33408> ___ ___ Python-bugs-list m

[issue33410] Using type in a format with padding causes TypeError

2018-05-02 Thread Eric V. Smith
Eric V. Smith 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 don't have to w

[issue33419] Add functools.partialclass

2018-05-03 Thread Eric V. Smith
Eric V. Smith 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 to do it if

[issue33419] Add functools.partialclass

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

[issue33422] Fix and update string/byte literals in help()

2018-05-04 Thread Eric V. Smith
Eric V. Smith added the comment: It's not clear to me what you're typing to get the output in the first message. Can you clarify? Is this at the interactive prompt? -- ___ Python tracker <https://bugs.python.o

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

2018-05-09 Thread Eric V. Smith
Eric V. Smith added the comment: This is a known issue, but it wasn't being tracked here. So, thanks for opening the issue. https://github.com/ericvsmith/dataclasses/issues/92#issuecomment-382473127 Not to put Łukasz on the spot (he's sitting behind me even as we speak), but I

[issue33452] add user notification that parent init will not be called in dataclass init method

2018-05-09 Thread Eric V. Smith
Eric V. Smith added the comment: I'm okay with the concept, but I don't know how to implement it. You need to not only know if a class has a __init__, but also if it's expected to be called. For example, these don't normally get called, but if you inherit from them (and e

[issue33452] add user notification that parent init will not be called in dataclass init method

2018-05-09 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> eric.smith ___ Python tracker <https://bugs.python.org/issue33452> ___ ___ Python-bugs-list mailing list Unsubscrib

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

2018-05-10 Thread Eric V. Smith
Eric V. Smith added the comment: See also [2]_ for a brief discussion of forward references, which makes get_type_hints() undesirable in this case. > This is why attrs went with the fast way which covers most (but not all) > bases in this case. If the annotation is a string, just check

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

2018-05-10 Thread Eric V. Smith
Eric V. Smith added the comment: I see that https://github.com/python/typing/issues/508 is also referenced in https://github.com/python-attrs/attrs/issues/361, where it contributed to attrs using string inspection. -- ___ Python tracker <ht

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

2018-05-11 Thread Eric V. Smith
Eric V. Smith added the comment: The more I think about this, the more I think Łukasz is correct that just checking for strings starting with "ClassVar", "typing.ClassVar", or "t.ClassVar" is the correct thing to do. This is the change he made in https://gith

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

2018-05-11 Thread Eric V. Smith
Eric V. Smith added the comment: We can't break the API at this point in the release cycle. But I am open to what string prefixes we should allow. -- ___ Python tracker <https://bugs.python.org/is

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

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

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

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

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

2018-05-11 Thread Eric V. Smith
Eric V. Smith added the comment: At this stage in the release cycle, if you really feel strongly about this, you should take it up with Guido directly. -- assignee: -> eric.smith ___ Python tracker <https://bugs.python.org/issu

[issue33471] string format with 'n' failling with french locales

2018-05-12 Thread Eric V. Smith
Eric V. Smith added the comment: After locale.setlocale(locale.LC_ALL, ''), what does local.localeconv() return? -- nosy: +eric.smith ___ Python tracker <https://bugs.python.o

[issue33474] Support immutability per-field in dataclasses

2018-05-13 Thread Eric V. Smith
Eric V. Smith added the comment: Can you explain your use case for this? Also, how do you envision this working with the existing frozen, hashing, and equality behavior? There are a lot of interactions there, and we'd want to do something that makes sense holistically, and isn't

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

2018-05-13 Thread Eric V. Smith
Eric V. Smith added the comment: There have been comments on the PR, but I'd like to focus the higher level issue back here. Specifically, see my comment https://github.com/python/cpython/pull/6768#discussion_r187813919 To summarize: I still think string inspections are the best we c

[issue33493] dataclasses: allow keyword-only arguments

2018-05-14 Thread Eric V. Smith
New submission from Eric V. Smith : 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's a good idea or not. I propose adding a keyword_only argument to field(), defaulting to False. I'm thinking that

[issue33495] dataclasses: repr of Field objects should use repr of each member

2018-05-14 Thread Eric V. Smith
New submission from Eric V. Smith : This is especially true for the "type" member, since it might be a string that looks like a type name (depending on how #33453 is resolved). But repr should be used for all Field members. -- assignee: eric.smith components: Library (Lib

[issue33494] random.choices ought to check that cumulative weights are in ascending order

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

[issue33494] random.choices ought to check that cumulative weights are in ascending order

2018-05-14 Thread Eric V. Smith
Change by Eric V. Smith : -- pull_requests: -6483 ___ Python tracker <https://bugs.python.org/issue33494> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33494] random.choices ought to check that cumulative weights are in ascending order

2018-05-14 Thread Eric V. Smith
Change by Eric V. Smith : -- pull_requests: -6490 ___ Python tracker <https://bugs.python.org/issue33494> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33494] random.choices ought to check that cumulative weights are in ascending order

2018-05-14 Thread Eric V. Smith
Change by Eric V. Smith : -- pull_requests: +6492 ___ Python tracker <https://bugs.python.org/issue33494> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33495] dataclasses: repr of Field objects should use repr of each member

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

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

2018-05-14 Thread Eric V. Smith
Eric V. Smith added the comment: Followup from our meeting at the sprints: we're going to go with inspecting the type annotation string and use heuristics to determine if the type is a ClassVar or InitVar. I'll follow up with more specifics on the approach. This will obviously ne

[issue33495] dataclasses: repr of Field objects should use repr of each member

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

[issue33502] dataclasses: repr of _DataclassParams objects should use repr of each member

2018-05-14 Thread Eric V. Smith
New submission from Eric V. Smith : This is mostly a debugging aid, but if you need it, it's very handy. -- assignee: eric.smith components: Library (Lib) messages: 316542 nosy: eric.smith, ned.deily priority: release blocker severity: normal status: open title: dataclasses: re

[issue33495] dataclasses: repr of Field objects should use repr of each member

2018-05-14 Thread Eric V. Smith
Change by Eric V. Smith : -- priority: release blocker -> ___ Python tracker <https://bugs.python.org/issue33495> ___ ___ Python-bugs-list mailing list Un

[issue33502] dataclasses: repr of _DataclassParams objects should use repr of each member

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

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

2018-05-14 Thread Eric V. Smith
Eric V. Smith added the comment: Note that the documentation should make the implications of #33453 very clear. In short, if an annotation "looks like" a ClassVar or InitVar, it will be treated as such. This is true even if it's specified as a string, or if it's a

[issue33504] configparser should use dict instead of OrderedDict in 3.7+

2018-05-14 Thread Eric V. Smith
Eric V. Smith added the comment: Like #33463, it will require a deprecation cycle. I'm not sure it's worth the hassle, but I wouldn't oppose it if someone wanted to do the work. 3.8 would be the first version where it could be added. -- nosy: +eric.smith version

[issue33502] dataclasses: repr of _DataclassParams objects should use repr of each member

2018-05-14 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 3059042410dce69806b94be72d5c8055d616f3a3 by Eric V. Smith in branch 'master': bpo-33502: dataclass._Dataclassparams repr: use repr of each member. (GH-6812) https://github.com/python/cpython/commit/3059042410dce69806b94be72d5c80

[issue33502] dataclasses: repr of _DataclassParams objects should use repr of each member

2018-05-14 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

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

2018-05-15 Thread Eric V. Smith
New submission from Eric V. Smith : 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 writing it directly, I&#x

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

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

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

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

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