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

2018-05-16 Thread Eric V. Smith
Eric V. Smith added the comment: Okay. I'm sure Ned is relieved! -- priority: release blocker -> resolution: -> wont fix stage: -> resolved status: open -> closed type: -> behavior ___ Python tracker <https://bug

[issue33574] Conversion of Number to String(str(number))

2018-05-18 Thread Eric V. Smith
Eric V. Smith added the comment: The way to avoid this problem is to not assign to str. You should not shadow python builtins that you want to continue using. -- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed type: compile error

[issue33588] Unicode function arguments aren't preserved

2018-05-20 Thread Eric V. Smith
Eric V. Smith added the comment: I think you're seeing identifier normalization. See this SO question for a description of the issue: https://stackoverflow.com/questions/34097193/identifier-normalization-why-is-the-micro-sign-converted-into-the-greek-letter -- nosy: +eric.

[issue33569] dataclasses InitVar does not maintain any type info

2018-05-22 Thread Eric V. Smith
Eric V. Smith added the comment: This seems like a reasonable request. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue33569> ___ ___ Pytho

[issue33669] str.format should raise exception when placeholder number doesn't match argument number

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

[issue33669] str.format should raise exception when placeholder number doesn't match argument number

2018-05-28 Thread Eric V. Smith
Eric V. Smith added the comment: I still think it's a job for a linter, even if the compiler optimizes away the call to .format(). -- ___ Python tracker <https://bugs.python.org/is

[issue33721] os.path.exists() ought to return False if pathname contains NUL

2018-06-01 Thread Eric V. Smith
Eric V. Smith added the comment: To be clear: os.path.exists('a\x00b') raises ValueError on both Windows and Linux. I think we should just document this behavior and not change it. -- nosy: +eric.smith ___ Python tracker <https://bu

[issue33730] string format 'n' produces numbers with incorrect precision

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

[issue33730] string format 'n' produces numbers with incorrect precision

2018-06-01 Thread Eric V. Smith
Eric V. Smith added the comment: I'm going to close this. If you still think there's an issue, we can re-open it. -- assignee: -> eric.smith components: +Interpreter Core -Extension Modules resolution: -> not a bug stage: -> resolved sta

[issue33731] string formatting that produces floats with preset precision while respecting locale

2018-06-01 Thread Eric V. Smith
Eric V. Smith added the comment: You can always use the locale module, although of course that's not as convenient: >>> locale.format('%.2f', 1.891) '1.89' I'm open to suggests on backward compatible ways to implement this for python 3.8. It would pro

[issue33721] os.path.exists() ought to return False if pathname contains NUL

2018-06-01 Thread Eric V. Smith
Eric V. Smith added the comment: I don't know of any OS that supports NULs in filenames (not that my knowledge is encyclopedic). My reason for suggesting we document it is that os.path.exists() returns False for otherwise invalid filenames, where something like open() raises. On Wi

[issue33754] f-strings should be part of the Grammar

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

[issue33754] f-strings should be part of the Grammar

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

[issue33796] dataclasses.replace broken with class variables

2018-06-07 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> eric.smith nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue33796> ___ ___ Python-bugs-list mai

[issue33796] dataclasses.replace broken with class variables

2018-06-07 Thread Eric V. Smith
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):

[issue33796] dataclasses.replace broken with class variables

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

[issue33796] dataclasses.replace broken if a class has any ClassVars

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

[issue33796] dataclasses.replace broken if a class has any ClassVars

2018-06-07 Thread Eric V. Smith
Eric V. Smith added the comment: Ned: How do you feel about backporting this to 3.7? It's an unfortunate bug, but it's your call for 3.7.0 vs. 3.7.1. -- ___ Python tracker <https://bugs.python.o

[issue33796] dataclasses.replace broken if a class has any ClassVars

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

[issue33796] dataclasses.replace broken if a class has any ClassVars

2018-06-07 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset e7adf2ba41832404100313f9ac9d9f7fabedc1fd by Eric V. Smith in branch 'master': bpo-33796: Ignore ClassVar for dataclasses.replace(). (GH-7488) https://github.com/python/cpython/commit/e7adf2ba41832404100313f9ac9d9f

[issue33796] dataclasses.replace broken if a class has any ClassVars

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

[issue33805] dataclasses: replace() give poor error message if using InitVar

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

[issue33806] Cannot re-open an existing telnet session

2018-06-08 Thread Eric V. Smith
Eric V. Smith added the comment: Which link are you referring to? I don't see any code you've provided where you're reopening a connection. It looks like you're opening a new connection, reading, writing, and nothing else. It also looks like the output you show is co

[issue33806] Cannot re-open an existing telnet session

2018-06-08 Thread Eric V. Smith
Eric V. Smith added the comment: This sounds like an application-level issue, not a telnetlib problem. As far as I can tell, you're opening a new connection, not reusing an existing connection. -- ___ Python tracker <https://bugs.py

[issue33814] exec() maybe has a memory leak

2018-06-09 Thread Eric V. Smith
Eric V. Smith added the comment: It would be helpful if you could show what output you see, and how it differs from what you expect. I think you're just seeing reference cycles or some other delayed garbage collection. If you put in a gc.collect() in your loops to force a colle

[issue33815] List a = []*19 doesn't create a list with index length of 19

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

[issue33815] List a = []*19 doesn't create a list with index length of 19

2018-06-09 Thread Eric V. Smith
Eric V. Smith added the comment: Agreed with Stefan about this not being appropriate for the bug tracker. And I'm saying that I don't agree with you. There's no bug here. -- ___ Python tracker <https://bugs.pyt

[issue33844] Writing capital letters with csvwriter.writerow changes the csv file format

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

[issue33848] Incomplete format string syntax for Exceptions

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

[issue33844] Writing capital letters with csvwriter.writerow changes the csv file format

2018-06-13 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: works for me -> not a bug ___ Python tracker <https://bugs.python.org/issue33844> ___ ___ Python-bugs-list mai

[issue33850] Json.dump() bug when using generator

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

[issue33880] namedtuple should use NFKD to find duplicate members

2018-06-16 Thread Eric V. Smith
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: >>&

[issue33881] dataclasses should use NFKD to find duplicate members

2018-06-16 Thread Eric V. Smith
New submission from Eric V. Smith : See issue 33880 for the same issue with namedtuple. This shows up on dataclasses only through make_dataclass. This is an expected ValueError: >>> make_dataclass('a', ['a', 'b', 'c', 'a']) Trace

[issue33880] namedtuple should use NFKD to find duplicate members

2018-06-16 Thread Eric V. Smith
Eric V. Smith added the comment: See issue 33881 for the corresponding dataclasses issue. -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue33

[issue33880] namedtuple should use NFKD to find duplicate members

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

[issue33881] dataclasses should use NFKC to find duplicate members

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

[issue33894] tempfile.tempdir cannot be unset

2018-06-18 Thread Eric V. Smith
Eric V. Smith added the comment: "If tempdir is unset or None" means "If tempdir has not been assigned to, or if it has been assigned the value None". "Unset" doesn't mean "delete from the module". I agree the documentation wording could be im

[issue33894] tempfile.tempdir cannot be unset

2018-06-18 Thread Eric V. Smith
Eric V. Smith added the comment: I like philiprowlands' version: - If tempdir is unset or None at any call to + If tempdir is None (the default) at any call to Care to produce a PR? -- versions: +Python 2.7, Python 3.6, Python 3.7 ___ P

[issue33894] tempfile.tempdir cannot be unset

2018-06-21 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset b225cb770fb17596298f5a05c41a7c90c470c4f8 by Eric V. Smith (Miss Islington (bot)) in branch '3.6': bpo-33894: Clarified the tempfile.tempdir documentation (GH-7829) (GH-7842) https://github.com/python/cpyt

[issue33944] Deprecate and remove pth files

2018-06-22 Thread Eric V. Smith
Eric V. Smith added the comment: Also +1. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue33944> ___ ___ Python-bugs-list mailin

[issue33944] Deprecate and remove pth files

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

[issue33569] dataclasses InitVar does not maintain any type info

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

[issue33947] Dataclasses can raise RecursionError in __repr__

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

[issue33946] os.symlink on Windows should use the new non-admin flag

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

[issue33805] dataclasses: replace() give poor error message if using InitVar

2018-06-23 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 3d70f7aef614c396f516b5fccedeebe98598714d by Eric V. Smith (Dong-hee Na) in branch 'master': bpo-33805: Improve error message of dataclasses.replace() (GH-7580) https://github.com/python/cpython/commit/3d70f7aef614c396f516b5fccedeeb

[issue33805] dataclasses: replace() give poor error message if using InitVar

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

[issue33947] Dataclasses can raise RecursionError in __repr__

2018-06-23 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks, Raymond. I'm working on a patch. -- versions: +Python 3.8 ___ Python tracker <https://bugs.python.org/is

[issue33961] Inconsistency in exceptions for dataclasses.dataclass documentation

2018-06-25 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith versions: +Python 3.8 ___ Python tracker <https://bugs.python.org/issue33961> ___ ___ Python-bugs-list mailin

[issue34003] csv.DictReader can return basic dict instead of OrderedDict

2018-06-29 Thread Eric V. Smith
Eric V. Smith added the comment: The dict and OrderedDict APIs are slightly different, although I'm not sure anyone cares. See #32339. In that PR https://github.com/python/cpython/pull/4904, Guido said to not make this change. See also the python-dev discussion at https://mail.pytho

[issue34020] Add '%(asctime)s' into default BASIC_FORMAT in logging module

2018-07-02 Thread Eric V. Smith
Eric V. Smith added the comment: Unfortunately, I don't see how we can do this without breaking code that assumes the default log format doesn't have the timestamp in it. In particular, I'm thinking of external log file parsers. -- nosy: +eric.smi

[issue33961] Inconsistency in exceptions for dataclasses.dataclass documentation

2018-07-02 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 24d74bd8377d38528566437e70fcd72229695ac7 by Eric V. Smith (Chris Cogdon) in branch '3.7': bpo-33961: Adjusted dataclasses docs to correct exceptions raised. (GH-7917) https://github.com/python/cpyt

[issue34045] DoS due to null pointer dereference in marshal.dumps()

2018-07-04 Thread Eric V. Smith
Eric V. Smith added the comment: I do not believe this is a problem. The marshal documentation includes this: Warning The marshal module is not intended to be secure against erroneous or maliciously constructed data. Never unmarshal data received from an untrusted or unauthenticated source

[issue34067] Problem with contextlib.nullcontext

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

[issue34091] REPL does not work in msys2, ConEmu terminals on windows

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

[issue32430] Simplify Modules/Setup{,.dist,.local}

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

[issue34213] Frozen dataclass __init__ fails for "object" property"

2018-07-24 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> eric.smith nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue34213> ___ ___ Python-bugs-list mai

[issue1467929] %-formatting and dicts

2018-07-28 Thread Eric V. Smith
Eric V. Smith added the comment: I unassigned myself from this a few months ago. If someone wants to fix it, I'm not opposed. But the issue is 12 years old and doesn't cause any real problems as far as I can see, so it's hard to get excited about it. And as we've seen

[issue1467929] %-formatting and dicts

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

[issue34291] UnboundLocalError raised on call to global

2018-07-31 Thread Eric V. Smith
Eric V. Smith added the comment: Python thinks that `g` inside `f()` is a local variable. See https://stackoverflow.com/questions/9264763/unboundlocalerror-in-python#9264845 for an explanation. This is working as intended. -- nosy: +eric.smith resolution: -> not a bug st

[issue34311] locale.format() and locale.format_string() cast Decimals to float

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

[issue34311] locale.format() and locale.format_string() cast Decimals to float

2018-08-01 Thread Eric V. Smith
Eric V. Smith added the comment: Would my suggestion in #33731 of adding another letter in the format spec for float and decimal.Decimal solve your problem? I guess if you're using monetary=True you'd need two additional letters: like 'f' but locale aware, and like 

[issue34331] Incorrectly pluralized abstract class error message

2018-08-03 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not sure the effort and code is justified for a trivial fix to an error message. Is this causing some actual problem? -- nosy: +eric.smith type: -> behavior ___ Python tracker <https://bugs

[issue34331] Incorrectly pluralized abstract class error message

2018-08-03 Thread Eric V. Smith
Eric V. Smith added the comment: Actually, this one is probably easier to fix. In my opinion, #34127 is more important to fix, since it's seen much more often than the message about abstract base classes. I wouldn't necessarily object to fixing this one, I just personally think

[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple

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

[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple

2018-08-08 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> eric.smith components: +Library (Lib) -Interpreter Core versions: +Python 3.8 ___ Python tracker <https://bugs.python.org/issu

[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple

2018-08-08 Thread Eric V. Smith
Eric V. Smith added the comment: Oops, didn't see that you commented on this, Ivan. I'll do some analysis tomorrow. -- ___ Python tracker <https://bugs.python.o

[issue34364] problem with traceback for syntax error in f-string

2018-08-08 Thread Eric V. Smith
Eric V. Smith added the comment: I think this is a duplicate, but I can't find the exact issue. I don't think it's exactly the same as #29051. -- assignee: -> eric.smith components: +Interpreter Core nosy: +eric.smith stage: -> needs patch type: -> behavi

[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple

2018-08-08 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for the pointer, Ivan. I haven't really thought it through yet, but this fixes the problem at hand: diff --git a/dataclasses.py b/dataclasses.py index ba34f6b..54916ee 100644 --- a/dataclasses.py +++ b/dataclasses.py @@ -1019,7 +1019,7 @

[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple

2018-08-09 Thread Eric V. Smith
Eric V. Smith added the comment: Maybe do both, then. Also, it's probably better for performance reasons (I know: premature optimization and all that ...): @@ -1018,8 +1018,10 @@ def _asdict_inner(obj, dict_factory): value = _asdict_inner(getattr(obj, f.name), dict_fa

[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple

2018-08-10 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +8212 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34363> ___ ___ Py

[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple

2018-08-10 Thread Eric V. Smith
Eric V. Smith added the comment: Hmm, for some reason I'm not getting mail from this issue, so I made my PR before I saw the comments since my last comment. Raymond has resisted adding a base class to namedtuple. I believe the preferred way to identify a namedtuple is to look for a _f

[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple

2018-08-10 Thread Eric V. Smith
Eric V. Smith added the comment: For the record, I don't disagree with namedtuples not having a base class. Maybe it's best to let copy.deepcopy() deal with namedtuples, instead of trying to detect them here. So just special case exact tuples and lists, and pass everythi

[issue34213] Frozen dataclass __init__ fails for "object" property"

2018-08-12 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 4d12e4dc28b7c782c368bae2e8fd3815167ed37d by Eric V. Smith (Vadim Pushtaev) in branch 'master': bpo-34213: Allow dataclasses to work with a field named 'object'. (GH-8452) https://github.com/p

[issue34387] Deletion of attributes in dataclass is buggy!

2018-08-12 Thread Eric V. Smith
Eric V. Smith added the comment: I think this is just normal behavior with classes. But since you haven't shown any code, I can't tell exactly what you're doing and what you're expecting. When providing bug reports, you need to provide: - Exactly what code you're

[issue34387] Deletion of attributes in dataclass is buggy

2018-08-14 Thread Eric V. Smith
Eric V. Smith added the comment: I assume this is the behavior you're seeing: >>> @dataclass ... class C: ... i: int = 0 ... >>> c = C(10) >>> c C(i=10) >>> del c.i >>> c C(i=0) >>> del c.i Traceback (most recent call last): Fi

[issue34393] json.dumps - allow compression

2018-08-14 Thread Eric V. Smith
Eric V. Smith added the comment: There are too many types of compression for this to be built-in to json. There's zlib, gzip, bzip, zip, and no doubt dozens of others. How would we chose one, or several? Which to leave out? How to pass in the many parameters to all of these compre

[issue34393] json.dumps - allow compression

2018-08-14 Thread Eric V. Smith
Eric V. Smith added the comment: If you really want to see this added to Python, then I suggest you put together a proposal on what the API would be, what options you would or wouldn't support, and post that on python-ideas. But I'll warn you that your chances of success are

[issue34409] Add a way to customize iteration over fields in asdict() for the nested dataclasses

2018-08-14 Thread Eric V. Smith
Eric V. Smith added the comment: Could you show some example dataclass instances? Also, show the output you get with asdict(), and show what output you'd like to get instead. I'm not sure I understand it correctly from the description you've given. Thanks! -- no

[issue34409] Add a way to customize iteration over fields in asdict() for the nested dataclasses

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

[issue34414] Absolute imports conflict with local files

2018-08-16 Thread Eric V. Smith
Eric V. Smith added the comment: See https://docs.python.org/3/tutorial/modules.html#the-module-search-path Calling this a "hack", and "crazy", is not the way to get volunteers to help you with your issue. Please show a little more tolerance, please.

[issue34425] :s formatting broken for objects without __format__

2018-08-18 Thread Eric V. Smith
Eric V. Smith added the comment: I agree this is the desired behavior, and not a bug. Because you are not specifying a __format__ in your class, object.__format__ is being called. By design, it does not understand any formatting specifiers, instead reserving them for your class to implement

[issue34432] doc Mention complex and decimal.Decimal on str.format note about locales

2018-08-18 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 93b5655c040a33f9ba4cdbd303afc8398c8413c7 by Eric V. Smith (Andrés Delfino) in branch 'master': bpo-34432: doc Mention complex and decimal.Decimal on str.format not about locales (GH-8808) https://github.com/python/cpyt

[issue34432] doc Mention complex and decimal.Decimal on str.format note about locales

2018-08-18 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset fbd0a14cc941e340df0979d94ac55191dd31ad00 by Eric V. Smith (Miss Islington (bot)) in branch '3.6': bpo-34432: doc Mention complex and decimal.Decimal on str.format not about locales (GH-8808) (GH-8810) https://github.com/python/cpyt

[issue34432] doc Mention complex and decimal.Decimal on str.format note about locales

2018-08-18 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 0fd6f832a9c30404bf595a4af36e171d11fab024 by Eric V. Smith (Miss Islington (bot)) in branch '3.7': bpo-34432: doc Mention complex and decimal.Decimal on str.format note about locales (GH-8808) (GH-8809) https://github.com/python/cpyt

[issue34432] doc Mention complex and decimal.Decimal on str.format note about locales

2018-08-18 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks, Andrés! -- assignee: docs@python -> eric.smith resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python

[issue34393] json.dumps - allow compression

2018-08-22 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not asking to be difficult, I'm asking because a full specification would be required in order to implement this. For example, you're excluding the "compresslevel" parameter, so presumably you'd want the default of 9, which

[issue34425] :s formatting broken for objects without __format__

2018-08-22 Thread Eric V. Smith
Eric V. Smith added the comment: About translating ":s" to "": > The library seems willing to do this for the empty format string, but not when the client code specifically asks for a string You're not asking for a string when you specify ":s". You

[issue34425] :s formatting broken for objects without __format__

2018-08-22 Thread Eric V. Smith
Eric V. Smith added the comment: Forgot to add: I haven't looked at the docs yet, but I agree they should be clear on this issue. The docs should say: for types that implement the documented mini-language, "s" is the same as "". It's just that not all typ

[issue34483] eval() raises NameError: name '...' is not defined

2018-08-23 Thread Eric V. Smith
Eric V. Smith added the comment: I believe you're seeing this: https://docs.python.org/3/reference/executionmodel.html#naming-and-binding See the paragraph that starts with "Class definition blocks and arguments to exec() and eval() are special in the context of name resolution

[issue33569] dataclasses InitVar does not maintain any type info

2018-08-24 Thread Eric V. Smith
Eric V. Smith added the comment: Can you create a pull request? It's easier to review that way. -- ___ Python tracker <https://bugs.python.org/is

[issue33569] dataclasses InitVar does not maintain any type info

2018-08-24 Thread Eric V. Smith
Eric V. Smith added the comment: test message, please ignore -- ___ Python tracker <https://bugs.python.org/issue33569> ___ ___ Python-bugs-list mailin

[issue34483] eval() raises NameError: name '...' is not defined

2018-08-25 Thread Eric V. Smith
Eric V. Smith added the comment: I'll close this. I'm still reviewing the docs on it, and I might open a documentation issue once I understand it better. -- resolution: -> not a bug stage: -> resolved status: open -> closed

[issue34524] Format conversion documentation example don't match comment

2018-08-27 Thread Eric V. Smith
Eric V. Smith added the comment: Can you be more specific? -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue34524> ___ ___ Python-bug

[issue34534] importlib.resources does not work with packages that have no __init__.py

2018-08-28 Thread Eric V. Smith
Eric V. Smith added the comment: What's the difference between "namespace packages and implicit non-namespace packages"? I think those are the same thing, aren't they? -- nosy: +barry, brett.cannon, eric.smith ___ Py

[issue34595] PyUnicode_FromFormat(): add %T format for an object type name

2018-09-06 Thread Eric V. Smith
Eric V. Smith added the comment: I don't think you have to worry about %T being used by other formatting functions. If (heaven forbid) dates were ever supported by PyUnicode_FromFormat(), there would have to be a way to switch from "normal" argument processing to ar

[issue34605] Avoid master/slave terminology

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

[issue34612] doc Some classes are treated as functions in Built-in Functions

2018-09-08 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not sure this is an improvement. While it's true that 'complex' is a class, it's described here as a function. Same as 'int'. The fact that it's a function or class isn't so important here. I suspect it will

[issue34612] doc Some classes are treated as functions in Built-in Functions

2018-09-08 Thread Eric V. Smith
Eric V. Smith added the comment: Ah, you're correct. I just looked for the word "class" inside the "int" text, and it doesn't appear there: I thought it was deliberately left out. But it does show up in the sub-section header (before "int" itself).

[issue34213] Frozen dataclass __init__ fails for "object" property"

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

[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple

2018-09-10 Thread Eric V. Smith
Change by Eric V. Smith : -- pull_requests: +8598 ___ Python tracker <https://bugs.python.org/issue34363> ___ ___ Python-bugs-list mailing list Unsubscribe:

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