[issue44955] Method stopTestRun() is not always called for skipped tests

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

[issue44940] Clarify the documentation of re.findall()

2021-08-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8 ___ Python tracker <https://bugs.python.or

[issue44940] Clarify the documentation of re.findall()

2021-08-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset d006392245c904547e5727144235c2f9d7948e96 by Miss Islington (bot) in branch '3.9': bpo-44940: Clarify the documentation of re.findall() (GH-27849) (GH-27880) https://github.com/python/cpython/commit/d006392245c904547e5727144235c2f9d7948e96

[issue44955] Method stopTestRun() is not always called for skipped tests

2021-08-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 4e5162fd369baf25dd16a42ccd0fa7756744f4d0 by Miss Islington (bot) in branch '3.9': bpo-44955: Always call stopTestRun() for implicitly created TestResult objects (GH-27831) (GH-27882) https://github.com/python/cpython/commit

[issue44977] Deprecate delegation of int to __trunc__?

2021-08-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I do not think that math.trunc() for UUID or IP4Address makes sense. -- ___ Python tracker <https://bugs.python.org/issue44

[issue44977] Deprecate delegation of int to __trunc__?

2021-08-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Completely agree. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue44977> ___ ___ Python-bug

[issue41620] Python Unittest does not return results object when the test is skipped

2021-08-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is a bug because there is a difference between the following cases: @skip("skipped") def test1(self): ... @other_decorator @skip("skipped") def test2(self): ... def test2(self): se

[issue44974] Warning about "Unknown child process pid" in test_asyncio

2021-08-22 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Ryan Mast reported about a warning about "Unknown child process pid" after finishing test_asyncio (see msg400018 and https://github.com/python/cpython/pull/27870#issuecomment-903072119 for details). I cannot reproduce it locally. Ryan, coul

[issue44968] Fix/remove test_subprocess_wait_no_same_group from test_asyncio tests

2021-08-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your report Ryan. Indeed, there was a bug introduced during refactoring (one unneeded "yield" was kept), and there was a bug before refactoring (the transport was not closed). I'll open a new issue about "Unknown ch

[issue44955] Method stopTestRun() is not always called for skipped tests

2021-08-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset a9640d75531d6cbbfd254b65435f238c26bf5cd9 by Serhiy Storchaka in branch 'main': bpo-44955: Always call stopTestRun() for implicitly created TestResult objects (GH-27831) https://github.com/python/cpython/commit

[issue44940] Clarify the documentation of re.findall()

2021-08-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 64f9e7b19dc1603fcbd07c17c9860085b9d21465 by Serhiy Storchaka in branch 'main': bpo-44940: Clarify the documentation of re.findall() (GH-27849) https://github.com/python/cpython/commit/64f9e7b19dc1603fcbd07c17c9860085b9d21465

[issue44968] Fix/remove test_subprocess_wait_no_same_group from test_asyncio tests

2021-08-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 585390fdd8661b4bc08bdfc27551292da9b4b9b8 by Serhiy Storchaka in branch 'main': bpo-44968: Fix test_subprocess_wait_no_same_group in test_asyncio (GH-27870) https://github.com/python/cpython/commit/585390fdd8661b4bc08bdfc27551292da9b4b9b8

[issue44970] Re-examine complex pow special case handling

2021-08-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The OverflowError should only be raised if finite arguments produce infinite result. Py_ADJUST_ERANGE2 is used improperly. But after fixing this error I get (nan+infj) for z**1, the same as for z*1. -- nosy: +serhiy.storchaka

[issue44524] __name__ attribute in typing module

2021-08-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 5bd27c3be5734e158f67ff86087a977a25d89161 by Miss Islington (bot) in branch '3.10': bpo-44524: Do not set _name of _SpecialForm without need (GH-27861) (GH-27871) https://github.com/python/cpython/commit

[issue39827] setting a locale that uses comma as decimal separator breaks tkinter.DoubleVar

2021-08-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue12558 which exposes the other side of the same issue. Las time I looked at it, it was inherently a Tcl issue. In some places it uses locale-dependent formatting of floating point numbers, but locale-unaware parsing, or vice versa

[issue44969] Subclassing of annotated types does not always work

2021-08-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think that __mro_entries__() for annotated types should return the result of __mro_entries__() for the original type if it has __mro_entries__. But details can be complicated, especially if user-defined generic types are involved. Alternatively

[issue44969] Subclassing of annotated types does not always work

2021-08-21 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : It works only with simple types >>> class X(Annotated[list, 'annotation']): pass ... But not with type aliases >>> class X(Annotated[List[int], 'annotation']): pass ... Traceback (most recent call last): File "", line 1,

[issue44524] __name__ attribute in typing module

2021-08-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 4ceec495598e78f0776dd46d511dcc612a434dc3 by Serhiy Storchaka in branch 'main': bpo-44524: Do not set _name of _SpecialForm without need (GH-27861) https://github.com/python/cpython/commit/4ceec495598e78f0776dd46d511dcc612a434dc3

[issue44968] Fix/remove test_subprocess_wait_no_same_group from test_asyncio tests

2021-08-21 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- components: +asyncio type: -> behavior versions: -Python 3.8 ___ Python tracker <https://bugs.python.org/issue44968> ___ _

[issue44968] Fix/remove test_subprocess_wait_no_same_group from test_asyncio tests

2021-08-21 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch nosy: +serhiy.storchaka nosy_count: 7.0 -> 8.0 pull_requests: +26324 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27870 ___ Python tracker <https://bugs.p

[issue44524] __name__ attribute in typing module

2021-08-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +26319 pull_request: https://github.com/python/cpython/pull/27861 ___ Python tracker <https://bugs.python.org/issue44

[issue44547] fraction.Fraction does not implement __int__.

2021-08-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Fraction.__int__ = Fraction.__trunc__ may not work because __trunc__() can return any object with __index__, while __int__ should return an exact int (not even an int subclass). -- ___ Python tracker <ht

[issue44940] Hint the use of non-capturing group in re.findall() documentation

2021-08-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch nosy: +serhiy.storchaka nosy_count: 3.0 -> 4.0 pull_requests: +26309 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27849 ___ Python tracker <https://bugs.p

[issue41322] unittest: deprecate test methods returning non-None values

2021-08-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Every new feature should be documented and covered by tests (unless it is very trivial or it is very difficult to write a test for it). -- ___ Python tracker <https://bugs.python.org/issue41

[issue44956] curses getch returns wrong value

2021-08-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Your terminal emulator does not support this key. I tested it on Konsole and it returned 27. But on XTerm and on the Linux virtual console I get the expected result. -- nosy: +serhiy.storchaka ___ Python

[issue44923] Unittest incorrect result with argparse.ArgumentError in self asserRaises context

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

[issue41322] unittest: deprecate test methods returning non-None values

2021-08-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +andrei.avk, defreng, ezio.melotti, michael.foord, rbcollins, terry.reedy, xtreak, zach.ware ___ Python tracker <https://bugs.python.org/issue41

[issue44524] __name__ attribute in typing module

2021-08-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are some side effects of setting _name. In 3.9: >>> class X(Annotated[int, (1, 10)]): pass ... >>> X.__mro__ (, , ) In 3.10: >>> class X(Annotated[int, (1, 10)]): pass ... >>> X.__mro__ (, , , ) Now a subclas

[issue44524] __name__ attribute in typing module

2021-08-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are still cryptic TypeError messages for Annotated: >>> class X(Annotated[int | float, "const"]): pass ... Traceback (most recent call last): File "", line 1, in TypeError: metaclass conflict: the metaclass of a

[issue44942] Add number pad enter bind to TK's simpleDialog

2021-08-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Tk does not bind KP_Enter in standard TK dialogs. I do not think we should introduce additional discrepancy between dialogs implemented in Tk and Python. Please file a feature request for Tk. If they add a binding for KP_Enter we will follow them

[issue41322] unittest: deprecate test methods returning non-None values

2021-08-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Tests are needed. -- resolution: fixed -> stage: resolved -> test needed status: closed -> open ___ Python tracker <https://bugs.python.or

[issue44955] Method stopTestRun() is not always called for skipped tests

2021-08-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +26295 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27831 ___ Python tracker <https://bugs.python.org/issu

[issue44955] Method stopTestRun() is not always called for skipped tests

2021-08-19 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Method startTestRun() is always called for the TestResult object implicitly created by TestCase.defaultTestResult() when no TestResult object is passed to TestCase.run(). But method stopTestRun() is not always called in pair with startTestRun

[issue44943] Integrate PyHyphen into the textwrap module?

2021-08-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Many years ago I write highly optimized hyphenation module (as a part of OrnamentBook project https://sourceforge.net/projects/pybookreader/files/OrnamentBook/). I could contribute the code to the stdlib. But the problem is that the algorithm depends

[issue44938] Expose PyErr_ChainExceptions in the stable API

2021-08-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: As the original author of _PyErr_ChainExceptions() (issue21715) I am not sure that its name and signature are optimal. It did not matter while it was internal function because we could change them at any moment, but for public API the design should

[issue44932] `issubclass` and `isinstance` doesn't check for all 2nd argument types

2021-08-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is not specific to typing. >>> isinstance(1, (int, 1)) True >>> isinstance(1, (1, int)) Traceback (most recent call last): File "", line 1, in TypeError: isinstance() arg 2 must be a type or tuple of types >&g

[issue44930] super-Matlab-style ranged list literal initialization

2021-08-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Steven. Before range() and enumerate() were introduced there were discussions about introducing dedicated syntax. But it was decided that builtin functions are more preferable. range() was improved in Python 3, so you do not need to waste

[issue44931] Add "bidimap" to collections library: a simple bidirectional map

2021-08-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Is BiDiMap included in the Java SDK? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue44

[issue44915] Python keywords as string keys in TypedDict

2021-08-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You can use the functional form of TypedDict: C = TypedDict("C", {"to": int, "from": int}) -- nosy: +serhiy.storchaka ___ Python tracker <h

[issue44920] Support UUIDv6, UUIDv7, and UUIDv8 from the new version of RFC4122

2021-08-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is a new feature, and we usually do not backport new features to old Python versions, so it can only be included in Python 3.11 (backports can be provided by third-party libraries). Do you want to create a PR? -- nosy: +serhiy.storchaka

[issue44923] Unittest incorrect result with argparse.ArgumentError in self asserRaises context

2021-08-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You raise ArgumentTypeError, but expect ArgumentError. ArgumentTypeError is not a subclass of ArgumentError. -- nosy: +serhiy.storchaka versions: +Python 3.8 -Python 3.6 ___ Python tracker <ht

[issue44902] [Doc] Changing 'Mac OS X'/'OS X' to 'macOS'

2021-08-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Isn't it a duplicate of issue41203? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue44

[issue7615] unicode_escape codec does not escape quotes

2021-08-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Nothing was changed. Backslashes in your output are backslashes in the bytes object repr. >>> print('a\'b"c\'\'\'d"""e'.encode('unicode_escape').decode()) a'b"c'''d"""e -

[issue44854] Add .editorconfig to the root directory

2021-08-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 058fb35b57ca8c5063d16ec818e668b3babfea65 by Serhiy Storchaka in branch 'main': bpo-44854: Remove trailing whitespaces (GH-27689) https://github.com/python/cpython/commit/058fb35b57ca8c5063d16ec818e668b3babfea65

[issue44854] Add .editorconfig to the root directory

2021-08-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka nosy_count: 2.0 -> 3.0 pull_requests: +26175 pull_request: https://github.com/python/cpython/pull/27689 ___ Python tracker <https://bugs.python.org/issu

[issue44866] Inconsistent Behavior of int()

2021-08-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I understand your confusion John. The fact is that int() serves two functions. If argument is a number, it truncates it to an integer. If argument is a string, it parses the string representation of integer (not necessary decimal). For details see https

[issue25782] CPython hangs on error __context__ set to the error itself

2021-08-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: My argument is the loop creation should be prevented at first place. PyErr_SetObject() is not the only C code that can hang or overflow the stack when iterate a loop. Preventing creation of the loop will fix all other code that iterate the __context__

[issue42053] fwalk: incorrect boolean test for non-fd arguments

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

[issue42053] fwalk: incorrect boolean test for non-fd arguments

2021-08-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 2b496e79293a8b80e8ba0e514e186b3b1467b64b by Serhiy Storchaka in branch 'main': bpo-42053: Remove misleading check in os.fwalk() (GH-27669) https://github.com/python/cpython/commit/2b496e79293a8b80e8ba0e514e186b3b1467b64b

[issue44866] Inconsistent Behavior of int()

2021-08-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Following your long example, it seems to me that all works as you expected. Raise an exception if you expect exception, and does raise it if you expect no exception. I may miss something, what exactly does not work as you expected? -- nosy

[issue42053] fwalk: incorrect boolean test for non-fd arguments

2021-08-08 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +26158 pull_request: https://github.com/python/cpython/pull/27669 ___ Python tracker <https://bugs.python.org/issue42

[issue42053] fwalk: incorrect boolean test for non-fd arguments

2021-08-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I confirm that fwalk() does not support integer first argument. This check is misleading. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue42

[issue44859] Improve some sqlite3 errors

2021-08-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 0eec6276fdcdde5221370d92b50ea95851760c72 by Serhiy Storchaka in branch 'main': bpo-44859: Improve error handling in sqlite3 and and raise more accurate exceptions. (GH-27654) https://github.com/python/cpython/commit

[issue44861] csv.writer stopped to quote values with escapechar with csv.QUOTE_MINIMAL in Python 3.10

2021-08-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The 3.9 behavior is incorrect: write 'spam\\eggs', read 'spameggs'. The 3.10 behavior is correct: write 'spam\\eggs', read 'spam\\eggs'. What is your problem exactly? -- nosy: +serhiy.storchaka ___ Python

[issue43526] Programmatic management of BytesWarning doesn't work for native triggers.

2021-08-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > And though I did not check, I expect the `-b` flag exists mostly because of > the performance impact of the warning any time bytes are checked for > equality, but surely that impact would be limited and probably not very &

[issue44859] Improve some sqlite3 errors

2021-08-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Entries 3 and 4 are about Cursor.executescript(), not Cursor.execute(). -- ___ Python tracker <https://bugs.python.org/issue44

[issue44859] Improve some sqlite3 errors

2021-08-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +26148 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27654 ___ Python tracker <https://bugs.python.org/issu

[issue44859] Improve some sqlite3 errors

2021-08-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is also a problem with the sqlite3.InterfaceError raised when bind parameters with message "Error binding parameter XXX - probably unsupported type." It is raised not only for unsupported types, but: * For too large integers (outside of

[issue44859] Improve some sqlite3 errors

2021-08-07 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : * MemoryError is now raised instead of sqlite3.Warning when memory is not enough for encoding statement to UTF-8 in Connection.__call__() and Cursor.execute(). * UnicodEncodeError is now raised instead of sqlite3.Warning when statement contains

[issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite

2021-08-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: clear_ignored_deprecations() does not know whether filters were added in setUp(), setUpClass(), setUpModule() or just in a particular method. We should use teadDown*() or add*Cleanup() to clean up at appropriate level

[issue44822] [sqlite3] Do not truncate results of user functions and aggregates on the first NUL

2021-08-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset c352412123140e79dcce6188d17e3e6dbc3f4144 by Erlend Egeberg Aasland in branch '3.9': [3.9] bpo-44822: Don't truncate `str`s with embedded NULL chars returned by `sqlite3` UDF callbacks (GH-27588). (GH-27639) https://github.com/python/cpython

[issue44839] Convert Python exceptions to appropriate SQLite error codes

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

[issue44839] Convert Python exceptions to appropriate SQLite error codes

2021-08-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 7d747f26e6cac9f6891d475f3443441ce947697b by Serhiy Storchaka in branch 'main': bpo-44839: Raise more specific errors in sqlite3 (GH-27613) https://github.com/python/cpython/commit/7d747f26e6cac9f6891d475f3443441ce947697b

[issue43853] [sqlite3] Improve sqlite3_value_text() error handling

2021-08-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What about new tests and NEWS update? -- ___ Python tracker <https://bugs.python.org/issue43853> ___ ___ Python-bugs-list m

[issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite

2021-08-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are problems with clearing all ignored deprecation filters. We can want to ignore warnings in narrower or wider scope: per-method, per-class, per-module. We should use the warnings.catch_warnings() context manager for restoring filters

[issue43853] [sqlite3] Improve sqlite3_value_text() error handling

2021-08-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 8c07fef867707694c9f2fcee4d7a9563ad78ed14 by Erlend Egeberg Aasland in branch '3.9': [3.9] bpo-43853: Handle sqlite3_value_text() errors (GH-25422). (GH-27627) https://github.com/python/cpython/commit/8c07fef867707694c9f2fcee4d7a9563ad78ed14

[issue44831] Inconsistency between datetime.now() and datetime.fromtimestamp(time.time(), None)

2021-08-06 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +belopolsky, p-ganssle, vstinner ___ Python tracker <https://bugs.python.org/issue44831> ___ ___ Python-bugs-list mailin

[issue43526] Programmatic management of BytesWarning doesn't work for native triggers.

2021-08-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am not against documenting the behavior of -b and BytesWarning clearly. I don't think that anyone would be against. Just somebody have to provide a PR. Explicitly repr-ing a bytes instance does not produce a warning, and never produced, so I don't

[issue43853] [sqlite3] Improve sqlite3_value_text() error handling

2021-08-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it is worth to backport it to 3.9. It looks to me that it fixes also support of strings containing NUL. It would be nice to add corresponding tests for this. You can also add this in the NEWS entry for this issue. -- status: closed

[issue43838] There is a way to access an underlying mapping in MappingProxyType

2021-08-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Good catch! Thank you Raymond for the third example. I though that it can be easily fixed by calling tp_traverse() for submapping: static int mappingproxy_traverse(PyObject *self, visitproc visit, void *arg) { mappingproxyobject *pp

[issue44524] __name__ attribute in typing module

2021-08-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Ken Jin. But it does not explain why objects which currently have __name__/__qualname__ is None should have these attribute. There is no builtin data type that corresponds to ClassVar, Final, Literal, Concatenate or TypeGuard. And (int | str

[issue44524] __name__ attribute in typing module

2021-08-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am confusing. Why do these objects should have __name__ and __qualname__ attributes? What document specifies this? How are these attributes used? collections.abc.MutableSet and typing.MutableSet are different things. The former is a class, the latter

[issue44839] Convert Python exceptions to appropriate SQLite error codes

2021-08-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It was grown from bigmem tests for issue44822. -- ___ Python tracker <https://bugs.python.org/issue44839> ___ ___ Python-bug

[issue44839] Convert Python exceptions to appropriate SQLite error codes

2021-08-05 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Currently, any exception raised in user-defined function set the general SQLITE_ERROR error which then produce sqlite3.OperationalError. For example, if the user function returns a string or bytes object larger than INT_MAX you get OperationalError

[issue44839] Convert Python exceptions to appropriate SQLite error codes

2021-08-05 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +26107 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27613 ___ Python tracker <https://bugs.python.org/issu

[issue44822] [sqlite3] Do not truncate results of user functions and aggregates on the first NUL

2021-08-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 8f010dc920e1f6dc6a357e7cc1460a7a567c05c6 by Erlend Egeberg Aasland in branch 'main': bpo-44822: Don't truncate `str`s with embedded NULL chars returned by `sqlite3` UDF callbacks (GH-27588) https://github.com/python/cpython/commit

[issue44822] [sqlite3] Do not truncate results of user functions and aggregates on the first NUL

2021-08-04 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- title: [sqlite3] Micro-optimisation: pass string size to sqlite3_result_text() -> [sqlite3] Do not truncate results of user functions and aggregates on the first NUL type: enhancement -> behavior versions: +Python 3.10, Pyth

[issue44822] [sqlite3] Micro-optimisation: pass string size to sqlite3_result_text()

2021-08-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The difference between specifying negative and non-negative third argument of sqlite3_result_text() is that in the latter case the result can contain embedded NUL characters. Could you please add a test for string containing embedded NUL? Letting SQLite

[issue44801] Type expression is coerced to a list of parameter arguments in substitution of ParamSpec

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

[issue44801] Type expression is coerced to a list of parameter arguments in substitution of ParamSpec

2021-08-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Ken Jin. So the problem is the __args__ (x, str) is interpreted differently depending on x, and after substituting x the interpretation can be changed. If x was ParamSpec, it was interpreted in one way, but if it becomes int, it is now

[issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking

2021-08-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > It should use "(id(instance), instance)" rather than just "instance" as the > key. It should use a dict with id(instance) as a key and instance as value. An instance can be non-hashable. --

[issue44818] '\t' (tab) support

2021-08-03 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- status: open -> pending ___ Python tracker <https://bugs.python.org/issue44818> ___ ___ Python-bugs-list mailing list Un

[issue20703] RuntimeError caused by lazy imports in pdb

2021-08-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: My concern about importing readline at the top of the module is that importing readline has a side effect. The only module which imports it unconditionally at the top is rlcompleter. In all other places it is imported lazily. And importing readline ahead

[issue34782] Pdb raises exception when code is executed in a mapping that does not define `__contains__`

2021-08-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You cannot expect that running code under debugger does not have any effect. Otherwise there would not be any meaning in debugger. Running code under debugger has some side effects, and setting locals __return__ and __exception__ is one of them

[issue44806] Subclassing Protocol get different __init__

2021-08-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is other related case: >>> from typing import * >>> class P(Protocol): pass ... >>> class B: ... def __init__(self): ... self.test = 'OK' ... >>> class D(P, B): ... pass ... >>> D().t

[issue44806] Subclassing Protocol get different __init__

2021-08-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +26054 pull_request: https://github.com/python/cpython/pull/27545 ___ Python tracker <https://bugs.python.org/issue44

[issue44806] Subclassing Protocol get different __init__

2021-08-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka versions: +Python 3.10, Python 3.9 ___ Python tracker <https://bugs.python.org/issue44806> ___ ___ Pytho

[issue44793] Arguments ignored in substitution in typing.Callable

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

[issue44785] test_pickle issues "DeprecationWarning: The Tix Tk.."

2021-08-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka nosy_count: 2.0 -> 3.0 pull_requests: +26048 pull_request: https://github.com/python/cpython/pull/27538 ___ Python tracker <https://bugs.python.org/issu

[issue44793] Arguments ignored in substitution in typing.Callable

2021-08-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset f92b9133ef67e77605cbd315b6b6c81036ce110e by Serhiy Storchaka in branch 'main': bpo-44793: Fix checking the number of arguments when subscribe a generic type with ParamSpec parameter. (GH-27515) https://github.com/python/cpython/commit

[issue44804] Port fix of "issue44422" to Python3.6.x

2021-08-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +ned.deily ___ Python tracker <https://bugs.python.org/issue44804> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20703] RuntimeError caused by lazy imports in pdb

2021-08-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Having a side effect at import time is not good. It will interfere with programs which just import pdb, but not use it. There are two other options: 1. Import readline at top level, but call set_completer_delims() lazily. 2. Do not import readline at all

[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2021-08-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 27528 makes the C implementation of OrderedDict.popitem() consistent with the Python implementation (do not call overridden __getitem__ and __setitem__). PR 27530 changes also both implementations of OrderedDict.pop(). It simplifies the C code

[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2021-08-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +26045 pull_request: https://github.com/python/cpython/pull/27530 ___ Python tracker <https://bugs.python.org/issue27

[issue41973] Docs: TypedDict is now of type function instead of class

2021-08-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Actually most names defined in typing are no longer classes. -- assignee: -> docs@python components: +Documentation nosy: +docs@python, gvanrossum, kj versions: +Python 3.11 ___ Python tracker <

[issue41973] Docs: TypedDict is now of type function instead of class

2021-08-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: TypeDict is a callable, it can be used as Point2D = TypedDict('Point2D', x=int, y=int, label=str) It can also be used as a base in class definition, but is is not a class itself. It does not occur in __bases__ of the created class, and it cannot

[issue44782] LRU class given as example in OrderedDict docs not work on pop

2021-08-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree that composition is methodologically more correct than inheritance for implementing a variant of lru_cache(). But if you need lru_cache() why not use lru_cache() from the stdlib? I think that instead of showing a poor version of the lru_cache

[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2021-08-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +26043 pull_request: https://github.com/python/cpython/pull/27528 ___ Python tracker <https://bugs.python.org/issue27

[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2021-08-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is complicated. The pure Python implementation of OrderedDict.popitem() and OrderedDict.pop() are not consistent. The former uses dict.pop() which doesn't call __getitem__ and __setitem__. The latter calls __getitem__ and __setitem__. The C

[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2021-08-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issue27

<    7   8   9   10   11   12   13   14   15   16   >