[issue47097] Document PEP 646

2022-03-22 Thread Jelle Zijlstra
New submission from Jelle Zijlstra : https://docs.python.org/3.11/library/typing.html doesn't say anything about TypeVarTuple yet. -- assignee: docs@python components: Documentation messages: 415850 nosy: AlexWaygood, JelleZijlstra, docs@python, gvanrossum, kj, mrahtz pri

[issue47088] Implement PEP 675 (LiteralString)

2022-03-22 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- keywords: +patch pull_requests: +30155 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32064 ___ Python tracker <https://bugs.python.org/issu

[issue46769] Improve documentation for `typing.TypeVar`

2022-03-22 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset d5ed8a8258eaf7a241978b1b0aeb971108d0f7e0 by Alex Waygood in branch '3.10': [3.10] bpo-46769: Improve documentation for `typing.TypeVar` (GH-31712) (GH-31941) https://github.com/python/cpython/commit/d5ed8a8258eaf7a241978b1b0aeb97

[issue46769] Improve documentation for `typing.TypeVar`

2022-03-22 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- pull_requests: +30156 pull_request: https://github.com/python/cpython/pull/32067 ___ Python tracker <https://bugs.python.org/issue46

[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2022-03-22 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I was close to merging the linked PR but there's some renewed concerns about the proposed behavior here: Do we really want to change this behavior and potentially force a lot of people to change their working code? In addition, the current code

[issue46769] Improve documentation for `typing.TypeVar`

2022-03-23 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks Alex for the PR and Łukasz for merging the last backport! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46480] Implement typing.assert_type

2022-03-23 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset 3354245daf89ca2c760c2c3e5b69a571f25073ed by Shantanu in branch 'main': bpo-46480: rephrase typing.assert_type docs (GH-32069) https://github.com/python/cpython/commit/3354245daf89ca2c760c2c3e5b69a5

[issue11339] annotation for class being defined

2022-03-25 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Agree. typing.Self from PEP 673 fixes this specific case, and PEP 563 or 649 will provide a general solution. No need to keep this issue open. -- nosy: +JelleZijlstra status: pending -> open ___ Python trac

[issue43224] Add support for PEP 646

2022-03-25 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: > 1. Finish writing docs (is updating library/typing.html sufficient? > https://github.com/python/cpython/pull/32103) We also need to add to the What's New for 3.11. I volunteered to do that for all the typing PEPs. > 2. Implement support f

[issue43224] Add support for PEP 646

2022-03-26 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset e8e737bcf6d22927caebc30c5d57ac4634063219 by Matthew Rahtz in branch 'main': bpo-43224: Implement PEP 646 grammar changes (GH-31018) https://github.com/python/cpython/commit/e8e737bcf6d22927caebc30c5d57ac

[issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior

2022-03-27 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset 86384cf83f96fcaec03e2ad6516e2e24f20d3b92 by vidhya in branch 'main': bpo-28516: document contextlib.ExitStack.__enter__ behavior (GH-31636) https://github.com/python/cpython/commit/86384cf83f96fcaec03e2ad6516e2e

[issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior

2022-03-28 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset 1e3132b1c3ebff8d28a6dd353bf217cb97c41e81 by Miss Islington (bot) in branch '3.9': bpo-28516: document contextlib.ExitStack.__enter__ behavior (GH-31636) (GH-32145) https://github.com/python/cpyt

[issue47143] Add functools.copy_class() which updates closures

2022-03-28 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I believe the attrs code wouldn't work if a method is decorated with a decorator that wraps the original function, such as @functools.cache. -- nosy: +JelleZijlstra ___ Python tracker <https://bugs.py

[issue47143] Add types.copy_class() which updates closures

2022-03-28 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I mean that the code sample above from attrs doesn't properly update the closure for wrapped methods, such as those created by @functools.cache, or any other arbitrary decorator that creates a wrapper function. Example (with Python 3.9.4 and attrs 2

[issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior

2022-03-28 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- pull_requests: +30249 pull_request: https://github.com/python/cpython/pull/32171 ___ Python tracker <https://bugs.python.org/issue28

[issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior

2022-03-28 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset 604d003ab4d1084ef828ebca1b28f2bf1b93c744 by Jelle Zijlstra in branch '3.10': [3.10] bpo-28516: document contextlib.ExitStack.__enter__ behavior (GH-31636) (GH-32171) https://github.com/python/cpyt

[issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior

2022-03-28 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks for the patch! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42340] KeyboardInterrupt should come with a warning

2022-03-29 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset d0906c90fcfbc4cfb9bb963eaa6bb152dd543b56 by benfogle in branch 'main': bpo-42340: Document issues around KeyboardInterrupt (GH-23255) https://github.com/python/cpython/commit/d0906c90fcfbc4cfb9bb963eaa6bb152dd543b56 -

[issue42340] KeyboardInterrupt should come with a warning

2022-03-29 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks for the patch! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue47166] Dataclass transform should ignore TypeAlias variables

2022-03-30 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- nosy: +AlexWaygood, GBeauregard, JelleZijlstra ___ Python tracker <https://bugs.python.org/issue47166> ___ ___ Python-bugs-list m

[issue47166] Dataclass transform should ignore TypeAlias variables

2022-03-30 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: >From a typing perspective this is reasonable. See this thread about type >aliases in class scopes: >https://mail.python.org/archives/list/typing-...@python.org/thread/CGOO7GPPECGMLFDUDXSSXTRADI4BXYCS/ > However, it's a niche use case an

[issue47202] Feature request: Throw an error when making impossible evaluation against an empty list

2022-04-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: This sort of thing would be better caught by a linter or type checker. For example, mypy with the `--warn-unreachable` option will flag the `while None:` example. Iterating over an empty list will not currently be caught by mypy, but it's common in

[issue47031] math.nan should note that NANs do not compare equal to anything

2022-04-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset 182e93c3f57b0c72e765c9896066d32e461c0865 by Charlie Zhao in branch 'main': bpo-47031: Improve documentation for `math.nan` (GH-32170) https://github.com/python/cpython/commit/182e93c3f57b0c72e765c9896066d32e461c0865 -

[issue26792] docstrings of runpy.run_{module,path} are rather sparse

2022-04-02 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- nosy: +JelleZijlstra nosy_count: 4.0 -> 5.0 pull_requests: +30330 pull_request: https://github.com/python/cpython/pull/32265 ___ Python tracker <https://bugs.python.org/issu

[issue45114] bad example for os.stat

2022-04-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset c93a0ac6972221787d8bea1c41a9feb667ed3d2c by 180909 in branch 'main': bpo-45114: Use lstat() instead of stat() in stat docs example (GH-29845) https://github.com/python/cpython/commit/c93a0ac6972221787d8bea1c41a9feb667ed3d2c -

[issue45114] bad example for os.stat

2022-04-02 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue45584] Clarifying truncating in documentation

2022-04-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset ebbdbbff5d6840807e46ec61b8a323e94ee88de2 by Arthur Milchior in branch 'main': bpo-45584: Clarify `math.trunc` documentation (GH-29183) https://github.com/python/cpython/commit/ebbdbbff5d6840807e46ec61b8a323e94ee88de2 -

[issue45584] Clarifying truncating in documentation

2022-04-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks for the patch! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue47031] math.nan should note that NANs do not compare equal to anything

2022-04-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks for the bug report and patch! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue47206] pickle docs are wrong about nested classes

2022-04-03 Thread Jelle Zijlstra
New submission from Jelle Zijlstra : https://docs.python.org/3.10/library/pickle.html#what-can-be-pickled-and-unpickled says that only "classes that are defined at the top level of a module" can be pickled. But in fact these work fine in current Python, probably since 3.3 when __

[issue42012] typing support in wsgiref

2022-04-04 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: This seems useful to me but I don't have experience with wsgiref. pje is listed as the maintainer in the devguide but appears to be inactive. I'd suggest you open a PR and if anyone feels strongly against it, they can complain. -

[issue47219] asyncio with two interpreter instances

2022-04-04 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue47219> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue47097] Document PEP 646

2022-04-04 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset 38ae5b8c0c0b64ae6100b0dee8707d5ab769e381 by Matthew Rahtz in branch 'main': bpo-47097: Add documentation for TypeVarTuple (#32103) https://github.com/python/cpython/commit/38ae5b8c0c0b64ae6100b0dee8707d

[issue41233] Missing links to errnos on Built-in Exceptions page

2022-04-04 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset a74892cb2168d249d9a8c53fad605a5def9b41d4 by yyyan in branch 'main': bpo-41233: Add links to errnos referenced in exceptions docs (GH-21380) https://github.com/python/cpython/commit/a74892cb2168d249d9a8c53fad605a5def9b41d4 -

[issue41233] Missing links to errnos on Built-in Exceptions page

2022-04-04 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks for the patch! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue47007] [doc] str docs are inconsistent with special method lookup

2022-04-04 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset bb86d1d9fbd1888524e04475383f4ea764277f67 by Vanshaj Singhania in branch 'main': bpo-47007: [doc] `str` special method lookup (GH-31863) https://github.com/python/cpython/commit/bb86d1d9fbd1888524e04475383f4ea764277f67 -

[issue46998] Allow subclassing Any at runtime

2022-04-04 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset 5a4973e29f2f5c4ee8c086f40325786c62381540 by Shantanu in branch 'main': bpo-46998: Allow subclassing Any at runtime (GH-31841) https://github.com/python/cpython/commit/5a4973e29f2f5c4ee8c086f4032578

[issue46998] Allow subclassing Any at runtime

2022-04-04 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks for the idea and patch! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue45790] Inaccurate phrasing in extending/newtypes_tutorial

2022-04-04 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset b275267aa7d44ec90fa435c9cb1610c549da745a by rtobar in branch 'main': bpo-45790: List macros in same order in which fields are described (GH-29529) https://github.com/python/cpython/commit/b275267aa7d44ec90fa435c9cb1610

[issue47007] [doc] str docs are inconsistent with special method lookup

2022-04-04 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks for the report and fix! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue45790] Inaccurate phrasing in extending/newtypes_tutorial

2022-04-04 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- pull_requests: +30382 pull_request: https://github.com/python/cpython/pull/32321 ___ Python tracker <https://bugs.python.org/issue45

[issue45790] Inaccurate phrasing in extending/newtypes_tutorial

2022-04-04 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks for noticing and fixing! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue32658] Metacharacter (\) documentation suggestion

2022-04-04 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset 43571a3eea8b5931769376daf4bdad1c9184ae0d by Mike cm in branch 'main': bpo-32658: Regex docs: Fix metacharacter reference (GH-32230) https://github.com/python/cpython/commit/43571a3eea8b5931769376daf4bdad1c9184ae0d -

[issue32658] Metacharacter (\) documentation suggestion

2022-04-04 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks for the patch! -- ___ Python tracker <https://bugs.python.org/issue32658> ___ ___ Python-bugs-list mailing list Unsub

[issue43224] Add support for PEP 646

2022-04-04 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset 772d8080c9fd635c3999673ca9fad8b674385c7f by Matthew Rahtz in branch 'main': bpo-43224: typing: Add tests for pickling and copying of unpacked native tuple (GH-32159) https://github.com/python/cpyt

[issue40982] copytree example in shutil

2022-04-04 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset e06f920c5bc6e9fad29082ba0d84043722806e17 by Zackery Spytz in branch 'main': bpo-40982: shutil docs: Remove outdated copytree() example (GH-24778) https://github.com/python/cpython/commit/e06f920c5bc6e9fad29082ba0d8404

[issue40982] copytree example in shutil

2022-04-04 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks for the report and patch! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue45790] Inaccurate phrasing in extending/newtypes_tutorial

2022-04-04 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset d1fb16ae286795abe3e9da86332c891b4b18826f by Jelle Zijlstra in branch '3.9': [3.9] bpo-45790: List macros in same order in which fields are described (GH-29529) (GH-32321) https://github.com/python/cpyt

[issue41930] Wrap sqlite3_serialize API in sqlite3 module

2022-04-05 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset a7551247e7cb7010fb4735281f1afa4abeb8a9cc by Erlend Egeberg Aasland in branch 'main': bpo-41930: Add support for SQLite serialise/deserialise API (GH-26728) https://github.com/python/cpython/commit/a7551247e7cb7010fb4735281f1afa

[issue41930] Wrap sqlite3_serialize API in sqlite3 module

2022-04-05 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks, this will be in Python 3.11. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue47088] Implement PEP 675 (LiteralString)

2022-04-05 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset cfb849a326e52a4edc577112ebf60e1d9d0d7fdb by Jelle Zijlstra in branch 'main': bpo-47088: Add typing.LiteralString (PEP 675) (GH-32064) https://github.com/python/cpython/commit/cfb849a326e52a4edc577112ebf60e

[issue47088] Implement PEP 675 (LiteralString)

2022-04-05 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue47234] PEP-484 "numeric tower" approach makes it hard/impossible to specify contracts in documentation

2022-04-05 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks for your report, but I would appreciate a more concise explanation. Let me try to rephrase the problem. Given this function: def mean(x: list[float]) -> float: return sum(x) / len(x) We want to provide a guarantee that if x is a nonempty l

[issue47237] Inheritance from base class with property in class makes them non-instantiatable

2022-04-06 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I think the behavior with regular classes is expected (that's just how inheritance works), but a case could be made that dataclasses should handle this case specially. -- ___ Python tracker &

[issue47254] enhanced dir?

2022-04-07 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: This would be nice, but backward compatibility alone means we can't change dir() to return a dictionary. What you propose would make more sense as a new function, perhaps in a package like pydoc or a third-party tool like IPython. --

[issue47255] Many broken :meth: roles in the docs

2022-04-07 Thread Jelle Zijlstra
New submission from Jelle Zijlstra : The docs for the hash() builtin use :meth:`__hash__`, but this doesn't actually link to the datamodel documentation for __hash__: it needs :meth:`~object.__hash__` instead. I'm fixing this in the builtin functions docs, but there are probably mo

[issue47255] Many broken :meth: roles in the docs

2022-04-07 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- keywords: +patch pull_requests: +30435 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32409 ___ Python tracker <https://bugs.python.org/issu

[issue47255] Many broken :meth: roles in the docs

2022-04-07 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: There are a lot of places in the rest of the docs that have the same problem: Doc % git grep ':meth:`__' | grep -v whatsnew | wc -l 610 I wonder if we can make the :meth: role globally default to linking to object.__dunder__. Would that

[issue46981] Empty typing.Tuple

2022-04-07 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I tried out 3.11 on my pyanalyze type checker and got some failures because of this change, because my previous trick for distinguishing between Tuple and Tuple[()] failed. 3.10: >>> from typing import get_args, Tuple >>&

[issue47087] Implement PEP 655 (Required/NotRequired)

2022-04-08 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- keywords: +patch pull_requests: +30444 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32419 ___ Python tracker <https://bugs.python.org/issu

[issue43616] random.shuffle() crashes with Unhandled exception

2021-03-24 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Could you post code that fully reproduces the problem? I suspect the root cause for the bug is in lxml (a third-party library), not in CPython itself. -- nosy: +Jelle Zijlstra ___ Python tracker <ht

[issue37804] Remove Thread.isAlive in Python 3.9

2021-04-01 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: The threading documentation for 3.9 still claims "While they are not listed below, the camelCase names used for some methods and functions in this module in the Python 2.x series are still supported by this module." It would be better to me

[issue37804] Remove Thread.isAlive in Python 3.9

2021-04-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Sure, I can submit a PR. While we're at it, we should probably also deprecate the setter/getter methods that you mention. Here's what I propose doing: - On 3.10 (or 3.11 if it's too late for 3.10), make getName and friends throw a Dep

[issue43723] Deprecate camelCase aliases from threading.py

2021-04-03 Thread Jelle Zijlstra
New submission from Jelle Zijlstra : Followup from issue37804: deprecate the remaining camelCase aliases, such as threading.currentThread. PR coming soon. -- assignee: Jelle Zijlstra components: Library (Lib) messages: 390165 nosy: Jelle Zijlstra, pitrou priority: normal severity

[issue43723] Deprecate camelCase aliases from threading.py

2021-04-03 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- keywords: +patch pull_requests: +23915 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25174 ___ Python tracker <https://bugs.python.org/issu

[issue37804] Remove Thread.isAlive in Python 3.9

2021-04-03 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- pull_requests: +23916 pull_request: https://github.com/python/cpython/pull/25174 ___ Python tracker <https://bugs.python.org/issue37

[issue43783] Make ParamSpec.args/kwargs more useful objects

2021-04-08 Thread Jelle Zijlstra
New submission from Jelle Zijlstra : Currently, typing.ParamSpec.args and ParamSpec.kwargs are just object() instances, which makes them useless for runtime inspection of __annotations__. This type was introduced by PEP 612. Instead, I propose to make them return some special helper object

[issue43783] Make ParamSpec.args/kwargs more useful objects

2021-04-08 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- assignee: -> Jelle Zijlstra ___ Python tracker <https://bugs.python.org/issue43783> ___ ___ Python-bugs-list mailing list Un

[issue43783] Make ParamSpec.args/kwargs more useful objects

2021-04-08 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- keywords: +patch pull_requests: +24029 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25298 ___ Python tracker <https://bugs.python.org/issu

[issue43803] ctypes string_at/wstring_at bad argument name

2021-04-10 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: It's a bit worse: the actual name is "ptr", the function docstrings say "addr", and the documentation (https://docs.python.org/3.9/library/ctypes.html#ctypes.string_at) has "address". I'd favor updating them all to

[issue43772] Minor repr error in typing.TypeVar.__ror__()

2021-04-10 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- keywords: +patch nosy: +Jelle Zijlstra nosy_count: 4.0 -> 5.0 pull_requests: +24074 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/25339 ___ Python tracker

[issue43817] Add typing.get_annotations()

2021-04-12 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- nosy: +Jelle Zijlstra ___ Python tracker <https://bugs.python.org/issue43817> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43817] Add inspect.get_annotations()

2021-04-26 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I agree with Guido that it's better to design inspect.signature to not throw an error for annotations that don't eval() cleanly. I use inspect.signature for getting information about callables (third-party and first-party) in my type check

[issue32891] Add 'Integer' as synonym for 'Integral' in numbers module.

2021-04-26 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Like Mark I'm opposed to this change. It requires little work in CPython itself, but numbers.Integral has now been a part of the language for many years and the name is used in numerous third-party projects. Forcing all of them to change doesn&#

[issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules

2021-04-27 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: For what it's worth, I checked grep.app and found only one usage of del on __annotations__, in a test suite: https://github.com/go-python/gpython/blob/master/py/tests/function.py#L82. Changing its behavior seems very low risk. -- nosy: +

[issue44001] typing.Literal: args must be hashable, not immutable

2021-05-01 Thread Jelle Zijlstra
New submission from Jelle Zijlstra : After the changes from bpo-42345, the Literal documentation claims that "Literal objects will now raise a TypeError exception during equality comparisons if one of their parameters are not immutable." But in fact it's *unhashable* type

[issue44000] Current PY_VERSION 3.10.0a7+ does not conform to PEP 440

2021-05-01 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: PEP 440 applies to Python packages, not to CPython itself. The "+" convention has been used in CPython for a long time, and changing it without a strong justification seems risky. -- nosy: +Jelle Zijlstra -lukasz.langa, ned.deily,

[issue44000] Current PY_VERSION 3.10.0a7+ does not conform to PEP 440

2021-05-01 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- nosy: +lukasz.langa, ned.deily, pablogsal ___ Python tracker <https://bugs.python.org/issue44000> ___ ___ Python-bugs-list mailin

[issue44006] symbol documentation still exists

2021-05-01 Thread Jelle Zijlstra
New submission from Jelle Zijlstra : symbol is being removed in 3.10, but https://docs.python.org/3.10/library/symbol.html still exists and claims it will be removed in "future versions". It was removed in bpo-40939 / GH-21005. -- assignee: docs@python components: Doc

[issue44006] symbol documentation still exists

2021-05-01 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: You're right, the file doesn't exist on master. I guess there must be some sort of caching. For what it's worth, I found it by going to the module documentation on an earlier version and using the dropdown to navigate to 3.10. If you go to

[issue41232] Python `functools.wraps` doesn't deal with defaults correctly

2021-05-01 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: We should not do this, because the wrapping function may have different defaults, and updating __defaults__ would make it use the wrapped function's defaults. Example: >>> def f(y=1): ... print(y) ... >>> f() 1 >&g

[issue41232] Python `functools.wraps` doesn't deal with defaults correctly

2021-05-01 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: That's because inspect.signature by default follows the `.__wrapped__` attribute, so it gives you the signature for the *wrapped* function. That behavior is occasionally problematic (I ran into it in the context of https://github.com/quora/pyanalyze/i

[issue41232] Python `functools.wraps` doesn't deal with defaults correctly

2021-05-01 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: We could add a new argument to `@functools.wraps()` to differentiate between a wrapper with the same signature and one with a different signature. Here's a possible design: * functools.wraps adds a new keyword-only argument signature_changed. It defaul

[issue28556] typing.py upgrades

2021-05-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Looks like this is no longer relevant. -- nosy: +Jelle Zijlstra resolution: -> out of date stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue32752] no information about accessing typing.Generic type arguments

2021-05-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: We have typing.get_args() as of 3.8. -- nosy: +Jelle Zijlstra resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37923] Combining typing.get_type_hints and inspect.signature

2021-05-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: As of Python 3.10, thanks to Larry Hastings inspect.signature will have a new eval_str= parameter that lets you evaluate string annotations. This isn't quite what you're asking for, though, because typing.get_type_hints does more work than eva

[issue40397] Refactor typing._GenericAlias

2021-05-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Looks like there's nothing left to do here. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.pyth

[issue34568] Types in `typing` not anymore instances of `type` or subclasses of "real" types

2021-05-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: More recent versions of typing have added some helper functions that could be useful here, like typing.get_origin and typing.get_args. I'm going to close this issue because I don't think there's anything actionable. ------ nosy:

[issue42001] Deprecate `typing.io` Wrapper Namespace

2021-05-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Closing as a duplicate of https://bugs.python.org/issue38291 -- nosy: +Jelle Zijlstra resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-05-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: The documentation (https://docs.python.org/3.10/library/typing.html#typing.BinaryIO) now mentions the typing.io and typing.re namespaces. I would prefer that they be deprecated and eventually completely removed. They don't work with most static

[issue38352] In typing docs, note explicit import needed for IO and Pattern/Match

2021-05-02 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: It turns out that IO, TextIO, BinaryIO, Match, and Pattern aren't in typing.__all__. As Walter points out above, there's no clear reason for this. I am submitting a PR to add them to __all__. -- nosy: +Jell

[issue38352] In typing docs, note explicit import needed for IO and Pattern/Match

2021-05-02 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- keywords: +patch pull_requests: +24508 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25821 ___ Python tracker <https://bugs.python.org/issu

[issue44006] symbol documentation still exists

2021-05-03 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Thanks Julien! I noticed two other libraries in the same situation: https://docs.python.org/3.10/library/formatter.html and https://docs.python.org/3.10/library/parser.html. The RST files for both are also gone from master. Could you purge the cache for

[issue44001] typing.Literal: args must be hashable, not immutable

2021-05-03 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- keywords: +patch pull_requests: +24554 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25877 ___ Python tracker <https://bugs.python.org/issu

[issue38352] In typing docs, note explicit import needed for IO and Pattern/Match

2021-05-04 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: @Łukasz thanks for your merging spree! I'm actually not sure this should go into 3.9. Seems potentially dangerous that people upgrading from an earlier 3.9 patch release will now see new names injected into their namespace if they do `from typing i

[issue43355] __future__.annotations breaks inspect.signature()

2021-05-04 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Python 3.10 will add an eval_str= argument to inspect.signature() that lets you evaluate string annotations. I don't think it makes sense to change anything in the bugfix branches, so I propose that this issue be closed. -- nosy: +Jelle Zij

[issue44001] typing.Literal: args must be hashable, not immutable

2021-05-04 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- pull_requests: +24569 pull_request: https://github.com/python/cpython/pull/25897 ___ Python tracker <https://bugs.python.org/issue44

[issue44037] Broad performance regression from 3.10a7 to 3.10b1

2021-05-04 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- nosy: +Jelle Zijlstra ___ Python tracker <https://bugs.python.org/issue44037> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44033] Adding multiple keys of the same name to a dict doesn't raise an exception

2021-05-04 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Looks like the same issue to me as the rejected issue that Karthikeyan mentioned. Changing it to use the first value is a non-starter because it would break compatibility. I'd suggest using a linter that warns about duplicate keys in literal

[issue44064] Python39/lib/logging/__init__.py SyntaxError: cannot delete starred

2021-05-06 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Line 1030 of 3.9.4 is at https://github.com/python/cpython/blob/1f2e3088f3c097b5bde69bbd63dfcd0852d31984/Lib/logging/__init__.py#L1030 and doesn't have a del statement or a syntax error. Most likely there's some mismatch where you're ru

<    1   2   3   4   5   6   >