[issue43153] tempfile seems to treat a file as a directory when processing an exception in the onerror()

2021-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree with Andrei. I'll test this approach on Windows. -- ___ Python tracker <https://bugs.python.org/issue43153> ___ ___

[issue45944] Avoid calling isatty() for most open() calls

2021-12-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +benjamin.peterson, pitrou, stutzbach versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue45

[issue45944] Avoid calling isatty() for most open() calls

2021-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What if change FileIO.isatty() instead? If make it returning False without invoking a system call if the file size is non-zero it will eliminate the need to expose _size. -- nosy: +serhiy.storchaka ___ Python

[issue41270] NamedTemporaryFile is not its own iterator.

2021-11-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Biopython uses next() without iter(), and there is no guarantee that it should work. -- nosy: +brett.cannon, pitrou, serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue41

[issue44884] logging Formatter behavior when using msecs and braces : '{'

2021-11-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +vinay.sajip ___ Python tracker <https://bugs.python.org/issue44884> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13236] unittest needs more flush calls

2021-11-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I do not remember details, but I encountered this issue (maybe when run tests in subprocesses?). -- ___ Python tracker <https://bugs.python.org/issue13

[issue13236] unittest needs more flush calls

2021-11-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.10, Python 3.9 ___ Python tracker <https://bugs.python.org/issue13236> ___ ___ Python-bugs-list mailin

[issue13236] unittest needs more flush calls

2021-11-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch nosy: +serhiy.storchaka nosy_count: 7.0 -> 8.0 pull_requests: +28091 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/29864 ___ Python tracker

[issue45739] The Python implementation of Decimal does not support the "N" format

2021-11-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You are right about an uppercase converter. I forget this. I withdraw this proposition. It seems that even if we add support of "N" to all numeric formatting it will not cover all use cases. "n" is a locale specific variant of &qu

[issue45922] Many method, function, built-in... are not clickable and should be

2021-11-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is a good idea in general. Please go ahead, I am sure that the PR will be accepted. But keep in mind that not always additional links make the documentation better. The rule of tumb is to not add multiple links to the same entity in one paragraph

[issue45739] The Python implementation of Decimal does not support the "N" format

2021-11-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have no strong opinion. I found the discrepancy when reviewed one of Mark's PRs. I was surprised because I did not know that "N" is supported. On other hand, there are reasons for supporting upper-case variant of "n" if we support

[issue45911] SystemError occured while running an extention

2021-11-28 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue24040] plistlib assumes dict_type is descendent of dict

2021-11-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The patch LGTM, and I have nothing to add. Ronald, do you mind to create a PR. -- assignee: -> ronaldoussoren nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issu

[issue45902] Bytes and bytesarrays can be sorted with a much faster count sort.

2021-11-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Raymond. It is difficult to find any use case for sorting bytes objects (I cannot find any). As for using radix sort in list.sort() in special case of small integer keys, it is difficult to implement, because we should preserve the initial

[issue45908] dict.fromkeys insertion order

2021-11-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What else can it be? dict.fromkeys() adds keys in the order of obtaining them, and it obtains them by iterating its argument. If we need a special note here, we need a special note for list(), tuple(), filter(), enumerate() and all other functions which

[issue45907] Optimize literal comparisons and contains

2021-11-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > It doesn't seem to make sense why other operations on literals are optimized > but these particular ones aren't optimized (much). The existing optimizer optimizes the following cases (note that the parser does not produce negative or complex n

[issue45894] exception lost when loop.stop() in finally

2021-11-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is not related to loop.stop() and asyncio in general. It is the return statement which eats the exception. Simpler example: >>> def f(): ... try: ... 1/0 ... finally: ... return 42 ... >>> f() 42 Retu

[issue45878] Use `self.assertRaises` instead of `try/except` in `ctypes/test_functions.py::test_mro`

2021-11-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b48ac6fe38b2fca9963b097c04cdecfc6083104e by Nikita Sobolev in branch 'main': bpo-45878: convert `try/except` to `self.assertRaises` in `Lib/ctypes/test/test_functions.py` (GH-29721) https://github.com/python/cpython/commit

[issue22067] time_test fails after strptime()

2021-11-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, it was 2.7-only issue. Thank you Irit for checking and closing outdated issues. -- resolution: works for me -> out of date stage: -> resolved status: pending -> closed ___ Python tracke

[issue45843] Optimizing constant comparisons/contains

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

[issue45865] Old syntax in unittest

2021-11-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Concur with Eric. -- nosy: +serhiy.storchaka resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue45509] Gzip header corruption not properly checked.

2021-11-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it is good idea, although we may get reports about regressions in 3.11 when Python will start to reject GZIP files which was successfully read before. But before merging this I want to know: 1. How much overhead does it add for reading files

[issue45853] Misspelled _IGNORED_ERROS in Lib/pathlib.py

2021-11-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: BTW, is not the correct name _IGNORED_ERRNOS? -- ___ Python tracker <https://bugs.python.org/issue45853> ___ ___ Python-bug

[issue45853] Misspelled _IGNORED_ERROS in Lib/pathlib.py

2021-11-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If it is only used in a single place in the module would not be better to inline it? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue45

[issue45846] Incorrect name capitalisation in faq/programming

2021-11-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your report and PR JMcB. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue45843] Optimizing LOAD_CONST followed by COMPARE_OP (or IS_OP)

2021-11-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Why anybody needs to write 255581293 > 12938373? We try to keep the compiler code maintenable and only implement optimizations which have the largest effect. PR 29639 adds around 200 lines of complex code and I do not see the bene

[issue45832] Misleading membersip expression documentation

2021-11-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think there is a bug in either numpy.timedelta64.__hash__ or panda.Timedelta.__hash__. Please report it to corresponding libraries. It is not related to the documentation of membership test. If you have different hashes for equal objects most dict

[issue45846] Incorrect name capitalisation in faq/programming

2021-11-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset bc2bc0dbdb52498d009f9f9771452e6aa4faff2b by JMcB in branch 'main': bpo-45846: Fix capitalisation of Van Rossum at the start of sentence (GH-29641) https://github.com/python/cpython/commit/bc2bc0dbdb52498d009f9f9771452e6aa4faff2b

[issue45846] Incorrect name capitalisation in faq/programming

2021-11-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: But in this case it starts a sentence. -- nosy: +gvanrossum, serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue45

[issue45791] __instancecheck__ being checked on type(cls) instead of cls

2021-11-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: All typing related tests are fixed by updating types.GenericAlias.__getattribute__. So the only thing is left to make all tests passed is removing some special methods tests. The lookup of __instancecheck__ and __subclasscheck__ was changed by Benjamin

[issue45791] __instancecheck__ being checked on type(cls) instead of cls

2021-11-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Most of failed tests are related to typing, but there is a purposed test for __instancecheck__ and __subclasscheck__ bypassing __getattr__ and __getattribute__ (test.test_descr.ClassPropertiesAndMethods.test_special_method_lookup

[issue45791] __instancecheck__ being checked on type(cls) instead of cls

2021-11-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Failed tests: == FAIL: test_isinstance_with_or_union (test.test_isinstance.TestIsInstanceIsSubclass) -- Traceback (most

[issue45791] __instancecheck__ being checked on type(cls) instead of cls

2021-11-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +27789 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29540 ___ Python tracker <https://bugs.python.org/issu

[issue37295] Possible optimizations for math.comb()

2021-11-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.11 -Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue37295> ___ ___ Python-bugs-list m

[issue45791] __instancecheck__ being checked of type(cls) instead of cls

2021-11-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think that the code is correct, and the documentation is not complete. As in most (but not all) cases of dunder methods it is looked up in a class, ignoring instance attributes. -- nosy: +serhiy.storchaka

[issue23041] csv needs more quoting rules

2021-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The quoting style affects not only the CSV formatting, but also the CSV parsing. How QUOTE_NOTNULL and QUOTE_STRINGS will affect parsing? -- ___ Python tracker <https://bugs.python.org/issue23

[issue45754] [sqlite3] SQLITE_LIMIT_LENGTH is incorrectly used to check statement length

2021-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In alternative 1 we control the type and the message of exception. In alternative 3 we left this to the SQLite3 engine. It is difficult to keep consistency in alternative 2, errors raised for sizes less and larger than INT_MAX can be different. I think

[issue45739] The Python implementation of Decimal does not support the "N" format

2021-11-06 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The C implementation supports both formats "n" and "N". The Python implementation only supports format "n". >>> from decimal import Decimal >>> format(Decimal('1e100'), 'n') '1e+100' >>> format(D

[issue45708] PEP 515-style formatting with underscores does not seem to work for Decimal

2021-11-06 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: duplicate -> stage: resolved -> status: closed -> open superseder: Add underscore as a decimal separator for string formatting -> ___ Python tracker <https://bugs.python

[issue45735] Promise the long-time truth that `args=list` works

2021-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is a difference if you modify the arguments list after creating a thread. args = [1] t = threading.Thread(target=access, args=args) args[0] = 2 t.start() Would it call access(1) or access(2)? -- nosy: +serhiy.storchaka

[issue45243] [sqlite3] add support for changing connection limits

2021-11-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 3d42cd9461e60c7427f3793f640cd975fbd99289 by Erlend Egeberg Aasland in branch 'main': bpo-45243: Use connection limits to simplify `sqlite3` tests (GH-29356) https://github.com/python/cpython/commit/3d42cd9461e60c7427f3793f640cd975fbd99289

[issue27313] test case failures in test_widgets.ComboboxTest.of test_ttk_guionly on OS X with Cocoa Tk 8.5.18

2021-11-05 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +27682 pull_request: https://github.com/python/cpython/pull/29425 ___ Python tracker <https://bugs.python.org/issue27

[issue45160] ttk.OptionMenu radiobuttons change variable value twice

2021-11-05 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +27681 pull_request: https://github.com/python/cpython/pull/29425 ___ Python tracker <https://bugs.python.org/issue45

[issue27313] test case failures in test_widgets.ComboboxTest.of test_ttk_guionly on OS X with Cocoa Tk 8.5.18

2021-11-05 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: -27678 ___ Python tracker <https://bugs.python.org/issue27313> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45708] PEP 515-style formatting with underscores does not seem to work for Decimal

2021-11-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a duplicate of issue43624. It was also discussed in Discuss. -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Add underscore as a decimal separator for strin

[issue27313] test case failures in test_widgets.ComboboxTest.of test_ttk_guionly on OS X with Cocoa Tk 8.5.18

2021-11-05 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +27678 pull_request: https://github.com/python/cpython/pull/29425 ___ Python tracker <https://bugs.python.org/issue27

[issue45672] Mutation tests results of typing.py

2021-11-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The tests are passed because this modification does not affect behavior, it just makes the code slightly less efficient. Replacing i+1 with i just adds one iteration: b = bases[i] # == self if isinstance(b, _BaseGenericAlias) and b is not self

[issue45697] PyType_IsSubtype is doing excessive work in the common case

2021-11-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Itamar. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue45697] PyType_IsSubtype is doing excessive work in the common case

2021-11-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 2c045bd5673d56c3fdde7536da9df1c7d6f270f0 by Itamar Ostricher in branch 'main': bpo-45697: Use PyObject_TypeCheck in type_call (GH-29392) https://github.com/python/cpython/commit/2c045bd5673d56c3fdde7536da9df1c7d6f270f0

[issue45697] PyType_IsSubtype is doing excessive work in the common case

2021-11-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Creating a new type takes microseconds, and using PyObject_TypeCheck() instead of PyType_IsSubtype() can save nanoseconds. So, while this replacement looks harmless, its effect can hardly be measured even in microbenchmarks

[issue41105] Add some extra content check in configure process for some empty header file who has been deprecated by glibc

2021-11-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Rather of using AC_COMPILE_IFELSE() in configure.ac, would not be easier to use #ifdef in the C file? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue41

[issue45672] Mutation tests results of typing.py

2021-11-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What is the problem actually? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue45672> ___ ___

[issue45698] Error on importing getopt

2021-11-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It looks strange. The line containing "function (including the special meanings of arguments of the form `-'" is a part of a multiline string literal, so there should not be such error. And it is line 4, not line 3 as in your

[issue45698] Error on importing getopt

2021-11-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please provide an output as a text? -- ___ Python tracker <https://bugs.python.org/issue45698> ___ ___ Python-bug

[issue45698] Error on importing getopt

2021-11-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What error? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue45698> ___ ___ Python-bugs-list m

[issue45697] PyType_IsSubtype is doing excessive work in the common case

2021-11-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The PyObject_TypeCheck() macro is used in performance critical cases. If it is not the case the PyType_IsSubtype() function can be used. Adding yet check in PyType_IsSubtype() will slow down more performance sensitive cases in which PyObject_TypeCheck

[issue45692] IDLE: define word/id chars in one place.

2021-11-03 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +27639 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/29381 ___ Python tracker <https://bugs.python.org/issu

[issue45692] IDLE: define word/id chars in one place.

2021-11-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This in an interesting problem. I am going to work on it at the next weekends. -- ___ Python tracker <https://bugs.python.org/issue45

[issue45692] IDLE: define word/id chars in one place.

2021-11-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Complete sets of characters which can be used in identifiers are too large: >>> allchars = ''.join(map(chr, range(0x11))) >>> identstartchars = ''.join(c for c in allchars if c.isidentifier()) >>> identcontchars = ''.join(c fo

[issue45692] IDLE: define word/id chars in one place.

2021-11-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This set is mostly outdated. In Python 2 it was a set of characters composing identifiers, but in Python 3 identifiers can contain non-ASCII characters. -- nosy: +serhiy.storchaka ___ Python tracker <ht

[issue45687] Infinite recursion in Pickler.persistent_id

2021-11-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- components: +Interpreter Core nosy: +serhiy.storchaka versions: +Python 3.11 -Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue45

[issue10572] Move test sub-packages to Lib/test

2021-11-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Do we need Lib/test/test_sqlite3/__init__.py? Would not tests in package be loaded automatically? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue10

[issue45679] typing.Literal[True] is implicitly converted to typing.Literal[1]

2021-10-31 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +27607 pull_request: https://github.com/python/cpython/pull/29342 ___ Python tracker <https://bugs.python.org/issue45

[issue45679] typing.Literal[True] is implicitly converted to typing.Literal[1]

2021-10-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 634984d7dbdd91e0a51a793eed4d870e139ae1e0 by Serhiy Storchaka in branch 'main': bpo-45679: Fix caching of multi-value typing.Literal (GH-29334) https://github.com/python/cpython/commit/634984d7dbdd91e0a51a793eed4d870e139ae1e0

[issue45666] Warning: "'swprintf' : format string '%s' requires an argument of type 'unsigned short *', but variadic argument 1 has type 'const char *'"

2021-10-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >From the man page: S (Not in C99 or C11, but in SUSv2, SUSv3, and SUSv4.) Synonym for ls. Don't use. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issu

[issue45679] typing.Literal[True] is implicitly converted to typing.Literal[1]

2021-10-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +27602 pull_request: https://github.com/python/cpython/pull/29334 ___ Python tracker <https://bugs.python.org/issue45

[issue45679] typing.Literal[True] is implicitly converted to typing.Literal[1]

2021-10-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree. lru_cache(typed=True) itself should not look into iterable internals. It would be not only slow, but a change of semantic. The simplest way to solve this issue is to remove caching of __getitem__(). The more sophisticated way is to move caching

[issue45669] An 'ascii_alphanumerics' variable is missing in the 'strings' lib

2021-10-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I was also against this feature. My reasons: 1. There will be not much benefit. ascii_alphanumerics is too long, so there is no much saving of typing. There is larger chance of typo. You will be not able to use it for several years, until support

[issue45671] str(CancelledError()) is empty

2021-10-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Then you would get >>> raise asyncio.CancelledError Traceback (most recent call last): File "", line 1, in asyncio.exceptions.CancelledError: CancelledError instead of >>> raise asyncio.CancelledError Traceback (most recent

[issue45674] From Python 3.7, sre_parse.parse() do not create SubPattern instances that can be used to back reproduce original expression if containing non-capturing groups

2021-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: sre_parse.parse() is an internal function and this behaviour is an implementation detail. This change enabled some optimizations which did not work with non-capturing groups before. It did not affect the matching itself. -- nosy

[issue45671] str(CancelledError()) is empty

2021-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Concur with Andrew. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue45671> ___ ___ Python-bug

[issue45535] Enum's dir() does not contain inherited members

2021-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 29316 looks complicated. First of all, why do Enum needs a custom __dir__? What is wrong with the default implementation? -- ___ Python tracker <https://bugs.python.org/issue45

[issue45665] Problems caused by isinstance(list[int], type) returning True

2021-10-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- title: Problems caused by isinstance(list[int]) returning True -> Problems caused by isinstance(list[int], type) returning True ___ Python tracker <https://bugs.python.org/issu

[issue45502] Fix test_shelve and make it discoverable

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

[issue45502] Fix test_shelve and make it discoverable

2021-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset a043706f907e82ee6a562005991ff0b896a4e64d by Serhiy Storchaka in branch '3.9': [3.9] [3.10] bpo-45502: Fix test_shelve (GH-29003) (GH-29305) (GH-29306) https://github.com/python/cpython/commit/a043706f907e82ee6a562005991ff0b896a4e64d

[issue45502] Fix test_shelve and make it discoverable

2021-10-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +27575 pull_request: https://github.com/python/cpython/pull/29306 ___ Python tracker <https://bugs.python.org/issue45

[issue45502] Fix test_shelve and make it discoverable

2021-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 6b867022d926be9fcc6f8038fb1093ba8c348ca5 by Serhiy Storchaka in branch '3.10': [3.10] bpo-45502: Fix test_shelve (GH-29003) (GH-29305) https://github.com/python/cpython/commit/6b867022d926be9fcc6f8038fb1093ba8c348ca5

[issue45502] Fix test_shelve and make it discoverable

2021-10-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +27574 pull_request: https://github.com/python/cpython/pull/29305 ___ Python tracker <https://bugs.python.org/issue45

[issue45355] Use sizeof(_Py_CODEUNIT) instead of literal 2 for the size of the code unit

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

[issue45438] inspect not capturing type annotations created by __class_getitem__

2021-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have opened separate issues for different cases and a meta-issue45665 for general discussion. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior versions: +Python 3.11

[issue45665] Problems caused by isinstance(list[int]) returning True

2021-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: isinstance(x, type) returns True for instances of types.GenericAlias (like list[int]). While it may help in some cases related to typing, in many unrelated cases it causes problems if the value which is not a type passes checks for types. Also

[issue45665] Problems caused by isinstance(list[int]) returning True

2021-10-29 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : This is a meta-issue for problems caused by isinstance(list[int]) returning True. See also discussion in issue45438. -- components: Library (Lib) messages: 405290 nosy: serhiy.storchaka priority: normal severity: normal status: open title

[issue45664] resolve_bases() and new_class() do not work with type alias of a built-in type

2021-10-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: -27570 ___ Python tracker <https://bugs.python.org/issue45664> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45664] resolve_bases() and new_class() do not work with type alias of a built-in type

2021-10-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: -27569 ___ Python tracker <https://bugs.python.org/issue45664> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45664] resolve_bases() and new_class() do not work with type alias of a built-in type

2021-10-28 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +27562 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29298 ___ Python tracker <https://bugs.python.org/issu

[issue45664] resolve_bases() and new_class() do not work with type alias of a built-in type

2021-10-28 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : resolve_bases() returns incorrect result: >>> import types >>> types.resolve_bases((list[int],)) (list[int],) Expected (list,). new_class() fails: >>> types.new_class('L', (list[int],), {}) Traceback (most recent ca

[issue45663] is_dataclass() does not work for dataclasses which are subclasses of types.GenericAlias

2021-10-28 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +27557 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29294 ___ Python tracker <https://bugs.python.org/issu

[issue45663] is_dataclass() does not work for dataclasses which are subclasses of types.GenericAlias

2021-10-28 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : >>> import dataclasses, types >>> @dataclasses.dataclass ... class A(types.GenericAlias): ... origin: type ... args: type ... >>> dataclasses.is_dataclass(A) True >>> a = A(list, int) >&g

[issue45662] Incorrect repr of InitVar of a type alias

2021-10-28 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +27554 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29291 ___ Python tracker <https://bugs.python.org/issu

[issue45662] Incorrect repr of InitVar of a type alias

2021-10-28 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The repr of InitVar preserves type aliases from the typing module, but not builtin. >>> import typing, dataclasses >>> dataclasses.InitVar[typing.List[int]] dataclasses.InitVar[typing.List[int]] >>> dataclasses.InitVar[list[int

[issue45438] inspect not capturing type annotations created by __class_getitem__

2021-10-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue40296. -- ___ Python tracker <https://bugs.python.org/issue45438> ___ ___ Python-bugs-list mailing list Unsub

[issue45438] inspect not capturing type annotations created by __class_getitem__

2021-10-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > issubclass(x, list[int]) rejects the second argument for reasons explained in > the PEP. 1. One problem is that isinstance(x, type) != issubclass(type(x), type) if x is list[int]. It is unprecedented, I cannot recall any other case in which isin

[issue44904] Classmethod properties are erroneously "called" in multiple modules

2021-10-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b1302abcc8a4be5f39b4d60a1ce28032b77655b3 by Alex Waygood in branch 'main': bpo-44904: Fix classmethod property bug in doctest module (GH-28838) https://github.com/python/cpython/commit/b1302abcc8a4be5f39b4d60a1ce28032b77655b3

[issue45605] Return False from __contains__ method if object not hashable for set and dict

2021-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a duplicate of issue18510. It was also discussed on the Python-Dev mailing list (maybe more than once). If you have some new arguments or something in past 8 years made the old arguments no longer valid please open a new discussion on the mailing

[issue45438] inspect not capturing type annotations created by __class_getitem__

2021-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Two years is not so long for a bug. We fixed 8-year and 12-year bugs. The issue is that this feature is internally inconsistent (isinstance() is not consistent with issubclass()), the C implementation of list[int] is not consistent with the Python

[issue45436] test_tk.test_configure_type() fails with Tcl/Tk 8.6.11

2021-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Are there changes in handling empty values for other options? If yes, we perhaps need to add version-dependent tests for empty values instead of just skipping this case. -- ___ Python tracker <ht

[issue45438] inspect not capturing type annotations created by __class_getitem__

2021-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are two ways to fix the larger issue. 1. Make issubclass(types.GenericAlias, type) returning True, and also make isinstance(typing.List[int], type) returning True and issubclass(typing._GenericAlias, type) returning True, and analyze every place

[issue45588] cached_method similar to cached_property to cache with classes

2021-10-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The simple implementation is: def cached_method(func): return cached_property(lambda self: lru_cache()(partial(func, self))) -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue45

[issue45579] [list.append(i) for i in list] causes high resources usage

2021-10-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is expected behavior. Your code is equivalent to: _result = [] for i in your_list: _result.append(your_list.append(i)) which is equivalent to: _result = [] _j = 0 while _j < len(your_list): i = your_list[_j] _result.append(your_list.app

[issue45531] field "mro" behaves strangely in dataclass

2021-10-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Would not be more correct to look at cls.__dict__[fieldname]? BTW, mro() cannot be builtin, because you should be able to override it in some classes. -- ___ Python tracker <https://bugs.python.org/issue45

<    1   2   3   4   5   6   7   8   9   10   >