[issue37995] Multiline ast.dump()

2019-09-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > It would be great is the tool wasn't tightly bound to our particular AST and > could be used for any hand-rolled AST. I do not think it is possible. Every tree has its specifics: what types of nodes are supported (AST, list and primitiv

[issue38049] Add command-line interface for the ast module

2019-09-07 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The proposed PR adds a simple command-line interface to the ast module, similar to CLI of the tokenize and dis modules. It reads the content of a specified file (or stdin), parses it with ast.parse() and outputs the tree with ast.dump(). It can be used

[issue38049] Add command-line interface for the ast module

2019-09-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +15378 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15724 ___ Python tracker <https://bugs.python.org/issu

[issue38049] Add command-line interface for the ast module

2019-09-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- dependencies: +Multiline ast.dump() ___ Python tracker <https://bugs.python.org/issue38049> ___ ___ Python-bugs-list mailin

[issue15382] os.utime() mishandles some arguments

2019-09-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The documentation issue was fixed in issue23738. The documentation no longer claims that ns can be None. If specified it must be a tuple of floats. -- nosy: +serhiy.storchaka resolution: -> out of date stage: -> resolved status: open -&g

[issue38053] Update plistlib documentation

2019-09-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +ned.deily, ronaldoussoren ___ Python tracker <https://bugs.python.org/issue38053> ___ ___ Python-bugs-list mailin

[issue38038] Remove urllib.parse._splittype from xmlrpc.client

2019-09-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 9c4c459ac66c86a4511c8fec1997e8760e15ec17 by Serhiy Storchaka (Dong-hee Na) in branch 'master': bpo-38038: Remove urllib.parse._splittype from xmlrpc.client. (GH-15703) https://github.com/python/cpyt

[issue38007] Regression: name of PyType_Spec::slots conflicts with Qt macro

2019-09-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a major breaking change. It may need changing the Python version to 4.0. I suggest you to not use global macros without prefixes and undefine the conflicting one before using the Python C API. -- nosy: +serhiy.storchaka

[issue36946] Possible signed integer overflow in slice handling

2019-09-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 3c87a667bb367ace1de6bd1577fdb4f66947da52 by Serhiy Storchaka (HongWeipeng) in branch 'master': bpo-36946:Fix possible signed integer overflow when handling slices. (GH-15639) https://github.com/python/cpyt

[issue38005] Coercing strings and non-integer numbers to interpreter ID and channel ID

2019-09-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have doubts about accepting floats and bytes objects in all function that accept InterpreterID or ChannelID. Is it intentional? There are tests for strings. -- ___ Python tracker <https://bugs.python.

[issue36946] Possible signed integer overflow in slice handling

2019-09-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Zackery and HongWeipeng for your contribution! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38005] Coercing strings and non-integer numbers to interpreter ID and channel ID

2019-09-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is more serious issue: InterpreterID and ChannelID are declared as int subclasses, but actually they have incompatible structure, so using them as int causes a crash. For example, the following code is crashed: float(int(id)) == id

[issue38005] Coercing strings and non-integer numbers to interpreter ID and channel ID

2019-09-08 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- type: behavior -> crash ___ Python tracker <https://bugs.python.org/issue38005> ___ ___ Python-bugs-list mailing list Un

[issue21024] PyTypeObject tp_doc is char* instead of const char*

2019-09-08 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue27898] regexp performance degradation between 2.7.6 and 2.7.12

2019-09-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- status: open -> pending ___ Python tracker <https://bugs.python.org/issue27898> ___ ___ Python-bugs-list mailing list Un

[issue34410] itertools.tee not thread-safe; can segfault interpreter when wrapped iterator releases GIL

2019-09-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +15391 pull_request: https://github.com/python/cpython/pull/15736 ___ Python tracker <https://bugs.python.org/issue34

[issue34410] itertools.tee not thread-safe; can segfault interpreter when wrapped iterator releases GIL

2019-09-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 526a01467b3277f9fcf7f91e66c23321caa1245d by Serhiy Storchaka in branch 'master': bpo-34410: Fix a crash in the tee iterator when re-enter it. (GH-15625) https://github.com/python/cpython/commit/526a01467b3277f9fcf7f91e66c233

[issue34410] itertools.tee not thread-safe; can segfault interpreter when wrapped iterator releases GIL

2019-09-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +15394 pull_request: https://github.com/python/cpython/pull/15740 ___ Python tracker <https://bugs.python.org/issue34

[issue34410] itertools.tee not thread-safe; can segfault interpreter when wrapped iterator releases GIL

2019-09-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 2fb6921ab296f933caf361a662e6471e143abefc by Serhiy Storchaka in branch '2.7': [2.7] bpo-34410: Fix a crash in the tee iterator when re-enter it. (GH-15625) (GH-15740) https://github.com/python/cpyt

[issue37995] Multiline ast.dump()

2019-09-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 850573b836d5b82d1a1ebe75a635aaa0a3dff997 by Serhiy Storchaka in branch 'master': bpo-37995: Add an option to ast.dump() to produce a multiline output. (GH-15631) https://github.com/python/cpyt

[issue7940] re.finditer and re.findall should support negative end positions

2019-09-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Note that changing the current behavior is a breaking change. For example someone can use `pattern.findall(text, curpos-50, curpos+50)` to search in the range ±50 characters from the current position. If negative positions change meaning, this will break a

[issue38049] Add command-line interface for the ast module

2019-09-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 832e8640086ac4fa547c055a72929879cc5a963a by Serhiy Storchaka in branch 'master': bpo-38049: Add command-line interface for the ast module. (GH-15724) https://github.com/python/cpython/commit/832e8640086ac4fa547c055a729298

[issue37995] Multiline ast.dump()

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

[issue38049] Add command-line interface for the ast module

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

[issue38075] Make random module PEP-384 compatible

2019-09-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have the same questions. The new code looks more complex and cumbersome. What is the benefit of all these changes? I see you have created many similar issues. Would be nice to discuss first on the Python-Dev list what they do and why they are needed

[issue38083] Minor improvements in asdl_c.py and Python-ast.c

2019-09-10 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : * Use the const qualifier for constant C strings. This will save memory for their copy in a modifiable memory. * Intern field and attribute names. This will save time, as comparing interned strings is faster. * Temporary incref a borrowed reference to a

[issue38083] Minor improvements in asdl_c.py and Python-ast.c

2019-09-10 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +15473 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15824 ___ Python tracker <https://bugs.python.org/issu

[issue36781] Optimize sum() for bools

2019-09-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, I was going to withdraw this. -- ___ Python tracker <https://bugs.python.org/issue36781> ___ ___ Python-bugs-list mailin

[issue37935] Improve performance of pathlib.scandir()

2019-09-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The title is misleading. There is no pathlib.scandir(). -- ___ Python tracker <https://bugs.python.org/issue37935> ___ ___

[issue36781] Optimize sum() for bools

2019-09-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Well, it is good for people who already sum bools. But if you are concerned about microoptimization, sum(1 for ... if ...) can be better variant. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +P

[issue37935] Improve performance of pathlib.scandir()

2019-09-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Any optimization can be accepted only when we have any prove that the change actually has measurable effect, and that it is large enough. Avoiding calling list() on the output of scandir() may be not harmless. For example it will left open a file

[issue38105] hash collision when hash(x) == -2 causes many calls to __eq__

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

[issue37935] Improve performance of pathlib.scandir()

2019-09-11 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +15591 pull_request: https://github.com/python/cpython/pull/15956 ___ Python tracker <https://bugs.python.org/issue37

[issue37935] Improve performance of pathlib.scandir()

2019-09-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, I am the author of the code that uses os.scandir() in os.walk(), os.fwalk(), glob.iglob() and Path.glob() (see issue23605, issue25996, issue25596, issue26032). And it was always in mind to not keep many file descriptors open when traverse directories

[issue38115] Invalid bytecode offsets in co_lnotab

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

[issue38083] Minor improvements in asdl_c.py and Python-ast.c

2019-09-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Agree. The third item is actually a bug fix, but it is unlikely that such bug can be exposed in real code. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Pytho

[issue38120] DeprecationWarning in test_random due to invalid seed arguments

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

[issue38120] DeprecationWarning in test_random due to invalid seed arguments

2019-09-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset a06d683d7fd88721eaf59abcf5b02eb82045c7b1 by Serhiy Storchaka (Xtreak) in branch 'master': bpo-38120: Fix DeprecationWarning in test_random for invalid type of arguments to random.seed. (GH-15987) https://github.com/python/cpyt

[issue38144] Add the root_dir and dir_fd parameters in glob.glob()

2019-09-12 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The pattern for the glob() function can be relative and absolute. If it is relative, paths are searched from the current directory. If you want to search them in other directory, you need either change the current directory (which affects other parts of

[issue38144] Add the root_dir and dir_fd parameters in glob.glob()

2019-09-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +15696 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16075 ___ Python tracker <https://bugs.python.org/issu

[issue38141] Use fewer statics in Argument Clinic.

2019-09-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Dropping "static" will hit performance. _PyArg_Parser is used at first place because it can cache some data between calls. If drop static, you should drop also _PyArg_Parser and return to old slow arguments parsing. -- nosy: +serhiy

[issue24416] Have date.isocalendar() return a structseq instance

2019-09-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: namedtuple is much faster now that four years ago. New namedtuple type creation, instantiating a namedtuple object, access to its members -- all this is times faster. It is still slower than tuple in some aspects, because tuples are everywere and the

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

2019-09-13 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : sys.audit() for "glob.glob" is called in a recursive function _iglob(). So in process of executing glob.glob() it can be called multiple times, with the original pattern and with patterns for parent directories, while there are metacharacte

[issue38115] Invalid bytecode offsets in co_lnotab

2019-09-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Since we modify the content of the bytes object in any case, we can shrink it in-place by setting its Py_SIZE(). But it would be better to fill the end of it with "no-op" fillers. -- ___ Python track

[issue37785] argparse uses %s in gettext calls causing xgettext warnings

2019-09-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is a backward incompatible change. It will break existing translations. It should not be backported. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue37

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

2019-09-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Using recursion is rather an implementation detail, because splitpath() splits a path from the end (Path.glob() does it from other side). Also, it may be a tiny bit more efficient if the pattern contains a long literal prefix

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

2019-09-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ah, and when added sys.audit() for glob.glob(), should not it be added for Path.glob() too? And for os.walk()? -- ___ Python tracker <https://bugs.python.org/issue38

[issue37785] argparse uses %s in gettext calls causing xgettext warnings

2019-09-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it would be safer to revert changes in maintained versions. At least in 3.7. -- status: closed -> open ___ Python tracker <https://bugs.python.org/issu

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

2019-09-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it would be better to call sys.audit() in glob.iglob(), before calling the top-level _iglob(). It will give you a general context, and at every recursion level sys.audit() will be called for os.scandir

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

2019-09-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is harder to avoid repeating calls in os.walk(), because it is recursive itself. But you can introduce a recursive helper _walk() and make os.walk() just calling sys.audit() and _walk(). -- ___ Python

[issue38141] Use fewer statics in Argument Clinic.

2019-09-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Would adding a mutex for thread-safe initialization of _Py_Identifier and _PyArg_Parser solve the problem with subinterpreters? -- ___ Python tracker <https://bugs.python.org/issue38

[issue38005] Coercing strings and non-integer numbers to interpreter ID and channel ID

2019-09-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset bf169915ecdd42329726104278eb723a7dda2736 by Serhiy Storchaka in branch 'master': bpo-38005: Fixed comparing and creating of InterpreterID and ChannelID. (GH-15652) https://github.com/python/cpyt

[issue37206] Incorrect application of Argument Clinic to dict.pop()

2019-09-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 279f44678c8b84a183f9eeb85e0b086228154497 by Serhiy Storchaka in branch 'master': bpo-37206: Unrepresentable default values no longer represented as None. (GH-13933) https://github.com/python/cpyt

[issue37206] Incorrect application of Argument Clinic to dict.pop()

2019-09-14 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +15751 pull_request: https://github.com/python/cpython/pull/16141 ___ Python tracker <https://bugs.python.org/issue37

[issue37206] Incorrect application of Argument Clinic to dict.pop()

2019-09-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset d322abbb83eb751045246a70f39d040d13a6108b by Serhiy Storchaka in branch '3.8': [3.8] bpo-37206: Unrepresentable default values no longer represented as None. (GH-13933) (GH-16141) https://github.com/python/cpyt

[issue38173] [EASY] tkinter.filedialog.askopenfilenames should follow PEP8

2019-09-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: We usually do not accept pure cosmetic changes. >From PEP 8: Some other good reasons to ignore a particular guideline: 3. Because the code in question predates the introduction of the guideline and there is no other reason to be modifying that c

[issue38005] Coercing strings and non-integer numbers to interpreter ID and channel ID

2019-09-14 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +15755 pull_request: https://github.com/python/cpython/pull/16145 ___ Python tracker <https://bugs.python.org/issue38

[issue38005] Coercing strings and non-integer numbers to interpreter ID and channel ID

2019-09-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset f37a9831027ecfe948697cdb5e35b417805d94e5 by Serhiy Storchaka in branch '3.8': [3.8] bpo-38005: Fixed comparing and creating of InterpreterID and ChannelID. (GH-15652) (GH-16145) https://github.com/python/cpyt

[issue38005] Coercing strings and non-integer numbers to interpreter ID and channel ID

2019-09-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I would remove also converting a string to InterpreterID. The code would be simpler without it. I left it because there was explicit tests for it, but what is a use case for InterpreterID(string)? -- resolution: -> fixed stage: patch rev

[issue21023] PyTypeObject tp_name is char* instead of const char*

2019-09-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It should not be an issue in 2014 as it was fixed in 2005. See af68c874a6803b4e90b616077a602c0593719a1d. -- nosy: +serhiy.storchaka resolution: -> out of date stage: -> resolved status: open -&g

[issue38175] Memory leak in comparison of sqlite.Row objects

2019-09-15 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : There is a memory leak in comparison of sqlite.Row objects when row descriptors are different. There were not tests for this case. Also, the code compares the result of PyObject_RichCompare() with Py_True and Py_False. It is better to avoid such code

[issue38175] Memory leak in comparison of sqlite.Row objects

2019-09-15 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +15765 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16155 ___ Python tracker <https://bugs.python.org/issu

[issue38166] ast identifies incorrect column for compound attribute lookups

2019-09-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: AST for expression a.b.c is Attribute( value=Attribute( value=Name( id='a', ctx=Load(), lineno=1, col_offset=0, en

[issue33214] join method for list and tuple

2019-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: How common is the case of variable number of things to concatenate/union/merge? >From my experience, in most ceases this looks like: result = [] for ...: # many complex statements # may include continue and br

[issue38185] Weird way of case-insensitive indexing of sqlite3.Row

2019-09-16 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : sqlite3.Row can be indexed by integers and by strings. In the latter case string matching is case insensitive. But the code that implements this is too simple-minded. It compares UTF-8 representation of two strings ignoring some bit. It works for ASCII

[issue33214] join method for list and tuple

2019-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is history, but in 1997 Python had the same order of arguments as ECMAScript: string.join(words [, sep]). str.join() was added only in 1999 (226ae6ca122f814dabdc40178c7b9656caf729c2). -- ___ Python tracker

[issue38185] Weird way of case-insensitive indexing of sqlite3.Row

2019-09-16 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +15796 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16190 ___ Python tracker <https://bugs.python.org/issu

[issue38175] Memory leak in comparison of sqlite.Row objects

2019-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 8debfa50407107ff2329d01081cdc12d359f1d12 by Serhiy Storchaka in branch 'master': bpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. (GH-16155) https://github.com/python/cpython/commit/8debfa50407107ff2329d01081cdc1

[issue38175] Memory leak in comparison of sqlite.Row objects

2019-09-16 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +15816 pull_request: https://github.com/python/cpython/pull/16215 ___ Python tracker <https://bugs.python.org/issue38

[issue38185] Weird way of case-insensitive indexing of sqlite3.Row

2019-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset f669581a9527afb0d2325f9845a86715c0ba365d by Serhiy Storchaka in branch 'master': bpo-38185: Fixed case-insensitive string comparison in sqlite3.Row indexing. (GH-16190) https://github.com/python/cpyt

[issue38175] Memory leak in comparison of sqlite.Row objects

2019-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset be257bcad12b1d72a2c2a8199d2291ae22bccf78 by Serhiy Storchaka in branch '2.7': [2.7] bpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. (GH-16155). (GH-16215) https://github.com/python/cpyt

[issue38175] Memory leak in comparison of sqlite.Row objects

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

[issue38191] typing.NamedTuple() should prefix parameters with '_'

2019-09-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Looks as a good case for positional-only parameters. But first passing these arguments by keyword should be deprecated. -- assignee: -> serhiy.storchaka nosy: +gvanrossum, levkivskyi, serhiy.storch

[issue38191] typing.NamedTuple() should prefix parameters with '_'

2019-09-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +15822 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16222 ___ Python tracker <https://bugs.python.org/issu

[issue38191] typing.NamedTuple() should prefix parameters with '_'

2019-09-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 16222 adds support for arbitrary keyword argument names in NamedTuple and TypedDict. Passing arguments like "typename", "_typename", "fields" and "_fields" by keyword is still supported, but deprecated. I'm g

[issue38185] Weird way of case-insensitive indexing of sqlite3.Row

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

[issue38196] Bug fix in folderstats module

2019-09-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This tracker is for bugs in the C implementation of Python. "foldersize" is not a module from the standard Python library. Use the corresponding bug tracker for reporting a bug in third-party modules. -- nosy: +serhiy.storchaka

[issue38005] Coercing strings and non-integer numbers to interpreter ID and channel ID

2019-09-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +15825 pull_request: https://github.com/python/cpython/pull/16227 ___ Python tracker <https://bugs.python.org/issue38

[issue38191] typing.NamedTuple() should prefix parameters with '_'

2019-09-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 2bf31ccab3d17f3f35b42dca97f99576dfe2fc7d by Serhiy Storchaka in branch 'master': bpo-38191: Accept arbitrary keyword names in NamedTuple() and TypedDict(). (GH-16222) https://github.com/python/cpyt

[issue38191] typing.NamedTuple() should prefix parameters with '_'

2019-09-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +15835 pull_request: https://github.com/python/cpython/pull/16238 ___ Python tracker <https://bugs.python.org/issue38

[issue38191] typing.NamedTuple() should prefix parameters with '_'

2019-09-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +15836 pull_request: https://github.com/python/cpython/pull/16239 ___ Python tracker <https://bugs.python.org/issue38

[issue38191] typing.NamedTuple() should prefix parameters with '_'

2019-09-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +15837 pull_request: https://github.com/python/cpython/pull/16240 ___ Python tracker <https://bugs.python.org/issue38

[issue38191] typing.NamedTuple() should prefix parameters with '_'

2019-09-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, when backported to 3.7 I have found that TypedDict is new in 3.8. So I think it is better to get rid of deprecations in TypedDict(). -- ___ Python tracker <https://bugs.python.org/issue38

[issue38191] typing.NamedTuple() should prefix parameters with '_'

2019-09-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 69b3718b183a698202bd67488639bffd64a488bc by Serhiy Storchaka in branch '3.7': [3.7] bpo-38191: Accept arbitrary keyword names in NamedTuple(). (GH-16222) (GH-16239) https://github.com/python/cpyt

[issue38191] typing.NamedTuple() should prefix parameters with '_'

2019-09-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 8fc5839a9def34c13b6025c291434ba5fb5d6442 by Serhiy Storchaka in branch 'master': bpo-38191: Turn warnings into errors in NamedTuple() and TypedDict(). (GH-16238) https://github.com/python/cpyt

[issue38191] typing.NamedTuple() should prefix parameters with '_'

2019-09-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 2adcd79bf90415147691a51a4cb046d5920f6ce7 by Serhiy Storchaka in branch '3.8': bpo-38191: Use positional-only parameters in TypedDict(). (GH-16240) https://github.com/python/cpython/commit/2adcd79bf90415147691a51a4cb046

[issue38191] typing.NamedTuple() should prefix parameters with '_'

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

[issue38208] Simplify string.Template by using __init_subclass__()

2019-09-17 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Currently string.Template uses a metaclass. It is possible to get rid of it and use __init_subclass__() instead. -- components: Library (Lib) messages: 352699 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Simplify

[issue38209] Simplify dataclasses.InitVar by using __class_getitem__()

2019-09-17 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Currently dataclasses.InitVar uses a metaclass. It is possible to get rid of it and use __class_getitem__() instead. -- components: Library (Lib) messages: 352702 nosy: eric.smith, serhiy.storchaka priority: normal severity: normal status: open

[issue38209] Simplify dataclasses.InitVar by using __class_getitem__()

2019-09-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +15850 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16255 ___ Python tracker <https://bugs.python.org/issu

[issue38208] Simplify string.Template by using __init_subclass__()

2019-09-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +15851 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16256 ___ Python tracker <https://bugs.python.org/issu

[issue27575] dict viewkeys intersection slow for large dicts

2019-09-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am puzzled why we still call set.intersection_update with empty set? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue27

[issue38210] Intersection of dict view with iterator returns empty set

2019-09-18 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : In 3.8: >>> {1: 2, 3: 4}.keys() & {1, 2} {1} In master: >>> {1: 2, 3: 4}.keys() & iter([1, 2]) set() The behavior was changed in issue27575. -- components: Interpreter Core messages: 352705 nosy: rhettinger, serhiy.

[issue27575] dict viewkeys intersection slow for large dicts

2019-09-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.9 -Python 3.6 ___ Python tracker <https://bugs.python.org/issue27575> ___ ___ Python-bugs-list mailin

[issue27575] dict viewkeys intersection slow for large dicts

2019-09-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This changed behavior. See issue38210. See also issue38202 for other regression. -- status: closed -> open ___ Python tracker <https://bugs.python.org/issu

[issue27575] dict viewkeys intersection slow for large dicts

2019-09-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- status: open -> closed ___ Python tracker <https://bugs.python.org/issue27575> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue38215] Do not import modules in star-import when __all__ is not defined.

2019-09-18 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : If __all__ is not defined in a module "from module import *" will import all keys from module.__dict__ which does not start with underscore. It can add undesired names to the current namespace. The common case is related to importing m

[issue38215] Do not import modules in star-import when __all__ is not defined.

2019-09-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +15856 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16263 ___ Python tracker <https://bugs.python.org/issu

[issue38215] Do not import modules in star-import when __all__ is not defined.

2019-09-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I believe that significant part or even most of code is writing without using linters and type checkers. Python is too convenient for non-professional programmers. You do not need to declare all variables with their types to use Python and do not need to

[issue38219] Optimize dict.__init__ and dict.update for dict argument

2019-09-18 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : dict.__init__() and dict.update() with a positional argument look up the "keys" attribute of the argument to distinguish a mapping from a sequence of item-value pairs. It has a non-trivial cost. Merging dicts is optimized for exact dicts in Py

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