[issue42742] Add abc.Mapping to dataclass

2020-12-25 Thread Eric V. Smith
Eric V. Smith added the comment: You'd need to return a different class in order to add the collections.abc.Mapping base class. Currently, dataclasses by design always return the same class that's passed in. I'd suggest adding this as a stand-alone decorator. -- assignee

[issue42724] Change library name when building.

2020-12-23 Thread Eric V. Smith
Eric V. Smith added the comment: This tracker is for reporting bugs in python. I think you'd have better luck asking this question on Stack Overflow, or maybe the python-list mailing list: https://mail.python.org/mailman/listinfo/python-list -- nosy: +eric.smith

[issue9694] argparse required arguments displayed under "optional arguments"

2020-12-22 Thread Eric V. Smith
Eric V. Smith added the comment: I wouldn't let breaking these tests deter you from improving the output. I think using "options" is an improvement. -- ___ Python tracker <https://bugs.python.

[issue42720] << operator has a bug

2020-12-22 Thread Eric V. Smith
Eric V. Smith added the comment: That's not how they're defined. From https://docs.python.org/3/reference/expressions.html?highlight=left%20shift#shifting-operations "A right shift by n bits is defined as floor division by pow(2,n). A left shift by n bits is defined as multiplic

[issue42720] << operator has a bug

2020-12-22 Thread Eric V. Smith
Eric V. Smith added the comment: Why do you think the first 3 bits should be dropped? That's not the documented behavior of <<. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/i

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-21 Thread Eric V. Smith
Eric V. Smith added the comment: See https://github.com/ikamensh/flynt#dangers-of-conversion for reasons. Would I like to see all string literal formatting done with f-strings? Yes! Would I accept the risk and hassle of doing it blindly

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-21 Thread Eric V. Smith
Eric V. Smith added the comment: > Wait I don't understand why you wouldn't accept a wholesale replacement of > all `%` and `format` with f-strings through the entire CPython codebase > [master branch]? For such a large change it's difficult to review every single change and ens

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-21 Thread Eric V. Smith
Eric V. Smith added the comment: @samuelmarks: A place where there it is possible to improve performance is with f-strings replacing %-formatting or str.format. This does move significant work to compile time. However, we'd be unlikely to accept a wholesale stdlib change that swaps in f

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-20 Thread Eric V. Smith
Eric V. Smith added the comment: Do you have any benchmarks to show this is an actual improvement? Often times it is not. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue42

[issue42680] unicode identifiers not accessible or assignable through globals()

2020-12-20 Thread Eric V. Smith
Eric V. Smith added the comment: I think documenting this with globals() and locals() is a good idea. That's the place this is most likely to trip someone up. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue42

[issue42669] "except" documentation still suggests nested tuples are allowed

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

[issue42669] "except" documentation still suggests nested tuples are allowed

2020-12-20 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 81f706d2db0f57c4fdd747df6e0a4cffcbc54704 by Miss Islington (bot) in branch '3.8': bpo-42669: Document that `except` rejects nested tuples (GH-23822) (GH-23871) https://github.com/python/cpython/commit/81f706d2db0f57c4fdd747df6e0a4cffcbc54704

[issue42669] "except" documentation still suggests nested tuples are allowed

2020-12-20 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 409ce4a09e4f96ca9b251c19f5819205aae9ae34 by Miss Islington (bot) in branch '3.9': bpo-42669: Document that `except` rejects nested tuples (GH-23822) (GH-23870) https://github.com/python/cpython/commit/409ce4a09e4f96ca9b251c19f5819205aae9ae34

[issue41724] SQLite returns "str" instead of "datetime.datetime" with aggregate queries.

2020-12-19 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for the PR! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue41724] SQLite returns "str" instead of "datetime.datetime" with aggregate queries.

2020-12-19 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 24862b02dfd1e2843727f28fa2ba05828fdfa8de by Miss Islington (bot) in branch '3.8': bpo-41724: Explain when the conversion is not possible with detect_types enabled (GH-23855) (GH-23863) https://github.com/python/cpython/commit

[issue41724] SQLite returns "str" instead of "datetime.datetime" with aggregate queries.

2020-12-19 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset a34ab8188e0352e4066da4f79ed3cc24d1b61a63 by Miss Islington (bot) in branch '3.9': bpo-41724: Explain when the conversion is not possible with detect_types enabled (GH-23855) (GH-23862) https://github.com/python/cpython/commit

[issue41724] SQLite returns "str" instead of "datetime.datetime" with aggregate queries.

2020-12-19 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 09a36cdfb7c22f44df45b44e5561776206bcedfb by sblondon in branch 'master': bpo-41724: Explain when the conversion is not possible with detect_types enabled (GH-23855) https://github.com/python/cpython/commit

[issue42677] Support comments in argparse fromfile_prefix_chars files

2020-12-19 Thread Eric V. Smith
Eric V. Smith added the comment: Have you tried returning an empty list? -- ___ Python tracker <https://bugs.python.org/issue42677> ___ ___ Python-bugs-list m

[issue42677] Support comments in argparse fromfile_prefix_chars files

2020-12-18 Thread Eric V. Smith
Eric V. Smith added the comment: I think you could achieve this by overriding convert_arg_line_to_args. If this were baked in to argparse, there would need to be an argument to argparse.ArgumentParser to turn on this behavior, with the default being to not support comments. That's because

[issue42664] strptime(%c) fails to parse the output of strftime(%c)

2020-12-16 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior ___ Python tracker <https://bugs.python

[issue42664] strptime(%c) fails to parse the output of strftime(%c)

2020-12-16 Thread Eric V. Smith
Eric V. Smith added the comment: You have the parameters to strptime backward. >>> datetime.datetime.strptime(datetime.datetime.now().strftime("%c"), "%c") datetime.datetime(2020, 12, 16, 20, 51, 38) -- nosy: +eric.smith _

[issue42646] Add function that supports "applying" methods

2020-12-15 Thread Eric V. Smith
Eric V. Smith added the comment: This seems way too special case for the stdlib, and especially not as a builtin. I've never seen this pattern before. Why is copy so special? I suggest raising this on the python-ideas mailing list if you'd like to get some traction for it. -- nosy

[issue42632] Reassgining ZeroDivisionError will lead to bug in Except clause

2020-12-14 Thread Eric V. Smith
Eric V. Smith added the comment: And thanks, Dennis, for the explanation as to why it's the expected behavior. -- ___ Python tracker <https://bugs.python.org/issue42

[issue42632] Reassgining ZeroDivisionError will lead to bug in Except clause

2020-12-14 Thread Eric V. Smith
Eric V. Smith added the comment: This code is working as expected, so I'm closing this. -- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42607] raw strings SyntaxError

2020-12-08 Thread Eric V. Smith
Eric V. Smith added the comment: This is a FAQ: https://docs.python.org/3/faq/design.html#why-can-t-raw-strings-r-strings-end-with-a-backslash Raw strings can't end with an odd number of backslashes. -- components: -Windows nosy: +eric.smith resolution: -> not a bug st

[issue42572] Better path handling with argparse

2020-12-08 Thread Eric V. Smith
Eric V. Smith added the comment: The more I think about this, the more I think it shouldn't be in the stdlib. paul.j3 is correct that the simple case is just type=pathlib.Path. For something more adventurous you could start with: @dataclass(eq=True, frozen=True) class ArgumentPath

[issue42572] Better path handling with argparse

2020-12-07 Thread Eric V. Smith
Eric V. Smith added the comment: Hi, Austin. If it's something that can be implemented in a library (which this suggestion qualifies as), then we typically want to see it on PyPI and to gain some traction there. I only suggested argparse-types because it also has some argparse add-ons

[issue42572] Better path handling with argparse

2020-12-06 Thread Eric V. Smith
Eric V. Smith added the comment: I think this would be a type, not an action. I'm not sure this would pass the bar of something that should be added to the stdlib. But in any event, it should be developed on PyPI first, perhaps by adding it to argparse-types. -- nosy: +eric.smith

[issue17612] hooks/mail.py requires [smtp] host to be set, despite a comment to the contrary

2020-12-05 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> out of date stage: -> resolved status: pending -> closed ___ Python tracker <https://bugs.python.or

[issue42570] Try and Except doesn't work properly

2020-12-04 Thread Eric V. Smith
Eric V. Smith added the comment: You've not said what happens, nor what you're expecting to happen, so we cannot help you. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue42

[issue42563] max function reports type errors in incorrect order

2020-12-04 Thread Eric V. Smith
Eric V. Smith added the comment: I don't think making a change would be worth the risk. -- nosy: +eric.smith priority: low -> normal versions: +Python 3.8 -Python 3.10 ___ Python tracker <https://bugs.python.org/issu

[issue42543] case sensitivity in open() arguments

2020-12-03 Thread Eric V. Smith
Eric V. Smith added the comment: Although I'm not sure the existing message needs changing, if a change is going to be made I think listing the valid option characters might be more useful. -- nosy: +eric.smith ___ Python tracker <ht

[issue42518] Error Message

2020-11-30 Thread Eric V. Smith
Eric V. Smith added the comment: This appears to be similar to issue42488, which it looks like you also reported, with a different account. It's not clear to me why you expect the output to be False. But in any event, this is not a bug in Python. >>> 100 ^ 1000 908 Please do n

[issue42506] Unexpected output when running test_format

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

[issue42437] crypt produces wrong hashes for passwords containing dollar sign

2020-11-29 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue42437> ___ ___

[issue39096] "Format Specification Mini-Language" doc mistake for Decimal

2020-11-29 Thread Eric V. Smith
Eric V. Smith added the comment: These changes are a big improvement. Thanks, Mark. Should this issue be closed, or are you thinking of more changes? Personally I think we should leave it as it is now, and open another issue if people find fault with the new docs

[issue42500] crash with unbounded recursion in except statement

2020-11-29 Thread Eric V. Smith
Eric V. Smith added the comment: Note that changing the os.fstat line to just "raise OSError()" no longer causes the "Fatal Python error", but rather gives the expected recursion exception. Here's a shorter version that causes the fatal error in Windows native 3.9, cygw

[issue42500] crash with unbounded recursion in except statement

2020-11-29 Thread Eric V. Smith
Eric V. Smith added the comment: Here's the smallest reproducer I could come up with. It fails on Windows with 3.9 native(compiled locally) (Fatal Python error: _Py_CheckRecursiveCall: Cannot recover from stack overflow), works (raises RecursionError) with cygwin 3.8.3. import os def

[issue42482] TracebackException should not hold reference to the exception traceback

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

[issue42478] ipaddress.IPv4network.interfaces()

2020-11-26 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not sure what you mean by iterating over the interfaces in a subnet. Could you give an example? -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue42

[issue42450] Docstrings in itertools recipes should have triple-quotes

2020-11-25 Thread Eric V. Smith
Eric V. Smith added the comment: Although I do have to say it wouldn't offend me if the partition and nth_combination examples were changed to double quotes to be consistent! But it's not important. -- ___ Python tracker <https://bugs.python.

[issue42462] Unacceptable Output

2020-11-25 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue42462> ___ ___

[issue36159] Modify Formatter Class to handle arbitrary objects

2020-11-24 Thread Eric V. Smith
Eric V. Smith added the comment: I just stumbled across this. I don't think the idea is totally without merit, although maybe it's too niche to warrant being in the stdlib. It should probably be discussed on python-ideas first. -- versions: +Python 3.10 -Python 2.7, Python 3.8

[issue42450] Docstrings in itertools recipes should have triple-quotes

2020-11-23 Thread Eric V. Smith
Eric V. Smith added the comment: I don't think the readability of the examples would be improved by triple quotes. In fact, I think it would be reduced. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue42

[issue42449] Adding number to a declared 2 dimension list

2020-11-23 Thread Eric V. Smith
Eric V. Smith added the comment: This isn't a bug. All of your nested lists are the same. See for example: https://stackoverflow.com/questions/44195396/initializing-an-m-x-n-array-of-0s-in-python -- components: -Regular Expressions nosy: +eric.smith resolution: -> not a bug st

[issue42436] Google use wrong "hightlight" argument

2020-11-23 Thread Eric V. Smith
Change by Eric V. Smith : -- status: open -> pending ___ Python tracker <https://bugs.python.org/issue42436> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue42422] Py_Decref on value crash the interpreter in Python/ceval.c:1104

2020-11-23 Thread Eric V. Smith
Eric V. Smith added the comment: @BTaskaya: do you think this is too similar to bogus_code_obj.py? That's the only crasher I can see it being similar to. -- versions: +Python 3.10 -Python 3.6, Python 3.7 ___ Python tracker <ht

[issue42432] Http client, Bad Status Line triggered for no reason

2020-11-22 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for the reproducer and the research! https://tools.ietf.org/html/rfc2616#section-3.1 says the result header is "HTTP", and doesn't say anything else is acceptable. I'd be interested in what other frameworks (probably in other languages) sup

[issue42432] Http client, Bad Status Line triggered for no reason

2020-11-22 Thread Eric V. Smith
Eric V. Smith added the comment: requests is a third-party library, and this isn't the right place to report issues with it. It looks like the requests issue tracker is at https://github.com/psf/requests/issues If you can duplicate this problem with only using the python standard library

[issue42436] Google use wrong "hightlight" argument

2020-11-22 Thread Eric V. Smith
Eric V. Smith added the comment: This seems to be a question for Google. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue42436> ___ ___

[issue42429] Behavior of general (%g, :g) formatting inconsistent for decimal.Decimal

2020-11-21 Thread Eric V. Smith
Eric V. Smith added the comment: A few things: - There is no %-formatting for Decimal types. They're being converted to float first. That's why it appears that %-formatting with 'g' works the same for decimal and float: you're really just calling the float version. - The difference in 'g

[issue42422] Py_Decref on value crash the interpreter in Python/ceval.c:1104

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

[issue28002] ast.unparse can't roundtrip some f-strings

2020-11-20 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: not a bug -> fixed ___ Python tracker <https://bugs.python.org/issue28002> ___ ___ Python-bugs-list mailing list Un

[issue42414] unable to document fields of dataclass

2020-11-20 Thread Eric V. Smith
Eric V. Smith added the comment: @property has a place to attach the docstring, dataclasses in general do not. I wouldn't want to add a descriptor just to have the ability to add a docstring. There are performance issues involved, and I'm sure some corner cases where functionality would

[issue42414] unable to document fields of dataclass

2020-11-20 Thread Eric V. Smith
Eric V. Smith added the comment: How would you expect to extract this docstring? I'm not sure how this would work in practice, since both of these are errors: >>> class A: ...def __init__(self): ...self.x = 3 ...self.x.__doc__ = 'foo' ... >>> A() Trac

[issue42414] unable to document fields of dataclass

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

[issue40998] Compiler warnings in ubsan builds

2020-11-18 Thread Eric V. Smith
Eric V. Smith added the comment: Too many Eric S's! -- ___ Python tracker <https://bugs.python.org/issue40998> ___ ___ Python-bugs-list mailing list Unsub

[issue40998] Compiler warnings in ubsan builds

2020-11-18 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue40998> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42379] Optional List Args Persist Across Objects

2020-11-16 Thread Eric V. Smith
Eric V. Smith added the comment: This is defined behavior in the language, so it's not a bug. The "pythonic" way to deal with this is usually: def funct(self, array = None): if array is None: array = [] -- components: +Interpreter Core -ctypes nosy: +

[issue42369] Reading ZipFile not thread-safe

2020-11-16 Thread Eric V. Smith
Eric V. Smith added the comment: I'm changing from "crash" to "behavior". We use "crash" for a segfault or equivalent. I realize that most people are unlikely to know this, but we consider "crash" to be more alarming, so I want to make sur

[issue42356] Dict inline manipulations

2020-11-14 Thread Eric V. Smith
Eric V. Smith added the comment: I think you should bring this up on the python-ideas mailing list if you'd like to see it discussed. It will likely also require a PEP, similar to PEP 584. -- nosy: +eric.smith ___ Python tracker <ht

[issue42344] SimpleNamespace: update documentation regarding comparison

2020-11-13 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 4defeb007195d2d17ea404b0b6291d1d233010f4 by Miss Islington (bot) in branch '3.9': bpo-42344: Improve pseudo implementation for SimpleNamespace (GH-23264) (GH-23270) https://github.com/python/cpython/commit

[issue42344] SimpleNamespace: update documentation regarding comparison

2020-11-13 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset cb2b2035ca752529755440990c4073d5164e80df by Miss Islington (bot) in branch '3.8': bpo-42344: Improve pseudo implementation for SimpleNamespace (GH-23264) (GH-23269) https://github.com/python/cpython/commit

[issue42344] SimpleNamespace: update documentation regarding comparison

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

[issue42344] SimpleNamespace: update documentation regarding comparison

2020-11-13 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset bbeb2d266d6fc1ca9778726d0397d9d6f7a946e3 by Jürgen Gmach in branch 'master': bpo-42344: Improve pseudo implementation for SimpleNamespace (GH-23264) https://github.com/python/cpython/commit/bbeb2d266d6fc1ca9778726d0397d9d6f7a946e3

[issue42344] SimpleNamespace: update documentation regarding comparison

2020-11-13 Thread Eric V. Smith
Eric V. Smith added the comment: If the implementation compares the classes, then I think the "roughly equivalent" version should, too. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.o

[issue42269] Add ability to set __slots__ in dataclasses

2020-11-10 Thread Eric V. Smith
Eric V. Smith added the comment: It would figure it out automatically. See https://github.com/ericvsmith/dataclasses/blob/master/dataclass_tools.py for a decorator that already does this. I'll have a PR ready soon, I hope. -- ___ Python tracker

[issue42302] [Turtle] Add clockwise and anticlockwise method as alias to right and left

2020-11-10 Thread Eric V. Smith
Eric V. Smith added the comment: I think having two ways to do the same thing in a module targeted toward beginners would be too confusing. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue42

[issue42278] Remove usage of tempfile.mktemp in stdlib

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

[issue42274] Imaplib hangs up infinitely when performing append operation

2020-11-06 Thread Eric V. Smith
Eric V. Smith added the comment: The bug tracker isn't the appropriate place to ask for help. Your problem is most likely with your code, or possibly with the server you're talking to. But you haven't provided us any way of knowing which. I suggest you ask for help on the python-list

[issue42269] Add ability to set __slots__ in dataclasses

2020-11-05 Thread Eric V. Smith
New submission from Eric V. Smith : I resisted adding the ability to set __slots__ in the first version of dataclasses, since it requires that instead of modifying an existing class, an entirely new class is returned. But I think this feature would be useful enough that I'm now willing

[issue41810] Consider reintroducing `types.EllipsisType` for the sake of typing

2020-11-05 Thread Eric V. Smith
Eric V. Smith added the comment: I don't think we should backport them. It's definitely a new feature, and our policy is no new features in micro versions. -- ___ Python tracker <https://bugs.python.org/issue41

[issue42265] Remove binhex module following PEP-594

2020-11-04 Thread Eric V. Smith
Eric V. Smith added the comment: PEP 594 hasn't been accepted yet. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue42265> ___ ___ Pytho

[issue42209] Incorrect line reported in syntax error

2020-10-30 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42209] Incorrect line reported in syntax error

2020-10-30 Thread Eric V. Smith
Eric V. Smith added the comment: The line number has been fixed in python 3.9: File "...\foo.py", line 5 (**kwargs) ^ SyntaxError: f-string: invalid syntax The error message should improve when we move parsing of f-strings into the parser. I doubt we'd put in the ef

[issue42061] Document __format__ method for IPv[46]Address

2020-10-29 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for the contribution, @John-Ted! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42156] Currency not correct for all locales

2020-10-29 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue42156> ___ ___

[issue42168] Question about deserializing some numbers (bug??)

2020-10-27 Thread Eric V. Smith
Eric V. Smith added the comment: Or stated differently: if you pass random byte strings to pickle.loads(), sometimes it might succeed and produce a random object because you've managed to create a valid pickle. But most often it will fail

[issue42168] Question about deserializing some numbers (bug??)

2020-10-27 Thread Eric V. Smith
Eric V. Smith added the comment: I explained this in https://bugs.python.org/issue42165#msg379755 This is not a bug in python, it's a bug in your code. You should not expect to unpickle something that wasn't created by pickling it. -- nosy: +eric.smith resolution: -> not a

[issue42165] closed (reopen with other issue)

2020-10-27 Thread Eric V. Smith
Eric V. Smith added the comment: To answer the question: > "can anyone explain why "pickle.loads(np.float64(0.34104))" prints "True" You can use pickletools.dis: >>> bytes(np.float64(0.34104)) b'\x88.\xa8o\x99\xd3\xd5?' >>> pickletools.dis(b

[issue42156] Currency not correct for all locales

2020-10-26 Thread Eric V. Smith
Eric V. Smith added the comment: And just to show that python is doing the right thing, if the locale is set up correctly, I'll show the following hack: >>> import locale >>> locale.setlocale(locale.LC_ALL, 'en_US') 'en_US' >>> locale.currency(24.99) '$24.99' >

[issue42156] Currency not correct for all locales

2020-10-26 Thread Eric V. Smith
Eric V. Smith added the comment: p_cs_precedes == 1 means "the currency_symbol or int_curr_symbol strings should precede the value of a monetary amount", per https://www.gnu.org/software/libc/manual/html_node/Currency-Symbol.html (I couldn't find a more authoritative source, b

[issue42156] Currency not correct for all locales

2020-10-26 Thread Eric V. Smith
Eric V. Smith added the comment: What does locale.localeconv() return? >>> locale.localeconv() {'int_curr_symbol': '', 'currency_symbol': '', 'mon_decimal_point': '', 'mon_thousands_sep': '', 'mon_grouping': [], 'positive_sign': '', 'negative_sign': '', 'int_frac_digits': 127, 'fr

[issue42148] floating point representation issues

2020-10-25 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for double-checking the other languages, Steven. -- ___ Python tracker <https://bugs.python.org/issue42148> ___ ___ Pytho

[issue42148] floating point representation issues

2020-10-25 Thread Eric V. Smith
Eric V. Smith added the comment: This isn't a bug. It's due to the base 2 representation of floating point numbers. See for example: See https://docs.python.org/3/tutorial/floatingpoint.html It's possible, depending on your use case, you might want to use the decimal module. But that has

[issue42118] TypeError gives wrong reserved name

2020-10-22 Thread Eric V. Smith
Eric V. Smith added the comment: Unfortunately there's not much that can be done about this. The code that writes that error message only knows about objects, which don't have names, only types and values. -- ___ Python tracker <ht

[issue42118] TypeError gives wrong reserved name

2020-10-22 Thread Eric V. Smith
Eric V. Smith added the comment: I should point out that this is the same as doing: >>> ''() :1: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma? Traceback (most recent call last): File "", line 1, in TypeError: 'str' object is n

[issue42118] TypeError gives wrong reserved name

2020-10-22 Thread Eric V. Smith
Eric V. Smith added the comment: You've rebound "int" to a string. I think the error message is correct. Here's a simpler case: >>> int = '' >>> int '' >>> int() Traceback (most recent call last): File "", line 1, in TypeError: 'str' obj

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

2020-10-21 Thread Eric V. Smith
Eric V. Smith added the comment: Just some notes to consider before work starts on this in earnest: We need to decide what sort of changes we'll accept, if any. For at least the first round of this, I'm okay with "absolutely no change will be acceptable". For example, here's a g

[issue41747] dataclasses: generated method's using the wrong qualname

2020-10-21 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for the PR! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue41747] dataclasses: generated method's using the wrong qualname

2020-10-21 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset c7437e2c0216e05fbf17bf96294cb20954e36e48 by Batuhan Taskaya in branch 'master': bpo-41747: Ensure all dataclass methods uses their parents' qualname (GH-22155) https://github.com/python/cpython/commit/c7437e2c0216e05fbf17bf96294cb20954e36e48

[issue42091] strftime returns empty string for -d, -I 3.8.3

2020-10-19 Thread Eric V. Smith
Eric V. Smith added the comment: Can you tell us what the expected behavior is? >From the strftime docs: "The full set of format codes supported varies across >platforms, because Python calls the platform C library’s strftime() function, >and platform variations are common. T

[issue42081] Consider fast_double_parser for faster str->double

2020-10-19 Thread Eric V. Smith
Eric V. Smith added the comment: This was proposed in issue 41310. -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue42081> ___ ___ Pytho

[issue42068] For macOS, package the included Tcl and Tk frameworks in a rational way.

2020-10-18 Thread Eric V. Smith
Eric V. Smith added the comment: It sounds like your solution is macOS only, where as Python needs to be cross platform. Further, I assume there are good reasons that it's implemented the way it is. Perhaps there was no alternative when it was initially developed? And we're constrained

[issue32820] Add and document __format__ method for IPv[46]Address

2020-10-17 Thread Eric V. Smith
Eric V. Smith added the comment: I've created issue 42061 for the documentation. Hopefully marking that issue as easy and newcomer friendly will attract some attention. Thanks ewosborne and Serhiy for adding this feature, and everyone for their input. -- resolution: -> fixed st

[issue42061] Document __format__ method for IPv[46]Address

2020-10-17 Thread Eric V. Smith
New submission from Eric V. Smith : This feature was added in issue 32820, but was never documented. -- assignee: docs@python components: Documentation keywords: easy, newcomer friendly messages: 378812 nosy: docs@python, eric.smith priority: normal severity: normal stage: needs patch

[issue32820] Add and document __format__ method for IPv[46]Address

2020-10-17 Thread Eric V. Smith
Eric V. Smith added the comment: At this point, it's a documentation-only issue. This new feature isn't documented. It might be less confusing to close this issue and open a new one. I'll do that shortly. -- versions: +Python 3.10 ___ Python

[issue32820] Add and document __format__ method for IPv[46]Address

2020-10-16 Thread Eric V. Smith
Eric V. Smith added the comment: Re: backporting A quick test shows this feature is not in 3.8. We can't add new features to 3.8, so I'd say "no, it doesn't need to be backported". -- ___ Python tracker <https://bugs.python.o

[issue42007] Line continuation after Boolean operation

2020-10-12 Thread Eric V. Smith
Eric V. Smith added the comment: Agreed that this isn't likely to change. If you have a concrete proposal for how the language parsing rules would change in order to support this, you should post it to the python-ideas mailing list. If that discussion results in a consensus, then we can re

[issue41996] Should `make install` still install to /usr/bin/python3?

2020-10-10 Thread Eric V. Smith
Eric V. Smith added the comment: There's a PEP for this: PEP 394. If you want to change this, I suggest discussing it on the python-dev mailing list. If that leads to changes in the PEP, this issue can be re-opened. Personally I don't see this change happening until there are no systems

<    3   4   5   6   7   8   9   10   11   12   >