[issue39461] [RFE] os.environ should support Path-like values, like subprocess(..., env=...)

2020-01-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Path-like objects are now unintentionally accepted for many non-path things, like hostname in socket.sethostname() and username in os.initgroups(). I also think it was a mistake, and we should not make new mistakes

[issue39391] Nondeterministic Pydoc output on functions that have functions as default parameters

2020-01-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Even if we change the repr of functions (I like this idea), this will not solve the general problem: many reprs contain an object id. In your case I suggest to post-process the pydoc output and replace parts matching ' at 0x[0-9a

[issue39479] [RFE] Add math.lcm() function: Least Common Multiple

2020-01-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: reduce(gcd, [a, b, c, d, e]) -- ___ Python tracker <https://bugs.python.org/issue39479> ___ ___ Python-bugs-list mailin

[issue39480] referendum reference is needlessly annoying

2020-01-28 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +akuchling ___ Python tracker <https://bugs.python.org/issue39480> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39495] xml.etree.ElementTree.TreeBuilder.start differs between pure Python and C implementations

2020-01-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: According to the documentation the attrs parameter does not have default value. I think that the C implementation should be changed. https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.TreeBuilder.start

[issue39500] Document PyUnicode_IsIdentifier() function

2020-01-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Since the behavior was changed, I think we need a versionchanged directive. This function was added in 3.0. Prior to 3.3 it was always successful (if you pass an unicode object, that is required for most of PyUnicode API). Py_FatalError was added in 3.3

[issue39424] [easy] test_signal: test_pidfd_send_signal() uses deprecated assertRaisesRegexp() method

2020-01-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 38c878b56cff997de8fb04a586c963039b69b414 by damani42 in branch 'master': bpo-39424: Use assertRaisesRegex instead of assertRaisesRegexp. (GH-18277) https://github.com/python/cpython/commit/38c878b56cff997de8fb04a586c963

[issue39424] [easy] test_signal: test_pidfd_send_signal() uses deprecated assertRaisesRegexp() method

2020-01-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue39479] [RFE] Add math.lcm() function: Least Common Multiple

2020-01-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If a < b, what is better, a // gcd(a, b) * b or b // gcd(a, b) * a ? Or there is no difference? -- ___ Python tracker <https://bugs.python.org/issu

[issue39489] Remove COUNT_ALLOCS special build

2020-01-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I used COUNT_ALLOCS for curiosity. But I needed slightly different information, so in any case I patched the code. AFAIK COUNT_ALLOCS is used in some large projects (maybe Fedora). It was already discussed somewhere on the tracker, but I have no a link

[issue39500] Document PyUnicode_IsIdentifier() function

2020-01-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Other examples are: * PyObject_HasAttr * PyObject_HasAttrString * PyMapping_HasKey * PyMapping_HasKeyString They are bad examples, but can't be changed for backward compatibility. I wonder whether PyUnicode_IsIdentifier should also kept unchange

[issue39489] Remove COUNT_ALLOCS special build

2020-01-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It was many years ago, and I used it to get some statistics about using Python objects of some types. But it did not work as I wanted for cached integers etc. In any case I can patch Python again if I need such information. Seems Fedora was the main user

[issue39500] Document PyUnicode_IsIdentifier() function

2020-01-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is not convenient to check the result for error. After we remove support of old PyUnicode API, PyUnicode_IsIdentifier() will be always succeeded. Note that PyUnicode_IsIdentifier() still can crash if you pass a non-PyUnicode object or NULL. It is a

[issue39484] time_ns() and time() cannot be compared on windows

2020-01-31 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue39484> ___ ___ Python-bugs-list mailing list Unsub

[issue39467] Allow to deprecate CLI arguments in argparse

2020-02-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In general I agree with Raymond, although I am warmer to this feature. And I think we should have a mechanism to deprecate not only options, but subcommands. * The warnings module is used for warning about the use of API. It outputs the file and the line

[issue39020] [AIX] module _curses fails to build since ESCDELAY has been added

2020-02-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +17679 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18302 ___ Python tracker <https://bugs.python.org/issu

[issue39020] [AIX] module _curses fails to build since ESCDELAY has been added

2020-02-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: NetBSD also uses non-ncurses implementation of curses, but it supports ESCDELAY, set_escdelay(), etc. This is not a difference between ncurses and non-ncurse, but a problem specific to the AIX implementation of curses. Please check that PR 18302 fixes the

[issue39020] [AIX] module _curses fails to build since ESCDELAY has been added

2020-02-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Michael. Sorry, I just missed that you are working on your PR. -- ___ Python tracker <https://bugs.python.org/issue39

[issue39513] NameError: name 'open' is not defined

2020-02-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Symptoms as when try to log very late at shutdown stage, when the content of the builtin module is restored to its original value which does not include open imported from io. -- nosy: +serhiy.storchaka

[issue39526] print(text1.get(1.2,1.5))

2020-02-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 1.30 is the same as 1.3 in Python. You perhaps want to use '1.30'. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.o

[issue39529] Deprecate get_event_loop()

2020-02-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Will asyncio.get_event_loop() be removed or made an alias of asyncio.get_running_loop()? The latter could minimize the disruption of the existing code. -- nosy: +serhiy.storchaka ___ Python tracker <ht

[issue39529] Deprecate get_event_loop()

2020-02-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, it is what I meant. Many code written before 3.7 use get_event_loop() because there was no get_running_loop() yet. Now, to avoid deprecation (and making the code more robust) it should be rewritten with using get_running_loop() or get_event_loop

[issue39538] SystemError when set Element.attrib to non-dict

2020-02-03 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The C implementation raises a SystemError after setting Element.attrib to non-dict. >>> from xml.etree import ElementTree as ET >>> e = ET.Element('a') >>> e.attrib = 1 >>> e.get('x') Traceback (mo

[issue39484] time_ns() and time() cannot be compared on windows

2020-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The problem is that there is a double rounding in time = float(time_ns) / 1e9 1. When convert time_ns to float. 2. When divide it by 1e9. The formula time = time_ns / 10**9 may be more accurate. -- nosy: +lemburg, mark.dickinson

[issue39484] time_ns() and time() cannot be compared on windows

2020-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: But they are not single-digit integers. And more, int(float(a)) != a. -- ___ Python tracker <https://bugs.python.org/issue39

[issue39484] time_ns() and time() cannot be compared on windows

2020-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >>> 1580301619906185300/10**9 1580301619.9061854 >>> 1580301619906185300/1e9 1580301619.9061852 >>> float(F(1580301619906185300/10**9) * 10**9 - 1580301619906185300) 88.5650634765625 >>> float(F(158030161990618530

[issue39545] await is not supported in f-string in 3.6

2020-02-03 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The following code is compiled in 3.7, but is a syntax error in 3.6. async def f(x): f"{await x}" I have not found mentioning this change in What's New, and it looks grammatically correct. It looks as a bug in 3.6. It may be too lat

[issue39545] await is not supported in f-string in 3.6

2020-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, await was recognized only in asynchronous functions. f-strings involve a separate parsing step for subexpressions, and it is not aware that it is in an asynchronous function. Seems the fix was unintentional, but it should documented in any case

[issue39537] Change line number table format

2020-02-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I planned to add a table for end line numbers, so every instruction will be associated with a range of lines. For example, in x = { a, b } the BUILD_SET instruction will be associated with lines 1-4. Currently it is associated only with line

[issue39550] isinstance accepts subtypes of tuples as second argument

2020-02-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I do not understand what the problem is. If the isinstance tuple iteration were to start using __iter__ in the future, it should start to handle all corner cases. But what is wrong now? -- nosy: +serhiy.storchaka

[issue38149] sys.audit() is called multiple times for glob.glob()

2020-02-05 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +17735 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18360 ___ Python tracker <https://bugs.python.org/issu

[issue39559] uuid.getnode() has unused argument

2020-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 8b6f6526f857bb7523b0fcff09b45bc6471289e9 by Shantanu in branch 'master': bpo-39559: Remove unused, undocumented argument from uuid.getnode (GH-18369) https://github.com/python/cpython/commit/8b6f6526f857bb7523b0fcff09b45b

[issue39559] uuid.getnode() has unused argument

2020-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree. It was added in issue32502, but was never documented and used. Thank you Sebastian and Shantanu. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Pytho

[issue39562] Asynchronous comprehensions don't work in asyncio REPL

2020-02-05 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue39562> ___ ___ Python-bugs-list mailing list Unsub

[issue39127] _Py_HashPointer's void * argument should be const

2020-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 3d06953c34fd6421dd1dfdb615578cde676ee0eb by Andy Lester in branch 'master': bpo-39127: Make _Py_HashPointer's argument be const (GH-17690) https://github.com/python/cpython/commit/3d06953c34fd6421dd1dfdb615578cde676ee0eb

[issue39567] Add audit for os.walk, os.fwalk, Path.glob() and Path.rglob()

2020-02-06 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : See issue38149. There is an audit for os.scandir(), but it would be useful to have information about higher-level operations. -- components: Library (Lib) messages: 361472 nosy: serhiy.storchaka, steve.dower priority: normal severity: normal

[issue39567] Add audit for os.walk(), os.fwalk(), Path.glob() and Path.rglob()

2020-02-06 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- title: Add audit for os.walk, os.fwalk, Path.glob() and Path.rglob() -> Add audit for os.walk(), os.fwalk(), Path.glob() and Path.rglob() ___ Python tracker <https://bugs.python.org/issu

[issue39567] Add audit for os.walk(), os.fwalk(), Path.glob() and Path.rglob()

2020-02-06 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +17748 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18372 ___ Python tracker <https://bugs.python.org/issu

[issue38149] sys.audit() is called multiple times for glob.glob()

2020-02-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 54b4f14712b9350f11c983f1c8ac47a3716958a7 by Serhiy Storchaka in branch 'master': bpo-38149: Call sys.audit() only once per call for glob.glob(). (GH-18360) https://github.com/python/cpython/commit/54b4f14712b9350f11c983f1c8ac47

[issue38149] sys.audit() is called multiple times for glob.glob()

2020-02-06 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue39573] Make PyObject an opaque structure in the limited C API

2020-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You have merged so much PRs today. What they do? PyObject cannot just be made an opaque structure. The user code reads and writes its fields directly and via macros. This change would break working code. We can encourage the user code to prepare to making

[issue39574] str.__doc__ is misleading

2020-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See a discussion on Python-Dev: https://mail.python.org/archives/list/python-...@python.org/message/YMIGWRUERUG66CKRJXDXNPCIDHRQJY6V/ -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: They cannot. PyObject cannot be const because the code that uses it can change its reference counter even if it does not change any other fields. -- nosy: +serhiy.storchaka ___ Python tracker <ht

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, Py_INCREF and Py_DECREF change the type, and therefore constness. -- ___ Python tracker <https://bugs.python.org/issue39

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Even if the object is not modified currently in common case, it does not guarantee that it cannot be modified in uncommon cases, or that it cannot be modified in future after introducing changes in different files. For example, if names was created by the

[issue39545] await is not supported in f-string in 3.6

2020-02-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Needed also notes in 3.7+. -- resolution: fixed -> stage: resolved -> status: closed -> open versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.6 ___ Python tracker <https://bugs.python.or

[issue39545] await is not supported in f-string in 3.6

2020-02-11 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +17830 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18456 ___ Python tracker <https://bugs.python.org/issu

[issue39545] await is not supported in f-string in 3.6

2020-02-11 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +17833 pull_request: https://github.com/python/cpython/pull/18459 ___ Python tracker <https://bugs.python.org/issue39

[issue39474] col_offset for parenthesized expressions looks weird

2020-02-11 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue39474> ___ ___ Python-bugs-list mailing list Unsub

[issue39474] col_offset for parenthesized expressions looks weird

2020-02-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue39474> ___ ___ Python-bugs-list mailing list Un

[issue39474] col_offset for parenthesized expressions looks weird

2020-02-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +17847 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18477 ___ Python tracker <https://bugs.python.org/issu

[issue39567] Add audit for os.walk(), os.fwalk(), Path.glob() and Path.rglob()

2020-02-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset f4f445b69306c68a2ba8ce8eb8c6cb3064db5fe7 by Serhiy Storchaka in branch 'master': bpo-39567: Add audit for os.walk(), os.fwalk(), Path.glob() and Path.rglob(). (GH-18372) https://github.com/python/cpyt

[issue39219] Fix attributes of syntax errors raized in the tokenizer

2020-02-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 0cc6b5e559b8303b18fdd56c2befd900fe7b5e35 by Serhiy Storchaka in branch 'master': bpo-39219: Fix SyntaxError attributes in the tokenizer. (GH-17828) https://github.com/python/cpython/commit/0cc6b5e559b8303b18fdd56c2befd9

[issue32856] Optimize the `for y in [x]` idiom in comprehensions

2020-02-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 8c579b1cc86053473eb052b76327279476740c9b by Serhiy Storchaka in branch 'master': bpo-32856: Optimize the assignment idiom in comprehensions. (GH-16814) https://github.com/python/cpython/commit/8c579b1cc86053473eb052b7632727

[issue39567] Add audit for os.walk(), os.fwalk(), Path.glob() and Path.rglob()

2020-02-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue32856] Optimize the `for y in [x]` idiom in comprehensions

2020-02-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue39219] Fix attributes of syntax errors raized in the tokenizer

2020-02-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37685] Fix equality checks for some types

2020-02-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Łukasz. I considered this as a bug fix, but was not sure that we should fix these bugs. They were here from the beginning. Josh, as for using total_ordering, I think it is a different issue. I did not want to change the behavior except fixing

[issue39474] col_offset for parenthesized expressions looks weird

2020-02-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 6e619c48b8e804ece9521453fc8da0640a04d5b1 by Serhiy Storchaka in branch 'master': bpo-39474: Fix AST pos for expressions like (a)(b), (a)[b] and (a).b. (GH-18477) https://github.com/python/cpyt

[issue39620] PyObject_GetAttrString and tp_getattr do not agree

2020-02-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It was reverted because it is backward incompatible change. It breaks a code which assigns to the tp_getattr field without explicit type cast to getattrfunc. -- nosy: +serhiy.storchaka ___ Python tracker <ht

[issue39567] Add audit for os.walk(), os.fwalk(), Path.glob() and Path.rglob()

2020-02-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +17873 pull_request: https://github.com/python/cpython/pull/18499 ___ Python tracker <https://bugs.python.org/issue39

[issue39567] Add audit for os.walk(), os.fwalk(), Path.glob() and Path.rglob()

2020-02-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, I did not know about the audit-event directive. Thanks Karthikeyan. As for backporting this to 3.8 I left it on to the RM. -- nosy: +lukasz.langa resolution: fixed -> stage: resolved -> patch review status: closed -

[issue39524] Escape sequences in doc string of ast._pad_whitespace

2020-02-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset fbeba8f2481411d608a616366394e07cdc52e0bb by mpheath in branch 'master': bpo-39524: Fixed doc-string in ast._pad_whitespace (GH-18340) https://github.com/python/cpython/commit/fbeba8f2481411d608a616366394e0

[issue39545] await is not supported in f-string in 3.6

2020-02-14 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6 ___ Python tracker <https://bugs.python.or

[issue39537] Change line number table format

2020-02-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Every bytecode is generated from some AST node which has an associated range of lines. So there should not be bytecodes that have no line number. If for some reasons you generate bytecodes that have no line number, you can just set lineno > end_lineno

[issue32892] Remove specific constant AST types in favor of ast.Constant

2020-02-15 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +17891 pull_request: https://github.com/python/cpython/pull/18514 ___ Python tracker <https://bugs.python.org/issue32

[issue34822] Simplify AST for slices

2020-02-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated the PR. I can obviously be biased about my changes, so I need an approval of other core developer to merge them. I created several PRs to popular third-party projects which work with AST to support both old and new AST schemes

[issue39640] fall back os.fdatasync() to fsync() on POSIX systems without fdatasync() support

2020-02-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: fsync() may be slower than fdatasync(). There may be cases in which you prefer to not call fsync() or call it less often if POSIX fdatasync() is not available. To do this you should know whether Python fdatasync() calls POSIX fdatasync() or fsync(). The

[issue39382] abstract_issubclass() doesn't take bases tuple item ref

2020-02-15 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue39382> ___ ___ Python-bugs-list mailing list Unsub

[issue39382] abstract_issubclass() doesn't take bases tuple item ref

2020-02-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your report and patch. Agree that the code does not look safe. Do you mind to create a pull request? Would be nice to add a test for it. The three references to the Python class are: * the __dict__ descriptor * the __weakref__ descriptor

[issue39644] Add Binary module.

2020-02-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What is binary addition, how it differs from just addition, what type of objects it operates? -- ___ Python tracker <https://bugs.python.org/issue39

[issue39648] Update math.gcd() to accept "n" arguments.

2020-02-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What problems it will create? -- ___ Python tracker <https://bugs.python.org/issue39648> ___ ___ Python-bugs-list mailin

[issue39648] Update math.gcd() to accept "n" arguments.

2020-02-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Should it take variable number of positional arguments or a single iterable argument as max() and min()? What should it return for 0 arguments? -- ___ Python tracker <https://bugs.python.org/issue39

[issue39648] Update math.gcd() to accept "n" arguments.

2020-02-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Python as programming language provides builtin blocks. This is a good example of using functools.reduce(). But if you can provide an algorithm for calculating the GCD and LCM more efficient than sequential applying gcd() and lcm() for two arguments, it

[issue32892] Remove specific constant AST types in favor of ast.Constant

2020-02-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 85a2eef473a2c9ed3ab9c6ee339891fe99adbbc9 by Serhiy Storchaka in branch 'master': bpo-32892: Update the documentation for handling constants in AST. (GH-18514) https://github.com/python/cpython/commit/85a2eef473a2c9ed3ab9c6ee339891

[issue39665] Cryptic error message when creating types that don't include themselves in their MRO

2020-02-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, I got the same error message when tried to get such class. super() is called implicitly by the type constructor to call __init_subclass__ on the parent of a newly generated type. -- nosy: +serhiy.storchaka

[issue39677] 3.6+ documentation for MAKE_FUNCTION

2020-02-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Agree. Do you want to provide a PR? Although it may be too later for 3.6 which only takes security fixes. -- keywords: +easy nosy: +serhiy.storchaka stage: -> needs patch versions: +Python 3.7, Python 3.8, Python

[issue34822] Simplify AST for slices

2020-02-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: No, this PR does not change the Python syntax. It only changes the AST representation. -- ___ Python tracker <https://bugs.python.org/issue34

[issue39687] re.sub behaves inconsistent between versions with * repetition qualifier

2020-02-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is correct and documented behavior. ".*" matches two substrings: the whole string "bc" and an empty string at the end of the string. See https://docs.python.org/3/library/re.html#re.sub and https://docs.python.org/3/whatsnew/3.7

[issue39690] Compiler warnings in unicodeobject.c

2020-02-19 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Objects/clinic/unicodeobject.c.h: In function ‘unicode_isidentifier’: Objects/unicodeobject.c:12245:22: warning: ‘wstr’ may be used uninitialized in this function [-Wmaybe-uninitialized] ch = wstr[i]; ^~~ Objects

[issue39694] Incorrect dictionary unpacking when calling str.format

2020-02-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See similar issue for SimpleNamespace: https://bugs.python.org/issue31655. We should add a similar check in str.format(). Accepting a non-string keys is an implementation detail. There is no guarantee that it works in other implementations. It should not

[issue39715] Implement __repr__ methods for AST classes

2020-02-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For more informative representation you can use ast.dump(). -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue39

[issue39648] Update math.gcd() to accept "n" arguments.

2020-02-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, Ananthakrishnan, but I think this problem is too difficult to you. Adding math.lcm() taken 2 weeks and produced 200 messages. It is simpler to implement this feature myself to me. -- ___ Python tracker

[issue39648] Update math.gcd() to accept "n" arguments.

2020-02-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +17970 pull_request: https://github.com/python/cpython/pull/18604 ___ Python tracker <https://bugs.python.org/issue39

[issue39648] Update math.gcd() to accept "n" arguments.

2020-02-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm always ready to help a beginner, but this is the first time that it takes so much effort. It would be easier if you started with the simple problems you could handle. Even in simple cases you would be able to get tips that you can understan

[issue39648] Expand math.gcd() and math.lcm() to accept multiple arguments

2020-02-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If expand math.gcd() to accept multiple arguments, it is worth to do the same with math.lcm(). -- title: Update math.gcd() to accept "n" arguments. -> Expand math.gcd() and math.lcm() to accept multi

[issue39382] abstract_issubclass() doesn't take bases tuple item ref

2020-02-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 1c56f8ffad44478b4214a2bf8eb7cf51c28a347a by Yonatan Goldschmidt in branch 'master': bpo-39382: Avoid dangling object use in abstract_issubclass() (GH-18530) https://github.com/python/cpython/commit/1c56f8ffad44478b4214a2bf8eb7cf

[issue39382] abstract_issubclass() doesn't take bases tuple item ref

2020-02-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue39725] unrelated `from None` exceptions lose prior exception information

2020-02-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Interesting problem. Example which does not depend on os.environ: import traceback try: try: raise TypeError except: try: raise ValueError except: raise KeyError from None except BaseException as exc

[issue39725] unrelated `from None` exceptions lose prior exception information

2020-02-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For reference: PEP 3134 (and superseded PEP 344), PEP 409, PEP 415. -- ___ Python tracker <https://bugs.python.org/issue39

[issue39725] unrelated `from None` exceptions lose prior exception information

2020-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is more complicated. In the following example try: try: raise TypeError except: try: try: raise OverflowError except: raise ValueError except: raise

[issue39019] Missing class getitems in standard library classes

2020-02-23 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka nosy_count: 4.0 -> 5.0 pull_requests: +17994 pull_request: https://github.com/python/cpython/pull/18629 ___ Python tracker <https://bugs.python.org/issu

[issue39732] plistlib should export UIDs in XML like Apple does

2020-02-23 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +ned.deily, ronaldoussoren ___ Python tracker <https://bugs.python.org/issue39732> ___ ___ Python-bugs-list mailin

[issue39725] unrelated `from None` exceptions lose prior exception information

2020-02-23 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +17996 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18629 ___ Python tracker <https://bugs.python.org/issu

[issue39019] Missing class getitems in standard library classes

2020-02-23 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: -17994 ___ Python tracker <https://bugs.python.org/issue39019> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2020-02-25 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue38913> ___ ___ Python-bugs-list mailing list Unsub

[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2020-02-25 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +18017 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18656 ___ Python tracker <https://bugs.python.org/issu

[issue39737] Speed up list.__eq__ by about 6%

2020-02-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have doubts that such small change can lead to significant speed up. It is likely a compiler glitch. But this change makes the code clearer. If you remove a NEWS entry with a doubtful promise I will accept it

[issue39750] UnicodeError becomes unpicklable if data is appended to args

2020-02-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, this is how exceptions are pickled. You save an information which which allows you to recreate the exception. If you fake args, you do not able to recreate it. Just do not do this. -- nosy: +serhiy.storchaka

<    20   21   22   23   24   25   26   27   28   29   >