Jelle Zijlstra added the comment:
"del t, v, tb" is perfectly legal Python syntax. It's whatever tool is showing
a syntax error there (jedi, apparently) that's buggy.
% python3.9
Python 3.9.4 (default, Apr 9 2021, 09:47:14)
[Clang 12.0.0 (clang-1200.0.32.29)]
New submission from Jelle Zijlstra :
In the 3.10 docs (but not 3.11 or 3.9) I see an extra copy of the table of
contents at the top of the page. Attached a screenshot.
--
assignee: docs@python
components: Documentation
files: Screen Shot 2021-05-10 at 9.11.51 AM.png
messages: 393416
Jelle Zijlstra added the comment:
> Can it be related to Sphinx version
That's a good guess since Sphinx 4 was released on May 8. I'm not sure if
Python would immediately pick that up though.
--
___
Python tracker
<https:/
Jelle Zijlstra added the comment:
Thanks, hard refresh does fix it.
--
___
Python tracker
<https://bugs.python.org/issue44103>
___
___
Python-bugs-list mailin
Change by Jelle Zijlstra :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue44152>
___
___
Python-bugs-list
Jelle Zijlstra added the comment:
I propose to deprecate socket.SocketType. There's no reason to publicly expose
_socket.socket separately from socket.socket, the only type that moat users
should care about.
SocketType isn't needed for type checking; socket.socket is itself a clas
Jelle Zijlstra added the comment:
The reason for this is that types.GenericAlias.__getattribute__ delegates to
the alias's origin (in the `ga_getattro` function). As a result,
`list[int].__class__` calls `list.__class__` and returns `type`. And the
implementation of `isinstance(obj,
Jelle Zijlstra added the comment:
https://github.com/python/typing/issues/746 has some previous discussion of
implementing NewType as a class (motivated by __repr__), including benchmarks.
--
___
Python tracker
<https://bugs.python.org/issue44
Jelle Zijlstra added the comment:
Closing as a duplicate of issue42575. Adding a linked list data structure to
Python is in any case probably better discussed on the python-ideas mailing
list and then in a PEP.
--
nosy: +Jelle Zijlstra
resolution: -> duplicate
stage: -> re
Change by Jelle Zijlstra :
--
nosy: +Jelle Zijlstra
___
Python tracker
<https://bugs.python.org/issue44414>
___
___
Python-bugs-list mailing list
Unsubscribe:
Jelle Zijlstra added the comment:
It could be useful for C extensions that want to support PEP 585 for their
types, such as numpy's array type.
--
nosy: +Jelle Zijlstra
___
Python tracker
<https://bugs.python.org/is
Jelle Zijlstra added the comment:
They'd still need runtime support from GenericAlias to allow users to write
`numpy.ndarray[int]` at runtime.
--
___
Python tracker
<https://bugs.python.org/is
New submission from Jelle Zijlstra :
https://docs.python.org/3/library/sysconfig.html#sysconfig.get_path says it
returns None if the name is not found, but the implementation
(https://github.com/python/cpython/blame/main/Lib/sysconfig.py) uses [] and
will raise KeyError instead.
Noticed by
Change by Jelle Zijlstra :
--
keywords: +patch
pull_requests: +25370
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/26785
___
Python tracker
<https://bugs.python.org/issu
Change by Jelle Zijlstra :
--
components: +Parser -Regular Expressions
nosy: +lys.nikolaou, pablogsal
type: performance -> behavior
___
Python tracker
<https://bugs.python.org/issu
Jelle Zijlstra added the comment:
I agree that this is a bug. `types.Union` is also missing a __getitem__
implementation.
And `typing.Union` supports pickling while `types.Union` doesn't:
>>> pickle.loads(pickle.dumps(int | str))
Traceback (most recent call last):
File
Change by Jelle Zijlstra :
--
nosy: +Jelle Zijlstra, kj
___
Python tracker
<https://bugs.python.org/issue44524>
___
___
Python-bugs-list mailing list
Unsub
Jelle Zijlstra added the comment:
ValueError would seem to be the right exception to use.
If this parameter were to be added (I'm not convinced that it should be), I'd
prefer to call it something more specific than "strict", since "strict" can
mean lots of th
Jelle Zijlstra added the comment:
Mypy is definitely not going to support direct access to `__parameters__`; what
Guido is referring to is whether usage of types.Union that would require
`__parameters__` at runtime is accepted by mypy.
For example, this:
from typing import TypeVar
T
Jelle Zijlstra added the comment:
I'd also be OK with returning a `types.GenericAlias(int | list[T], str)`, which
might be simpler. It doesn't matter for static type checkers, and runtime type
checkers can extract what they n
Change by Jelle Zijlstra :
--
nosy: +Jelle Zijlstra
___
Python tracker
<https://bugs.python.org/issue44646>
___
___
Python-bugs-list mailing list
Unsubscribe:
Jelle Zijlstra added the comment:
> Using `from __future__ import annotations` it should work
Not in type aliases or generic bases. (And if Larry's co_annotations PEP is
accepted, it would break in normal annotations too.) I'd prefer to get rid of
this sort of subtle differe
Jelle Zijlstra added the comment:
This is what I got last year (copied from the typing issues):
In [83]: from typing import NewType
In [84]: nt = NewType("nt", int)
In [85]: class NewTypeClass:
...: def __init__(self, name, supertype):
...: self.n
Jelle Zijlstra added the comment:
Does that work if you try to union two NewTypes?
--
___
Python tracker
<https://bugs.python.org/issue44353>
___
___
Python-bug
Jelle Zijlstra added the comment:
I found that replacing __call__ on the NewType class with an identity function
written in C makes things faster instead:
In [54]: %timeit ntc2(1)
79 ns ± 0.37 ns per loop (mean ± std. dev. of 7 runs, 1000 loops each)
In [55]: %timeit ntc(1)
126 ns
Jelle Zijlstra added the comment:
This sounds like a bug in the third-party library you're using, not in Python
itself. Could you report this bug to the library?
According to https://docs.python.org/3.9/library/collections.html, aliases like
collections.Mapping were removed fro
Jelle Zijlstra added the comment:
I agree that UnionType is marginally better so we should rename it. It doesn't
seem worth doing if this doesn't make it in in time for 3.10, though. With the
advent of PEP 604 typing.Union will hopefully become irrelevant.
--
nosy: +Jell
Change by Jelle Zijlstra :
--
nosy: +Jelle Zijlstra
___
Python tracker
<https://bugs.python.org/issue44925>
___
___
Python-bugs-list mailing list
Unsubscribe:
Jelle Zijlstra added the comment:
I don't think we need to support Annotated as a base class. PEP 593 is titled
"Flexible function and variable annotations", and base classes are neither of
those things. None of the examples in the PEP or the implementation use
Annotated
Change by Jelle Zijlstra :
--
nosy: +Jelle Zijlstra, kj
___
Python tracker
<https://bugs.python.org/issue45121>
___
___
Python-bugs-list mailing list
Unsub
Change by Jelle Zijlstra :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Jelle Zijlstra added the comment:
The most recent change here caused a regression. The following file:
```
from typing import Generic, TypeVar, Union
class CannotTransform(Exception): pass
T = TypeVar("T")
E = TypeVar("E", bound=Exception)
class Ok(Generic[T]): pass
Jelle Zijlstra added the comment:
Thanks Serhyi! I can confirm that the issue I posted is fixed.
--
priority: release blocker -> normal
___
Python tracker
<https://bugs.python.org/issu
New submission from Jelle Zijlstra :
$ gdb ./python
...
(gdb) r
...
Python 3.9.0b1 (tags/v3.9.0b1:97fe9cfd9f8, May 30 2020, 05:26:48)
...
>>> import io
>>> io.FileIO(0).name
0
>>>
Program received signal SIGSEGV, Segmentation fault.
_PyInterpreterState_G
New submission from Jelle Geerts :
This problem happened with 'python-3.8.6-embed-amd64.zip' when trying to import
certain modules.
Note that this problem does NOT happen with Python from
'python-3.7.9-embed-amd64.zip' (its output is also attached below).
It happened
Jelle Geerts added the comment:
Problem still occurs with newer KB3118401 installed (instead of KB2999226).
But good news:
Installing update KB3063858 (or the older KB2533623) resolves the issue.
That update adds the new kernel32.dll functions SetDefaultDllDirectories,
AddDllDirectory, and
Jelle Geerts added the comment:
> Mixed-language output is awkward. A common _Py_FormatMessage function could
> be added in 3.10 that tries getting an error message in English before trying
> to get it in the user's default language.
I agree that in general mixed-language can
Jelle Geerts added the comment:
Thanks to you too, Steve! *tips imaginary hat*
--
___
Python tracker
<https://bugs.python.org/issue42339>
___
___
Python-bug
Change by Jelle Zijlstra :
--
pull_requests: +13416
stage: test needed -> patch review
___
Python tracker
<https://bugs.python.org/issue33482>
___
___
Python-
Change by Jelle Zijlstra :
--
pull_requests: +13417
___
Python tracker
<https://bugs.python.org/issue33482>
___
___
Python-bugs-list mailing list
Unsubscribe:
Jelle Zijlstra added the comment:
As Ned and Christian hinted, the issue might be related to
--enable-optimizations. Have you tried compiling without that flag?
--
nosy: +Jelle Zijlstra
___
Python tracker
<https://bugs.python.org/issue37
New submission from Jelle Zijlstra:
This code in sre_parse (line 738 and down):
warnings.warn(
'Flags not at the start of the expression %s%s'
% (
source.string[:20], # truncate lo
Jelle Zijlstra added the comment:
I'm also concerned that the slowness of namedtuple creation is causing people
to avoid using it. I can see why we wouldn't want a complicated solution like
using Argument Clinic, but it's not clear to me why Serhiy's approach in
namedtu
Changes by Jelle Zijlstra :
--
pull_requests: +2796
___
Python tracker
<http://bugs.python.org/issue28638>
___
___
Python-bugs-list mailing list
Unsubscribe:
Jelle Zijlstra added the comment:
Should we consider a C-based implementation like
https://github.com/ll/cnamedtuple? It could improve speed even more,
but would be harder to maintain and test and harder to keep compatible. My
sense is that it's not worth it unless benchmarks s
Changes by Jelle Zijlstra :
--
resolution: rejected ->
___
Python tracker
<http://bugs.python.org/issue28638>
___
___
Python-bugs-list mailing list
Unsubscrib
Jelle Zijlstra added the comment:
I benchmarked some common namedtuple operations with the following script:
#!/bin/bash
echo 'namedtuple creation'
./python -m timeit -s 'from collections import namedtuple' 'x = namedtuple("x",
["a", "b&quo
Jelle Zijlstra added the comment:
Thanks Joe! I adapted your benchmark suite to also run my implementation. See
https://github.com/JelleZijlstra/cnamedtuple/commit/61b6fbf4de37f8131ab43c619593327004974e52
for the code and results. The results are consistent with what we've seen
before.
New submission from Jelle Zijlstra:
The documentation for traceback.format_tb says "Return a list of
“pre-processed” stack trace entries extracted from the traceback object tb. It
is useful for alternate formatting of stack traces. The optional limit argument
has the same meaning a
Jelle Zijlstra added the comment:
I'll look into creating a PR when I have some time.
It would also be useful to tweak the Travis/coverage configuration so that it
fails loudly if one of the tests doesn't pass in the coverage check.
--
Jelle Zijlstra added the comment:
I don't think this is a bug; it is known and expected that you can do all kinds
of bad things by writing bytecode manually. (You can already make Python write
to random memory by giving it LOAD_FAST or STORE_FAST opcodes with incorrect
offsets.)
This do
New submission from Jelle Zijlstra:
pathlib.Path.__new__ takes **kwargs, but doesn't do anything with them
(https://github.com/python/cpython/blob/master/Lib/pathlib.py#L979). This
doesn't appear to be documented.
This feature should presumably be either documented or removed
Jelle Zijlstra added the comment:
Thanks, I'll add a PR. This doesn't need to be documented, right?
--
___
Python tracker
<http://bugs.python.o
Changes by Jelle Zijlstra :
--
pull_requests: +735
___
Python tracker
<http://bugs.python.org/issue29162>
___
___
Python-bugs-list mailing list
Unsubscribe:
Jelle Zijlstra added the comment:
I agree with George that supporting None here is the better option.
This problem also applies to collections.deque. tuple, list, and deque all have
very similar index implementations, and it would be nice to merge their
argument parsing boilerplate
Jelle Zijlstra added the comment:
The example is actually correct; I just confirmed by running it in my shell.
Type annotations on local variables are not evaluated at runtime; see PEP 526.
--
nosy: +Jelle Zijlstra
___
Python tracker
<h
New submission from Jelle Zijlstra:
The bytes1 ArgumentDescriptor is duplicated in pickletools.py.
--
messages: 292364
nosy: Jelle Zijlstra, alexandre.vassalotti
priority: normal
pull_requests: 1408
severity: normal
status: open
title: Duplicate code in pickletools.py
New submission from Jelle Zijlstra:
According to PEP 519, it should. I'll submit a PR soon.
--
components: Library (Lib)
messages: 292642
nosy: Jelle Zijlstra, brett.cannon, tarek
priority: normal
severity: normal
status: open
title: shutil.unpack_archive doesn't suppor
Changes by Jelle Zijlstra :
--
pull_requests: +1476
___
Python tracker
<http://bugs.python.org/issue30218>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Jelle Zijlstra :
--
pull_requests: +1501
___
Python tracker
<http://bugs.python.org/issue30235>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Jelle Zijlstra:
It would be useful to have an abstract base class for asynchronous context
managers, similar to the existing contextlib.AbstractContextManager. We can
then also add this class to typing and use it as a PEP 544 Protocol.
I have code ready for
Changes by Jelle Zijlstra :
--
pull_requests: +1520
___
Python tracker
<http://bugs.python.org/issue30241>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Jelle Zijlstra:
Like other ABCs, contextlib.AbstractContextManager should support the pattern
where setting a method to None disables structural subtyping, which was
introduced across the standard library in issue 25958. Ivan Levkivskyi
suggested making
Changes by Jelle Zijlstra :
--
pull_requests: +1546
___
Python tracker
<http://bugs.python.org/issue30266>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Jelle Zijlstra:
According to PEP 492, async and await should be full keywords in Python 3.7,
but this hasn't been implemented yet. I have a patch ready that I'll submit as
a PR soon.
--
components: Interpreter Core
messages: 293976
nosy: Jell
Changes by Jelle Zijlstra :
--
pull_requests: +1763
___
Python tracker
<http://bugs.python.org/issue30406>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Jelle Zijlstra :
--
nosy: +Jelle Zijlstra
___
Python tracker
<http://bugs.python.org/issue30359>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Jelle Zijlstra:
Running `make pydoc-topics` in Doc/ on master fails with
$ make pydoc-topics
sphinx-build -b pydoc-topics -d build/doctrees -D latex_elements.papersize= .
build/pydoc-topics
Running Sphinx v1.6.1
making output directory...
loading pickled environment
Changes by Jelle Zijlstra :
--
assignee: -> docs@python
components: +Documentation
nosy: +docs@python
stage: -> needs patch
versions: +Python 3.7
___
Python tracker
<http://bugs.python.org/i
Jelle Zijlstra added the comment:
Even with the patch, I don't think it's safe to modify os.environ while it's
being accessed concurrently in another thread. The other thread's modification
could arrive while the dict() call in your patch is running (in CPython the GIL
mi
Jelle Zijlstra added the comment:
I could reproduce this on 3.4, but not on 3.3, 2.7, or master.
--
nosy: +Jelle Zijlstra
versions: +Python 3.4
___
Python tracker
<http://bugs.python.org/issue30
Jelle Zijlstra added the comment:
This is likely an issue with the setup of your project, not with type aliases.
You haven't given enough information to tell me what the real problem is.
I'm not sure what you mean by "I still can't compile 'Blocks'"
Jelle Zijlstra added the comment:
Thanks for doing the merge and backport!
--
___
Python tracker
<http://bugs.python.org/issue30266>
___
___
Python-bugs-list m
Jelle Zijlstra added the comment:
The error is
/home/travis/virtualenv/python3.7-dev/lib/python3.7/site-packages/numpy/core/multiarray.cpython-37m-x86_64-linux-gnu.so:
undefined symbol: PyTraceMalloc_Untrack. On a quick look I couldn't find any
recent changes in CPython related to tracem
Jelle Zijlstra added the comment:
Sounds like the issue is with numpy, not CPython, so there's little reason to
keep this CPython bug open.
--
___
Python tracker
<http://bugs.python.org/is
Change by Jelle Zijlstra :
--
pull_requests: +5900
___
Python tracker
<https://bugs.python.org/issue30406>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Jelle Zijlstra :
codecs.StreamRecoder.writelines is implemented as:
def writelines(self, list):
data = ''.join(list)
data, bytesdecoded = self.decode(data, self.errors)
return self.writer.write(data)
It can't take a list of byt
Change by Jelle Zijlstra :
--
keywords: +patch
pull_requests: +6465
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue33482>
___
___
Py
New submission from Jelle Zijlstra :
https://docs.python.org/3.7/library/stdtypes.html#mutable-sequence-types lists
.copy() among the methods provided by mutable sequences. However,
MutableSequence does not actually define .copy():
https://github.com/python/cpython/blob/master/Lib
Jelle Zijlstra added the comment:
Makes sense. I can provide a patch to the docs.
--
___
Python tracker
<https://bugs.python.org/issue33519>
___
___
Python-bug
New submission from Jelle Zijlstra :
See https://github.com/python/cpython/pull/1669#pullrequestreview-67229284
--
assignee: Jelle Zijlstra
components: Interpreter Core
messages: 303739
nosy: Jelle Zijlstra, yselivanov
priority: low
severity: normal
status: open
title: Add REQ_NAME to
Change by Jelle Zijlstra :
--
keywords: +patch
pull_requests: +3900
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31698>
___
___
Py
New submission from Jelle Zijlstra :
https://docs.python.org/3/library/multiprocessing.html#multiprocessing.connection.Client
claims that there is an "authenticate" argument, but it does not exist in the
implementation
(https://github.com/python/cpython/blob/master/Lib/multi
Change by Jelle Zijlstra :
--
keywords: +patch
pull_requests: +6623
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue33519>
___
___
Py
Jelle Zijlstra added the comment:
Do these really need to be builtins?
They seem too specialized to be widely useful; I've personally never needed
them in any async code I've written. It would make more sense to me to put them
in a module like operators.
--
nosy: +Jell
Jelle Zijlstra added the comment:
> How people can get Iterable[FrameSummary] as an input and pass it to
> format_list()?
If I want to format a traceback, but omit traceback lines that refer to a
particular module (for example, code for a coroutine runner), I could write
`forma
Jelle Zijlstra added the comment:
I ran into this bug through Thrift-generated exception classes (also reported
there as https://issues.apache.org/jira/browse/THRIFT-4002).
I've added a few potential solutions:
- issue28603-listset.patch turns the seen set into a list if hashing
Changes by Jelle Zijlstra :
Added file: http://bugs.python.org/file45871/issue28603-ignore.patch
___
Python tracker
<http://bugs.python.org/issue28603>
___
___
Python-bug
Changes by Jelle Zijlstra :
Added file: http://bugs.python.org/file45872/issue28603-list.patch
___
Python tracker
<http://bugs.python.org/issue28603>
___
___
Python-bug
New submission from Jelle Zijlstra:
$ cat baderror.py
class BadError(Exception):
def __init__(self):
self.i = 0
def __hash__(self):
self.i += 1
return self.i
e = BadError()
raise e from e
$ ./python.exe -V
Python 3.5.2+
$ ./python.exe baderror.py
Segmentation
New submission from Jelle Zijlstra:
Calling copy.copy on a threading.local subclass copies attributes over
correctly in Python 2.7, but creates an empty object in Python 3.3-3.5 and
fails with a pickle-related error in 3.6.
Marking this as a release blocker and assigning to Ned because this
Jelle Zijlstra added the comment:
This might be due to issue22995.
--
___
Python tracker
<http://bugs.python.org/issue28967>
___
___
Python-bugs-list mailin
New submission from Jelle Zijlstra:
PEP 525 async generators weren't added to typing.py, probably by oversight.
I sent pull requests to typing and typeshed on GitHub to add an AsyncGenerator
class and stub:
- https://github.com/python/typing/pull/346
- https://github.com/python/typeshed
Changes by Jelle Zijlstra :
Added file: http://bugs.python.org/file46203/asyncgenerator2.patch
___
Python tracker
<http://bugs.python.org/issue29198>
___
___
Python-bug
New submission from Jelle Zijlstra:
The col_offset attribute for ast.AsyncFunctionDef objects points to the "def"
keyword, not to the "async" keyword that actually starts the node.
Test case:
In [18]: code = 'async def f(): pass'
In [19]: tree = ast.parse(code)
Jelle Zijlstra added the comment:
The col_offset is actually correct when there is a decorator:
In [26]: code = '@decorator\nasync def f(): pass'
In [27]: tree = ast.parse(code)
In [28]: tree.body[0].col_offset
Out[28]: 0
The same issue appears with async for and async with:
In
Changes by Jelle Zijlstra :
--
keywords: +patch
Added file: http://bugs.python.org/file46215/issue29205.patch
___
Python tracker
<http://bugs.python.org/issue29
Changes by Jelle Zijlstra :
Added file: http://bugs.python.org/file46219/asyncgenerator3.patch
___
Python tracker
<http://bugs.python.org/issue29198>
___
___
Python-bug
Changes by Jelle Zijlstra :
Added file: http://bugs.python.org/file46220/typingindentation.patch
___
Python tracker
<http://bugs.python.org/issue29198>
___
___
Python-bug
New submission from Jelle Zijlstra:
Document https://github.com/python/typing/pull/338
I should have a patch in the next few days; creating this issue to remind
myself.
--
assignee: Jelle Zijlstra
components: Documentation
messages: 285740
nosy: Jelle Zijlstra
priority: normal
301 - 400 of 509 matches
Mail list logo