[issue40126] Incorrect error handling in unittest.mock

2020-04-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 4057e8f9b56789223a1e691d7601003aceb84ad1 by Serhiy Storchaka in branch '3.7': [3.7] bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) (GH-19484) https://github.com/python/cpyt

[issue40126] Incorrect error handling in unittest.mock

2020-04-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ee249d798ba08f065efbf4f450880a446c6ca49d by Serhiy Storchaka in branch '3.8': [3.8] bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) (GH-19483) https://github.com/python/cpyt

[issue40126] Incorrect error handling in unittest.mock

2020-04-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 3.5 and 3.6 are in security fixes only mode, and this issue is not a security issue. After merging PR 19484 I cannot reproduce the original issue anymore. I left this issue open for the case if I find a way to write tests for the merged changes

[issue39943] Meta: Clean up various issues in C internals

2020-04-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 8f87eefe7f0576c05c488874eb9601a7a87c7312 by Serhiy Storchaka in branch 'master': bpo-39943: Add the const qualifier to pointers on non-mutable PyBytes data. (GH-19472) https://github.com/python/cpyt

[issue40269] Inconsistent complex behavior with (-1j)

2020-04-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is a known issue, but I have no references to previous discussions. Outputting numbers with decimal point will not help in case of complex(-0.0, 1.0). Maybe the only way to solve this problem is to implement special Imaginary type (as a subclass of

[issue39481] Implement PEP 585 (Type Hinting Generics In Standard Collections)

2020-04-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I tested the following example: import ipaddress, mmap x: ipaddress.IPv4Network[int] y: mmap.mmap[int] MyPy produces errors: t.py:4: error: "IPv4Network" expects no type arguments, but 1 given t.py:5: error: "mmap" expects no type ar

[issue40269] Inconsistent complex behavior with (-1j)

2020-04-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The Imaginary type could help to solve other "gotchas". For example, in Python >>> complex(0, float('inf')) * 1 (nan+infj) But in C++ you will get the real component 0, because multiplication of complex and real numbers

[issue40271] Allow shell like paths in

2020-04-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: How would you work with a file in the "~" directory? Python is a programming language. It provides you builtin blocks which you can combine to get the desired behavior. If you what "~" at the start of the path be expanded to your home

[issue39481] Implement PEP 585 (Type Hinting Generics In Standard Collections)

2020-04-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: No, I did not check other changes. These two just looked too suspicious. -- ___ Python tracker <https://bugs.python.org/issue39

[issue40257] Improve the use of __doc__ in pydoc

2020-04-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, of course. And if it overrides some methods, but do not specify doctrings for new methods, they will be inherited from the parent class. class A: """Base class""" def foo(self): """Some docst

[issue39943] Meta: Clean up various issues in C internals

2020-04-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, it is a consequence of PR 19345. But it looks like a compiler bug. It complains about implicit conversion from `const void **` to `void *` in memcpy() and PyMem_Del(). -- ___ Python tracker <ht

[issue40280] Consider supporting emscripten/webassembly as a build target

2020-04-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Do you want to provide a pull request? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue40

[issue40282] random.getrandbits(0) should succeed

2020-04-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Seconded. And I wish to add the getrandbytes() method. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue40

[issue40282] random.getrandbits(0) should succeed

2020-04-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I do not want to open an issue if I know that the idea will be rejected. -- ___ Python tracker <https://bugs.python.org/issue40

[issue40292] Memory leak when defining a new class inside a loop

2020-04-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is not a leak. It is expected behavior when you call gc.set_debug(gc.DEBUG_SAVEALL). -- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracke

[issue40286] Add getrandbytes() method to random.Random

2020-04-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Maybe randbytes()? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue40286> ___ ___ Python-bug

[issue40286] Add randbytes() method to random.Random

2020-04-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: All Random methods give the same result independently of endianess and bitness of the platform. > I don't think that these two implementations give the same result on big and > little endian. The seco

[issue40257] Improve the use of __doc__ in pydoc

2020-04-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset fbf2786c4c89430e2067016603078cf3500cfe94 by Serhiy Storchaka in branch 'master': bpo-40257: Output object's own docstring in pydoc (GH-19479) https://github.com/python/cpython/commit/fbf2786c4c89430e206701660

[issue40257] Improve the use of __doc__ in pydoc

2020-04-15 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +18892 pull_request: https://github.com/python/cpython/pull/19546 ___ Python tracker <https://bugs.python.org/issue40

[issue40296] help(list[int]) fails

2020-04-15 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : >>> help(list[int]) Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/_sitebuiltins.py", line 103, in __call__ return pydoc.help(*args, **kwds) File "/home/serhiy/py/cp

[issue40295] doctest handling of multiline strings is broken

2020-04-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Did you try to run the tested function in the interactive Python interpreter? Did you get what you expected? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue40

[issue40296] help(list[int]) fails

2020-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The problem is that isinstance(list[int], type) returns True, but list[int] is not actually an instance of type. >>> isinstance(list[int], type) True >>> issubclass(type(list[int]), type) False >>> type.__subclasses__(list[int])

[issue40298] Type annotation objects (Tuple, List, etc.) register as callable()

2020-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is not a bug. Tuple is a callable, but calling it raises a TypeError with the informative error message. It does not differ from e.g. >>> def foo(): ... raise TypeError("don't call foo()") ... >>> callable(fo

[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2020-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The former implementation was wrong. See issue25054 which contains more obvious examples of that bug: >>> re.sub(r"\b|:+", "-", "a::bc") '-a-:-bc-' Not all colons were replaced desp

[issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub()

2020-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If the behavior is obviously wrong (like in issue25054), we can fix it without warnings, and even backport the fix to older versions, because we do not expect that anybody depends on such weird behavior. If we are going to change the behavior, but expect

[issue40271] Allow shell like paths in

2020-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If add such option to zipfile.is_zipfile(), why not add it to other functions? There are many tens or hundreds of functions and methods in the stdlib which accept a file path. Adding such option to all of them is not practical. And zipfile.is_zipfile

[issue40286] Add randbytes() method to random.Random

2020-04-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +18914 pull_request: https://github.com/python/cpython/pull/19574 ___ Python tracker <https://bugs.python.org/issue40

[issue40286] Add randbytes() method to random.Random

2020-04-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 223221b290db00ca1042c77103efcbc072f29c90 by Serhiy Storchaka in branch 'master': bpo-40286: Makes simpler the relation between randbytes() and getrandbits() (GH-19574) https://github.com/python/cpyt

[issue40315] Incorrect stacksize in code object

2020-04-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The stack size is correct. The unreachable code is left because some code (in particularly the lineno setter of the frame object) depends on instructions which may be in the unreachable code to determines the boundaries of programming blocks. It is safer

[issue40301] zipfile module: new feature (two lines of code), useful for test, security and forensics

2020-04-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am not sure it would help you. There are legitimate files which contain a payload followed by the ZIP archive (self-extracting archives, programs with embedded ZIP archives). And the malware can make the offset of the ZIP archive be zero. If you want

[issue40301] zipfile module: new feature (two lines of code), useful for test, security and forensics

2020-04-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Just check the first 4 bytes of the file. In "normal" ZIP archive they are b'PK\3\4' (or b'PK\5\6' if it is empty). It is so reliable as checking the offset, and more efficient. It is even more reliable, because a malware can

[issue40257] Improve the use of __doc__ in pydoc

2020-04-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 7e64414f57b70dc5bc0ab19a3162a0735f9bfabf by Serhiy Storchaka in branch 'master': bpo-40257: Improve help for the typing module (GH-19546) https://github.com/python/cpython/commit/7e64414f57b70dc5bc0ab19a3162a0

[issue40257] Improve the use of __doc__ in pydoc

2020-04-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Some work is still needed for HTML output. But this code is so different from the code for plain text output and so complicated that I was afraid to break something. I'll rewrite it in separate issue. -- resolution: -> fixed stage: patc

[issue40179] Argument Clinic incorretly translates #elif

2020-04-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 12446e6a605f066d837d3a595d0a73e4f3b43b65 by Serhiy Storchaka in branch 'master': bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) https://github.com/python/cpython/commit/12446e6a605f066d837d3a595d0a73

[issue40179] Argument Clinic incorretly translates #elif

2020-04-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +18920 pull_request: https://github.com/python/cpython/pull/19583 ___ Python tracker <https://bugs.python.org/issue40

[issue40179] Argument Clinic incorretly translates #elif

2020-04-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +18921 pull_request: https://github.com/python/cpython/pull/19584 ___ Python tracker <https://bugs.python.org/issue40

[issue40179] Argument Clinic incorretly translates #elif

2020-04-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset bfda4db0d2c05eef4e4ae90d899d0b67cb2e33e5 by Serhiy Storchaka in branch '3.8': [3.8] bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) (GH-19583) https://github.com/python/cpyt

[issue40179] Argument Clinic incorretly translates #elif

2020-04-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 67ae454da749a7ca67115b43205d9fe98bea3213 by Serhiy Storchaka in branch '3.7': [3.7] bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) (GH-19584) https://github.com/python/cpyt

[issue40179] Argument Clinic incorretly translates #elif

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

[issue40178] Convert the remaining os funtions to Argument Clinic

2020-04-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 2b5603140c09766a7d4e8243a70d7144f684f6f9 by Serhiy Storchaka in branch 'master': bpo-40178: Convert the remaining os functions to Argument Clinic. (GH-19360) https://github.com/python/cpython/commit/2b5603140c09766a7d4e8243a70d71

[issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings

2020-04-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +18924 pull_request: https://github.com/python/cpython/pull/19587 ___ Python tracker <https://bugs.python.org/issue35

[issue40326] A string contains an empty string?

2020-04-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, it is. -- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue22548] Bogus parsing of negative zeros in complex literals

2020-04-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka nosy_count: 3.0 -> 4.0 pull_requests: +18927 pull_request: https://github.com/python/cpython/pull/19593 ___ Python tracker <https://bugs.python.org/issu

[issue40269] Inconsistent complex behavior with (-1j)

2020-04-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +18928 pull_request: https://github.com/python/cpython/pull/19593 ___ Python tracker <https://bugs.python.org/issue40

[issue40269] Inconsistent complex behavior with (-1j)

2020-04-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I tried to make repr of floats producing a string which rounds up with eval() (see PR 19593). >>> complex(0.0, 1.0) 1j >>> complex(0.0, -1.0) (0-1j) >>> complex(-0.0, 1.0) -(0-1j) >>> complex(-0.0, -1.0) (-0.0-1j) >

[issue22548] Bogus parsing of negative zeros in complex literals

2020-04-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: -18927 ___ Python tracker <https://bugs.python.org/issue22548> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40275] test.support has way too many imports

2020-04-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: +1 for splitting test.support on several submodules! Some imports can also be lazy. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue40

[issue40275] test.support has way too many imports

2020-04-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: asyncio is now imported in unittest. Removing direct import from test.support does not help. -- ___ Python tracker <https://bugs.python.org/issue40

[issue40275] test.support has way too many imports

2020-04-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: logging is also imported in unittest and indirectly in asyncio. -- ___ Python tracker <https://bugs.python.org/issue40

[issue40275] test.support has way too many imports

2020-04-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +18936 pull_request: https://github.com/python/cpython/pull/19600 ___ Python tracker <https://bugs.python.org/issue40

[issue40275] test.support has way too many imports

2020-04-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +18937 pull_request: https://github.com/python/cpython/pull/19601 ___ Python tracker <https://bugs.python.org/issue40

[issue40275] test.support has way too many imports

2020-04-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +18939 pull_request: https://github.com/python/cpython/pull/19603 ___ Python tracker <https://bugs.python.org/issue40

[issue40275] test.support has way too many imports

2020-04-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: These three PRs combined reduce the number of imported modules from 179 to 105 (not including 24 modules imported by the bare interpreter) and reduce the hot import time from 160 ms to 80 ms. -- ___ Python

[issue40328] Add tools for generating mappings_XX.h

2020-04-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- components: +Demos and Tools nosy: +hyeshik.chang, serhiy.storchaka versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue40

[issue40329] Faulty dict arg gives ValueError but mostly TypeError

2020-04-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is all correct. Note that set is unordered, so "element #0" can be 1, and can be "one". If it is 1, you get a type error. If it is "one", which is a sequence with length 3, you get a value error. -- nosy: +serhiy.s

[issue40275] test.support has way too many imports

2020-04-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I used -X importtime. Your benchmark measures the performance of look up in sys.modules. -- ___ Python tracker <https://bugs.python.org/issue40

[issue40335] Regression in multiline SyntaxError offsets

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

[issue40275] test.support has way too many imports

2020-04-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Reducing the import time is not a goal, it is just a measurable side effect. The goal is to reduce the number of imported modules unneeded for the particular test. Importing every module can have side effects which affects the tested behavior. It would be

[issue40332] RegEx for numbers in documentation (easy fix - solution provided)

2020-04-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Mark. It is just an example. The regular expression which would support all possible forms of numbers (including exponent, underscores, non-decimal numbers) would be more complex and would distract from the main goal of the example

[issue40336] Refactor typing._SpecialForm

2020-04-20 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The proposed PR refactors the implementation of typing._SpecialForm. Different special forms are different by name, docstring, and the behavior of __getitem__. Instead of special casing by name in __getitem__, instances are now parametrized by the

[issue40336] Refactor typing._SpecialForm

2020-04-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +18950 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19620 ___ Python tracker <https://bugs.python.org/issu

[issue40327] list(sys.modules.items()) can throw RuntimeError: dictionary changed size during iteration

2020-04-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I afraid that this is a part of the larger issue (see also issue31165). Seems the cause is that the GIL can be released when allocate or reallocate the memory. Does your project use some memory managing hooks? Using sys.modules.copy().items() can help a

[issue40349] Python3.9 changes col_offset for some ast nodes

2020-04-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: col_offset = 0 is the correct value. There was a bug which is fixed now (see issue39474). -- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed ___ Pytho

[issue40286] Add randbytes() method to random.Random

2020-04-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: $ ./python -m timeit -s 'import random' 'random.randbytes(10**6)' 200 loops, best of 5: 1.36 msec per loop $ ./python -m timeit -s 'import random' 'random.getrandbits(10**6*8).to_bytes(10**6, "little")' 5

[issue40352] SocketHandler silently drops log messages on re-connect

2020-04-21 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +vinay.sajip ___ Python tracker <https://bugs.python.org/issue40352> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40346] Redesign random.Random class inheritance

2020-04-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It may be time to start emitting a warning if a Random subclass overrides random() but not getrandbits() or vice versa. If you only override random(), methods which rely on generating random integers will use worse algorithm (slightly less uniform). If

[issue40353] Add an optional "strict" check to zip

2020-04-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It would be better to implement it as a separate function. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue40

[issue40353] Add an optional "strict" check to zip

2020-04-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Also you can just get a ready implementation from more-tertools. -- ___ Python tracker <https://bugs.python.org/issue40

[issue40352] SocketHandler silently drops log messages on re-connect

2020-04-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If sending log messages is not guaranteed, we could use UDP. But when we use TCP it is expected that log messages will not be lost. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.

[issue40369] Use PEP 590 vectorcall to speed up GenericAlias.

2020-04-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have doubts that GenericAlias instances are created in mass in tight loops. Do you have any realistic example which would benefit from speeding up creation of GenericAlias instances? -- nosy: +serhiy.storchaka

[issue40369] Use PEP 590 vectorcall to speed up GenericAlias.

2020-04-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And how much faster has your example become? -- ___ Python tracker <https://bugs.python.org/issue40369> ___ ___ Python-bug

[issue40217] The garbage collector doesn't take in account that objects of heap allocated types hold a strong reference to their type

2020-04-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I do not think it is right. Please wait, I'll submit an alternate solution. -- ___ Python tracker <https://bugs.python.org/is

[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: $ make -s regen-all ./Include/opcode.h.new regenerated from ./Lib/opcode.py Jump table written into ./Python/opcode_targets.h.new Traceback (most recent call last): File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main

[issue40336] Refactor typing._SpecialForm

2020-04-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 40ded947f82683f0ed08144599a83d3a1ce719eb by Serhiy Storchaka in branch 'master': bpo-40336: Refactor typing._SpecialForm (GH-19620) https://github.com/python/cpython/commit/40ded947f82683f0ed08144599a83d

[issue40336] Refactor typing._SpecialForm

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

[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It does not work with python3.8 either. $ make -s regen-all PYTHON_FOR_REGEN=python3.8 ./Include/opcode.h.new regenerated from ./Lib/opcode.py Jump table written into ./Python/opcode_targets.h.new Traceback (most recent call last): File "/us

[issue40381] plistlib doesn't handle poorly-formatted plists

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

[issue40378] ast.parse fails to trigger SyntaxWarning that normal execution does

2020-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is not a bug. Execution includes more stages than ast.parse(). -- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bug

[issue40378] ast.parse fails to trigger SyntaxWarning that normal execution does

2020-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Compilation includes the following stages: 1. Tokenizing. 2. Creating CST (concrete syntax tree). 3. Creating AST (abstract syntax tree). 4. Optimizing AST. 5. Building symtable. 6. Generating bytecode. 7. Optimizing bytecode. ast.parse() only includes

[issue40275] test.support has way too many imports

2020-04-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 3c8a5b459d68b4337776ada1e04f5b33f90a2275 by Serhiy Storchaka in branch 'master': bpo-40275: Avoid importing asyncio in test.support (GH-19600) https://github.com/python/cpython/commit/3c8a5b459d68b4337776ada1e04f5b

[issue40275] test.support has way too many imports

2020-04-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 16994912c93e8e5db7365d48b75d67d3f70dd7b2 by Serhiy Storchaka in branch 'master': bpo-40275: Avoid importing socket in test.support (GH-19603) https://github.com/python/cpython/commit/16994912c93e8e5db7365d48b75d67

[issue40275] test.support has way too many imports

2020-04-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 515fce4fc4bb0d2db97b17df275cf90640017f56 by Serhiy Storchaka in branch 'master': bpo-40275: Avoid importing logging in test.support (GH-19601) https://github.com/python/cpython/commit/515fce4fc4bb0d2db97b17df275cf9

[issue40275] test.support has way too many imports

2020-04-25 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +19033 pull_request: https://github.com/python/cpython/pull/19711 ___ Python tracker <https://bugs.python.org/issue40

[issue15185] Validate callbacks in 'contextlib.ExitStack.callback()'

2020-04-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it is rather a work for linter's and static type checking. Runtime check adds an overhead, and it is expected that in correct program it will always pass. You need the check only while write the program, it may help in debugging. But once i

[issue40396] Support GenericAlias in typing

2020-04-26 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Currently typing functions get_origin(), get_args() and get_type_hints() do not support GenericAlias. >>> from typing import * >>> get_origin(List[int]) >>> get_origin(list[int]) >>> get_args(List[int]) (,) >>&g

[issue40396] Support GenericAlias in typing

2020-04-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +19039 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19718 ___ Python tracker <https://bugs.python.org/issu

[issue40397] Refactor typing._GenericAlias

2020-04-26 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : typing._GenericAlias represents two different types: user defined (like List[int]) and special (like List). They have different behavior, and common methods contain special cases. The proposed PR rewrites the implementation in more object-oriented

[issue40397] Refactor typing._GenericAlias

2020-04-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +19040 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19719 ___ Python tracker <https://bugs.python.org/issu

[issue40398] get_args(Callable) fails

2020-04-26 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : >>> from typing import * >>> get_args(Callable) Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/typing.py", line 1412, in get_args if get_origin(tp) is collections.a

[issue40396] Support GenericAlias in typing

2020-04-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 68b352a6982f51e19bf9b9f4ae61b34f5864d131 by Serhiy Storchaka in branch 'master': bpo-40396: Support GenericAlias in the typing functions. (GH-19718) https://github.com/python/cpython/commit/68b352a6982f51e19bf9b9f4ae61b3

[issue40398] get_args(Callable) fails

2020-04-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: get_args(List) == (T,) -- ___ Python tracker <https://bugs.python.org/issue40398> ___ ___ Python-bugs-list mailing list Unsub

[issue40398] get_args(Callable) fails

2020-04-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +19042 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19720 ___ Python tracker <https://bugs.python.org/issu

[issue40396] Support GenericAlias in typing

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

[issue40398] get_args(Callable) fails

2020-04-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 6292be7adf247589bbf03524f8883cb4cb61f3e9 by Serhiy Storchaka in branch 'master': bpo-40398: Fix typing.get_args() for special generic aliases. (GH-19720) https://github.com/python/cpython/commit/6292be7adf247589bbf03524f8883c

[issue40408] GenericAlias does not support nested type variables

2020-04-27 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : While trying to replace typing._GenericAlias with GenericAlias I have found that the latter does not support nested type variables. >>> from typing import * >>> T = TypeVar('T') >>> X = List[List[T]] >>>

[issue40334] PEP 617: new PEG-based parser

2020-04-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The parser generator imports modules token and tokenize. It is not correct, because they are relevant to the Python version used to run the parser generator, and not to the Python version for which the parser is generated. It works currently only because

[issue40414] Incorrect mouse and keyboard mapping

2020-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: On which platform and Python version they were mapped to keyboard number buttons? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue40

[issue40408] GenericAlias does not support nested type variables

2020-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Not yet. If you don't prefer to fix it yourself, I'll do it as soon as I have time. -- ___ Python tracker <https://bugs.python.o

[issue40246] Different error messages for same error - invalid string prefixes

2020-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > It's no different from other edge cases where for some reason the space seems > optional, like `1and 2`. The parser is not consistent here. `0or[]` is an error, while `0and[]` and `1or[]` are valid. See https://mail.python.org/archives/

[issue40334] PEP 617: new PEG-based parser

2020-04-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +19109 pull_request: https://github.com/python/cpython/pull/19786 ___ Python tracker <https://bugs.python.org/issue40

<    24   25   26   27   28   29   30   31   32   33   >