New submission from Jelle :
Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49)
[GCC 4.3.2] on linux2
>>> print cPickle.dumps(('a','b')) == cPickle.dumps(('a', str('b')))
False
>>> print pickle.dumps(('a','
Changes by Jelle :
--
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue5866>
___
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.p
New submission from Jelle Zijlstra :
With Irit's recent changes (bpo-45711), the (typ, exc, tb) tuple is now always
redundant with just exc. As a result, `__exit__` methods now should only need
to accept a single argument. If we were designing the context manager protocol
from scratc
Jelle Zijlstra added the comment:
Thanks, that would work in normal cases but can cause issues if __exit__ takes
*args. Still, that may be enough of an edge case that we can get it to work.
--
___
Python tracker
<https://bugs.python.
New submission from Jelle Zijlstra :
Currently, @typing.final is implemented as an identity function, which makes it
impossible for type checkers that look at runtime objects to support it.
I propose that we implement it as something like:
def final(f):
try:
f
Change by Jelle Zijlstra :
--
keywords: +patch
pull_requests: +28732
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30530
___
Python tracker
<https://bugs.python.org/issu
Change by Jelle Zijlstra :
--
nosy: +Jelle Zijlstra
___
Python tracker
<https://bugs.python.org/issue46371>
___
___
Python-bugs-list mailing list
Unsubscribe:
Jelle Zijlstra added the comment:
The additional tests would also be useful to have in
https://github.com/python/typing/tree/master/typing_extensions if you're
interested.
--
nosy: +Jelle Zijlstra
___
Python tracker
<https://bugs.py
New submission from Jelle Zijlstra :
The `reveal_type()` primitive is injected by type checkers into the builtins.
When the type checker sees a call, it prints the inferred type of the argument.
This has been implemented across all type checkers, but adding an
implementation to `typing
Change by Jelle Zijlstra :
--
keywords: +patch
pull_requests: +28848
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30646
___
Python tracker
<https://bugs.python.org/issu
Jelle Zijlstra added the comment:
The types of `.keys()`, `.items()`, and `.values()` on
`collections.OrderedDict` are distinct from those for dict, and they are also
not exposed anywhere. Should we put them in a public, documented place too for
consistency?
>>> import collectio
Jelle Zijlstra added the comment:
I see the concerns about exposing too many implementation details.
But I'm also not sure how much this will really help static typing use cases.
Alex's examples just call super().keys(), but if you do that, there's not much
point in overridin
Jelle Zijlstra added the comment:
Mike's fix unfortunately didn't work out.
What are the rules about closing old enhancement requests? modulefinder is an
old and rarely used package, and I feel like the use case is better served by a
PyPI package.
--
nosy: +Jell
Jelle Zijlstra added the comment:
Perhaps it's testing that the implicit `del` doesn't blow up if the variable is
already deleted.
--
nosy: +Jelle Zijlstra
___
Python tracker
<https://bugs.python.o
Jelle Zijlstra added the comment:
This behavior is definitely unfortunate, but by now it's also been baked into
more than a decade of Python 3 releases, so backward compatibility constraints
make it difficult to fix.
How can we be sure this change won't break users' code?
Jelle Zijlstra added the comment:
Duplicate of issue46141.
--
nosy: +Jelle Zijlstra
resolution: -> duplicate
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Jelle Zijlstra :
--
nosy: +Jelle Zijlstra
___
Python tracker
<https://bugs.python.org/issue46448>
___
___
Python-bugs-list mailing list
Unsubscribe:
Jelle Zijlstra added the comment:
This sounds like a consequence of PEP 446.
--
nosy: +Jelle Zijlstra
___
Python tracker
<https://bugs.python.org/issue46
Jelle Zijlstra added the comment:
I don't think we should merge this change. get_type_hints() is fragile and full
of corner cases around using the right globals and locals dictionaries.
dataclasses shouldn't execute it implicitly for you.
--
nosy: +Jelle Zijlstra
version
Jelle Zijlstra added the comment:
I think this should be fixed in typing.py instead. get_type_hints() should be
less strict about what it accepts as a type, so users are free to use
annotations in innovative ways.
Static type checkers should have the job of enforcing that type annotations
New submission from Jelle Zijlstra :
"python -m http.server" works and listens on port 8000, but the docs suggest
you always have to pass the port. PR incoming.
--
assignee: Jelle Zijlstra
components: Documentation
messages: 411230
nosy: Jelle Zijlstra
priority: norma
Change by Jelle Zijlstra :
--
keywords: +patch
pull_requests: +28961
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30776
___
Python tracker
<https://bugs.python.org/issu
Jelle Zijlstra added the comment:
Let's change typing_extensions.py too in the same way.
Speaking of typing-extensions, it'd be great if someone could review
https://github.com/python/typing/pull/963 :)
--
___
Python track
New submission from Jelle Zijlstra :
At the moment, https://docs.python.org/3.10/library/typing.html#typing.NoReturn
simply says:
Special type indicating that a function never returns.
In practice, type checkers accept NoReturn as a bottom type in other positions
too. We should document
Change by Jelle Zijlstra :
--
components: +Library (Lib)
versions: +Python 3.10, Python 3.11, Python 3.9
___
Python tracker
<https://bugs.python.org/issue46
Jelle Zijlstra added the comment:
PEP 549 lists nis among modules to be removed:
https://www.python.org/dev/peps/pep-0594/#nis
For what it's worth, when I built 3.11 from source on Ubuntu 16.04 I managed to
build the nis extension, without installing any special libraries
New submission from Jelle Zijlstra :
Implement typing.reveal_locals() as proposed in
https://mail.python.org/archives/list/typing-...@python.org/thread/5MGN6HZWTJELNLIUOXTHLIXVLKZCEWY2/.
This is a marker for type checkers that causes them to emit the types of all
local variables
New submission from Jelle Zijlstra :
Implement typing.assert_type as proposed in
https://mail.python.org/archives/list/typing-...@python.org/thread/MITFQ6Z45RRMXY3HNM66IC3XXS3TA3JN/.
This is a special primitive that asserts to the type checker what the type of
an expression is.
Tentatively
Jelle Zijlstra added the comment:
The PR was closed for lack of interest.
--
resolution: -> wont fix
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Jelle Zijlstra :
--
assignee: Jelle Zijlstra ->
___
Python tracker
<https://bugs.python.org/issue27219>
___
___
Python-bugs-list mailing list
Un
Jelle Zijlstra added the comment:
Based on feedback here and on typing-sig I'm now leaning towards adding
typing.Never along with typing.assert_never. I'll submit a single patch for
these as the documentation will be closely linked.
--
title: Document use of NoReturn a
Jelle Zijlstra added the comment:
I support making this change. It looks like the simplest implementation is
simply to remove the mention of ClassVar and Final in typing._type_check.
--
components: +Library (Lib)
nosy: +Jelle Zijlstra, gvanrossum, kj
Change by Jelle Zijlstra :
--
keywords: +patch
pull_requests: +29022
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30839
___
Python tracker
<https://bugs.python.org/issu
Change by Jelle Zijlstra :
--
keywords: +patch
pull_requests: +29023
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30842
___
Python tracker
<https://bugs.python.org/issu
Change by Jelle Zijlstra :
--
keywords: +patch
pull_requests: +29024
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30843
___
Python tracker
<https://bugs.python.org/issu
New submission from Jelle Zijlstra :
I've often seen people say things like "I can't use TypeGuard yet, I'm stuck on
3.9". That's not true, because the typing_extensions package backports all
typing features to all supported Python versions.
To help make p
Jelle Zijlstra added the comment:
lib2to3 is deprecated as of Python 3.11, and there's an available workaround. I
don't think it still makes sense to change anything here.
--
nosy: +Jelle Zijlstra
resolution: -> wont fix
stage: patch review -> resolved
status
Jelle Zijlstra added the comment:
I suggest we mark the method as deprecated and remove it in 3.13.
Making the argparse objects public can be done in a separate enhancement
request if there is demand for it.
--
nosy: +Jelle Zijlstra
___
Python
Jelle Zijlstra added the comment:
If the old code is incorrect, can you give an example where it fails? Is it
possible to write a unit test demonstrating that the current behavior is wrong?
--
nosy: +Jelle Zijlstra
___
Python tracker
<ht
Change by Jelle Zijlstra :
--
nosy: +Jelle Zijlstra
___
Python tracker
<https://bugs.python.org/issue46483>
___
___
Python-bugs-list mailing list
Unsubscribe:
Jelle Zijlstra added the comment:
The linked PR makes `T = TypeVar("T"); T[int]` work. That's not currently
meaningful syntax to the type checker, but we may want it in the future for
higher-kinded types. I would rather not make this change without a clear static
typing u
Jelle Zijlstra added the comment:
Related: issue44799 about InitVar.
--
___
Python tracker
<https://bugs.python.org/issue46511>
___
___
Python-bugs-list mailin
Change by Jelle Zijlstra :
--
nosy: +BTaskaya, Jelle Zijlstra, benjamin.peterson, pablogsal
___
Python tracker
<https://bugs.python.org/issue46520>
___
___
Pytho
Change by Jelle Zijlstra :
--
nosy: +Jelle Zijlstra
___
Python tracker
<https://bugs.python.org/issue41370>
___
___
Python-bugs-list mailing list
Unsubscribe:
Jelle Zijlstra added the comment:
I can confirm that the behavior changed between 3.10 and current main:
enumerate(iterable=[]) works on 3.10 but not on main. It's likely a consequence
of bpo-43706.
I'll submit a patch to restore the previous behavior.
--
nosy: +Jell
Change by Jelle Zijlstra :
--
nosy: +Jelle Zijlstra
nosy_count: 4.0 -> 5.0
pull_requests: +29083
pull_request: https://github.com/python/cpython/pull/30904
___
Python tracker
<https://bugs.python.org/issu
Change by Jelle Zijlstra :
--
keywords: +patch
pull_requests: +29082
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30904
___
Python tracker
<https://bugs.python.org/issu
New submission from Jelle Zijlstra :
sys._getframe() has to create frame objects, which is relatively expensive.
Usually the calling function object should be enough.
See https://github.com/faster-cpython/ideas/discussions/238
--
assignee: Jelle Zijlstra
components: Interpreter Core
Change by Jelle Zijlstra :
--
keywords: +patch
pull_requests: +29129
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30950
___
Python tracker
<https://bugs.python.org/issu
Change by Jelle Zijlstra :
--
nosy: +Jelle Zijlstra
___
Python tracker
<https://bugs.python.org/issue44791>
___
___
Python-bugs-list mailing list
Unsubscribe:
Jelle Zijlstra added the comment:
I vote we don't change this. PEP 484 says:
> The string literal should contain a valid Python expression (i.e.,
> compile(lit, '', 'eval') should be a valid code object) and it should
> evaluate without errors once the m
Change by Jelle Zijlstra :
--
nosy: +AlexWaygood, gvanrossum, kj, sobolevn
___
Python tracker
<https://bugs.python.org/issue46552>
___
___
Python-bugs-list mailin
Jelle Zijlstra added the comment:
Thanks for noticing! Would you like to submit a PR to fix it?
--
nosy: +Jelle Zijlstra
___
Python tracker
<https://bugs.python.org/issue46
Jelle Zijlstra added the comment:
Thanks for your report!
I think you're looking for the Literal type.
Also, new typing behaviors are better discussed first on
https://github.com/python/typing or the typing-sig mailing list.
--
nosy: +Jelle Zijlstra
resolution: -> lat
Jelle Zijlstra added the comment:
Let's not jump into deprecating it.
I think (2) makes the most sense. If we can get that working reliably (using
__qualname__ I assume), it would be my preference; otherwise we should do (1).
This problem can also affect function objects, right? `cl
Jelle Zijlstra added the comment:
1. Less change in behavior
2. From the purpose of the decorator, it makes sense for it to apply to nested
classes as well as methods, even if the docs don't say so explicitly.
--
___
Python tracker
&
Jelle Zijlstra added the comment:
I think we could do it by looking at __qualname__.
--
___
Python tracker
<https://bugs.python.org/issue46571>
___
___
Pytho
Change by Jelle Zijlstra :
--
nosy: +Jelle Zijlstra
___
Python tracker
<https://bugs.python.org/issue43224>
___
___
Python-bugs-list mailing list
Unsubscribe:
Jelle Zijlstra added the comment:
I stumbled upon the PR and tend to agree with Serhiy that this could be a
source of nasty bugs. Passing the wrong type to a va_arg() argument is
undefined behavior (e.g.
https://wiki.sei.cmu.edu/confluence/display/c/EXP47-C.+Do+not+call+va_arg+with+an
Jelle Zijlstra added the comment:
I'd also be wary about making changes that introduce additional runtime checks.
As we've seen with the PEP 612 and 646 implementations, those can impede future
iteration on typing.
--
___
Python track
Jelle Zijlstra added the comment:
Withdrawn as there's insufficient demand for this function.
--
resolution: -> rejected
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.pyth
Jelle Zijlstra added the comment:
I agree with removing this check. I suspect it's a holdover from very early
typing when static types were supposed to be runtime types. Now the check is a
bug magnet and doesn't serve a useful purpose.
I think we can just remove the tests that
Jelle Zijlstra added the comment:
PEP 673 (which was accepted) adds typing.Self already. bpo-46534 tracks
implementing it.
--
___
Python tracker
<https://bugs.python.org/issue46
New submission from Jelle Zijlstra :
https://docs.python.org/3.10/library/typing.html#typing.TypedDict
It says:
> To allow using this feature with older versions of Python that do not support
> PEP 526, TypedDict supports two additional equivalent syntactic forms
But there is another
Jelle Zijlstra added the comment:
The conventional way is to write
def __exit__(
self,
__typ: type[BaseException] | None,
__exc: BaseException | None,
__tb: types.TracebackType | None,
) -> None: ...
But there are two invariants about how __exit__ works in practice that t
Change by Jelle Zijlstra :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Jelle Zijlstra added the comment:
Thanks for catching these details! Please send a PR.
--
___
Python tracker
<https://bugs.python.org/issue46685>
___
___
Pytho
Jelle Zijlstra added the comment:
Welcome to this project, Meer!
That looks pretty good, feel free to submit a PR. We can then perhaps get
feedback from more people to improve the wording.
--
___
Python tracker
<https://bugs.python.
Jelle Zijlstra added the comment:
> How do I find other instances of this problem? Is there a systematic way to
> look for such references?
You could write a script that goes something like this, iterating over all the
docs RST files:
- Find all definitions in the file (e.g. `.. dec
Jelle Zijlstra added the comment:
Please do submit a PR! Agree that more examples of inheritance and attributes
would be useful.
Note that we're about to deprecate the keyword argument syntax (issue46066).
--
___
Python tracker
&
Jelle Zijlstra added the comment:
I'd lean towards keeping this syntax:
- It's already been out for two releases, so there's user code out there
relying on it. (In fact we found out about this because somebody complained
that Black's parser couldn't handle this
Change by Jelle Zijlstra :
--
nosy: +Jelle Zijlstra
___
Python tracker
<https://bugs.python.org/issue46724>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Jelle Zijlstra :
The shutil documentation doesn't say anything about bytes paths, and the
CPython unit tests don't test them. But some functions do work with bytes paths
in practice, and on typeshed we've received some requests to add support for
them in
New submission from Jelle Zijlstra :
>>> None.__bool__.__doc__
'self != 0'
This isn't true, since None does not equal 0. I suggest rewording it to "True
if self else False".
--
assignee: Jelle Zijlstra
components: Interpreter Core
messages: 41
Change by Jelle Zijlstra :
--
keywords: +patch
pull_requests: +29460
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31301
___
Python tracker
<https://bugs.python.org/issu
Change by Jelle Zijlstra :
--
nosy: +Jelle Zijlstra
___
Python tracker
<https://bugs.python.org/issue46743>
___
___
Python-bugs-list mailing list
Unsubscribe:
Jelle Zijlstra added the comment:
Note that telnetlib is being proposed for deprecation in PEP 594. You may be
better off using a third-party telnet implementation; the PEP lists
https://pypi.org/project/telnetlib3/ and https://pypi.org/project/Exscript/.
--
nosy: +Jelle Zijlstra
Change by Jelle Zijlstra :
--
nosy: +Jelle Zijlstra
___
Python tracker
<https://bugs.python.org/issue46760>
___
___
Python-bugs-list mailing list
Unsubscribe:
Jelle Zijlstra added the comment:
Looks like this is a duplicate of issue46736. Seems like a good idea though!
--
nosy: +Jelle Zijlstra
resolution: -> duplicate
stage: -> resolved
status: open -> closed
___
Python tracke
Jelle Zijlstra added the comment:
New changeset de6043e596492201cc1a1eb28038970bb69f3107 by 97littleleaf11 in
branch 'main':
bpo-46066: Deprecate kwargs syntax for TypedDict definitions (GH-31126)
https://github.com/python/cpython/commit/de6043e596492201cc1a1eb2803897
Change by Jelle Zijlstra :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Jelle Zijlstra added the comment:
New changeset 6e7b813195f9bd6a2a15c1f00ef2c0180f6c751a by aha79 in branch
'main':
bpo-46333: Honor `module` parameter in ForwardRef (GH-30536)
https://github.com/python/cpython/commit/6e7b813195f9bd6a2a15c1f00ef2c0
Change by Jelle Zijlstra :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Jelle Zijlstra added the comment:
New changeset 482a4b6c3f8ef60056e85647a1d84af2e6dfd3ef by Robert-André Mauchin
in branch 'main':
bpo-46745: Fix typo in PositionsIterator (#31322)
https://github.com/python/cpython/commit/482a4b6c3f8ef60056e85647a1d84af2e6dfd3ef
--
no
Jelle Zijlstra added the comment:
New changeset 395029b0bd343648b4da8044c7509672ea768775 by Nikita Sobolev in
branch 'main':
bpo-46571: improve `typing.no_type_check` to skip foreign objects (GH-31042)
https://github.com/python/cpython/commit/395029b0bd343648b4da8044c75096
Jelle Zijlstra added the comment:
New changeset 25c0b9d243b64ccd2eeab483089eaf7e4b4d5834 by Nikita Sobolev in
branch 'main':
bpo-46603: improve coverage of `typing._strip_annotations` (GH-31063)
https://github.com/python/cpython/commit/25c0b9d243b64ccd2eeab483089eaf
Change by Jelle Zijlstra :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Jelle Zijlstra added the comment:
Thanks for the fix Nikita!
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Jelle Zijlstra added the comment:
New changeset 32e3e0bea613711a8f19003445eebcb05fb75acc by Nikita Sobolev in
branch 'main':
bpo-46685: improve test coverage of `Self` and `Never` in `typing` (GH-31222)
https://github.com/python/cpython/commit/32e3e0bea613711a8f19003445eebc
Change by Jelle Zijlstra :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Jelle Zijlstra added the comment:
I'm looking at https://github.com/python/cpython/pull/30969 and I'm not sure
what the motivation for the change is. PEP 612 is quite precise here
(https://www.python.org/dev/peps/pep-0612/#id1) and allows only a ParamSpec as
the last argument to C
Jelle Zijlstra added the comment:
Thanks, I'll send a PR.
--
___
Python tracker
<https://bugs.python.org/issue46066>
___
___
Python-bugs-list mailing list
Change by Jelle Zijlstra :
--
pull_requests: +29563
pull_request: https://github.com/python/cpython/pull/31428
___
Python tracker
<https://bugs.python.org/issue46
Jelle Zijlstra added the comment:
New changeset 0a8a8e7454c6565cf1554d5f23314e4c70960bcd by Jelle Zijlstra in
branch 'main':
bpo-46066: Check DeprecationWarning in test_typing (GH-31428)
https://github.com/python/cpython/commit/0a8a8e7454c6565cf1554d5f23314e
Jelle Zijlstra added the comment:
New changeset ba457fe6f8e50ad3ef3ceffb75dee96629a42ad7 by Erlend Egeberg
Aasland in branch '3.10':
[3.10] bpo-43853: Expand test suite for SQLite UDF's (GH-27642) (GH-31030)
https://github.com/python/cpython/commit/ba457fe6f8e50ad3ef3ceffb7
Change by Jelle Zijlstra :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
New submission from Jelle Zijlstra :
Currently, the implementation of @overload
(https://github.com/python/cpython/blob/59585d6b2ea50d7bc3a9b336da5bde61367f527c/Lib/typing.py#L2211)
simply returns a dummy function and throws away the decorated function. This
makes it virtually impossible for
Jelle Zijlstra added the comment:
Thanks! Closing this as a duplicate.
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> Improve help() by making typing.overload() information
accessible at runtime
__
Jelle Zijlstra added the comment:
I made a similar suggestion in issue46821 (thanks Alex for pointing me to this
older issue):
Currently, the implementation of @overload
(https://github.com/python/cpython/blob/59585d6b2ea50d7bc3a9b336da5bde61367f527c/Lib/typing.py#L2211)
simply returns a
Jelle Zijlstra added the comment:
I'm OK with not fully supporting overloads created in nested functions; that's
a pretty marginal use case. But it's true that my proposed implementation would
create a memory leak if someone does do that. I don't immediately see a w
1 - 100 of 509 matches
Mail list logo