Thomas Fischbacher added the comment:
Re AlexWaygood:
If these PEP-484 related things were so obvious that they would admit a compact
description of the problem in 2-3 lines, these issues would likely have been
identified much earlier. We would not be seeing them now, given that Python by
Thomas Fischbacher added the comment:
Tim, the problem may well be simply due to the documentation of math.isfinite()
being off here.
This is what we currently have:
https://docs.python.org/3/library/math.html#math.isfinite
===
math.isfinite(x)
Return True if x is neither an infinity nor a
Thomas Fischbacher added the comment:
This is not a partial duplicate of https://bugs.python.org/issue47121 about
math.isfinite().
The problem there is about a specific function on which the documentation may
be off -
I'll comment separately on that.
The problem here is: There
Thomas Grainger added the comment:
the problem is multiprocessing/process is calling threading._shutdown which
tries to join its own thread, because concurrent.futures.thread._threads_queues
contains the main thread in the subprocess
File
"/home/graingert/miniconda3/envs
Thomas MK added the comment:
There is of course no hard reason for not using the global scope. I just often
have enums (or other types) that are very closely linked to one class. And it
makes sense to me then to have a TypeAlias in that class so that I don't have
to import the
New submission from Thomas Fischbacher :
Here is a major general problem with python-static-typing as it is
described by PEP-484: The approach described in
https://peps.python.org/pep-0484/#the-numeric-tower negatively impacts
our ability to reason about the behavior of code with stringency.
I
New submission from Thomas MK :
The dataclass transformation ignores attributes that are annotated as ClassVar.
I think it should also ignore attributes that are annotated as TypeAlias.
Specifically, I have this usecase in mind:
class RunMode(Enum):
release = auto()
debug = auto
Thomas Fischbacher added the comment:
The problem with PEP-484 is that if one wants to use static type analysis,
neither of these options are good:
- Use static annotations on functions, and additionally spec
out expectations in docstrings. Do note that the two types places
where "
New submission from Thomas Fischbacher :
>>> help(math.isfinite)
isfinite(x, /)
Return True if x is neither an infinity nor a NaN, and False otherwise.
So, one would expect the following expression to return `True` or `False`. We
instead observe:
>>> math.isfinite(1
Thomas Fischbacher added the comment:
Addendum
Serhiy, I agree that my assessment was incorrect.
It actually is unittest/mock.py that has quite a few 'raise AssertionError'
that are not coming from an 'assert' keyword statement.
At a deeper level, the problem here i
Change by Thomas Grainger :
--
keywords: +patch
nosy: +graingert
nosy_count: 4.0 -> 5.0
pull_requests: +30134
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/32044
___
Python tracker
<https://bugs.p
New submission from Thomas Grainger :
the following code prints:
import sys
import dis
import pprint
def demo():
for i in range(1):
if i >= 0:
pass
class Tracer:
def __init__(self):
self.events = []
def trace(self, frame, event,
Thomas Grainger added the comment:
> I'd advocate for not supporting bytes paths and instead updating the
> documentation to require strings.
I've got PR GH-31934 started to do this
--
message_count: 8.0 -> 9.0
pull_requests: +30026
pull_request: https://github
New submission from Thomas Grainger :
importing from a bytes zipimport path on sys.path results in a BytesWarning:
Comparison between bytes and string
running the reproducer with `python -b` shows:
python -b zipfile_demo.py
:1345: BytesWarning: Comparison between
bytes and string
see also
Thomas Grainger added the comment:
zipimporter.zipimporter handles non-bytes paths here:
https://github.com/python/cpython/blob/2cf7f865f099db11cc6903b334d9c376610313e8/Lib/zipimport.py#L65-L67
I think FileFinder should do the same
--
___
Python
Thomas Grainger added the comment:
interestingly bytes filenames pointing to zip files on sys.path do support
bytes (see zipfile_demo.py)
--
Added file: https://bugs.python.org/file50679/zipfile_demo.py
___
Python tracker
<https://bugs.python.
Thomas Grainger added the comment:
https://docs.python.org/3/reference/import.html#path-entry-finders says "The
encoding of bytes entries is determined by the individual path entry finders."
see
https://github.com/python/cpython/commit/82c1c781c7ee6496bd4c404b7ba972
Thomas Grainger added the comment:
this is a regression from 3.2:
```
Python 3.2.6 (default, Jan 18 2016, 19:21:14)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tempfile
>>>
Change by Thomas Grainger :
--
keywords: +patch
pull_requests: +29993
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31897
___
Python tracker
<https://bugs.python.org/issu
Change by Thomas Grainger :
--
components: +Library (Lib)
versions: +Python 3.10, Python 3.11, Python 3.9
___
Python tracker
<https://bugs.python.org/issue47
New submission from Thomas Grainger :
importing a module with bytes in `sys.path` fails with:
File "", line 182, in _path_isabs
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
(see reproducer in attached demo.py)
however `sys.path` is documented as
Thomas Fischbacher added the comment:
The documentation of exceptions in the reference is one of the places that
makes the life of users substantially harder than it ought to be, since the
documentation appears to not have been written with the intent to give
guarantees that users can
New submission from Thomas Fischbacher :
The Python reference says:
(1) https://docs.python.org/3/library/exceptions.html#concrete-exceptions
exception AssertionError
Raised when an assert statement fails.
(2) https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement
New submission from Thomas Guettler :
https://docs.python.org/3.10/library/sys.html#sys.settrace
> Trace functions should have three arguments: frame, event, and arg. frame is
> the current stack frame.
It would be super cool, if "current stack frame" could be a hyperlink to
Thomas Grainger added the comment:
The main advantage for my usecase is support for heterogeneous unpacking
On Sat, Mar 5, 2022, 6:04 PM Alex Waygood wrote:
>
> Alex Waygood added the comment:
>
> I sense we'll have to agree to disagree on the usefulness of NamedTuple
Change by Thomas Wouters :
--
nosy: +twouters
___
Python tracker
<https://bugs.python.org/issue46885>
___
___
Python-bugs-list mailing list
Unsubscribe:
Thomas Grainger added the comment:
there could be multiple messages here
perhaps it could be:
```
finally:
# Must reacquire lock even if wait is cancelled
cancelled = []
while True:
try:
await self.acquire
Change by Thomas Grainger :
--
keywords: +patch
pull_requests: +29629
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31499
___
Python tracker
<https://bugs.python.org/issu
New submission from Thomas Grainger :
the following code:
import socket
import asyncio
async def amain():
with socket.socket(family=socket.AF_INET, proto=socket.IPPROTO_UDP,
type=socket.SOCK_DGRAM) as sock:
sock.setblocking(False)
await asyncio.get_running_loop
Thomas Grainger added the comment:
hello, it's actually a bit of a round about context, but it was brought up on a
tornado issue where I was attempting to port the asyncio optimization to
tornado:
https://github.com/tornadoweb/tornado/issues/3113#issuecomment-1041019287
I think it wou
Change by Thomas Grainger :
--
keywords: +patch
pull_requests: +29627
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31497
___
Python tracker
<https://bugs.python.org/issu
New submission from Thomas Grainger :
now that the getaddrinfo lock has been removed on all platforms the numeric
only host resolve in asyncio could be moved back into BaseEventLoop.getaddrinfo
--
components: asyncio
messages: 413699
nosy: asvetlov, graingert, yselivanov
priority
Change by Thomas Grainger :
--
nosy: +graingert, vstinner
___
Python tracker
<https://bugs.python.org/issue42752>
___
___
Python-bugs-list mailing list
Unsub
Thomas Grainger added the comment:
there's a thread on typing-sig for this now:
https://mail.python.org/archives/list/typing-...@python.org/thread/I7P3ER2NH7SENVMIXK74U6L4Z5JDLQGZ/#I7P3ER2NH7SENVMIXK74U6L4Z5JDLQGZ
--
nosy: +graingert
___
P
Thomas Grainger added the comment:
this also applies to io and _pyio
--
___
Python tracker
<https://bugs.python.org/issue46522>
___
___
Python-bugs-list mailin
New submission from Thomas Grainger :
>>> import types
>>> types.ModuleType("concurrent.futures").missing_attribute
Traceback (most recent call last):
File "", line 1, in
AttributeError: module 'concurrent.futures' has no attribute &
Thomas Klausner added the comment:
Thanks for merging this, @serhiy.storchaka!
--
___
Python tracker
<https://bugs.python.org/issue46045>
___
___
Python-bug
Change by Thomas Cellerier :
--
title: ipaddress.ip_{address,network,interface} raise TypeError instead of
ValueError if given a tuple as address ->
ipaddress.ip_{address,network,interface} raises TypeError instead of ValueError
if given a tuple as addr
Change by Thomas Cellerier :
--
keywords: +patch
pull_requests: +28845
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30642
___
Python tracker
<https://bugs.python.org/issu
New submission from Thomas Cellerier :
`IPv*Network` and `IPv*Interface` constructors accept a 2-tuple of (address
description, netmask) as the address parameter.
When the tuple-based address is used errors are not propagated correctly
through the `ipaddress.ip_*` helper because of the
Thomas Klausner added the comment:
ping - this patch needs a review
--
___
Python tracker
<https://bugs.python.org/issue46045>
___
___
Python-bugs-list mailin
Thomas Klausner added the comment:
ping - this patch needs a review
--
___
Python tracker
<https://bugs.python.org/issue46053>
___
___
Python-bugs-list mailin
Change by Thomas Klausner :
--
nosy: +wiz
nosy_count: 8.0 -> 9.0
pull_requests: +28694
pull_request: https://github.com/python/cpython/pull/30490
___
Python tracker
<https://bugs.python.org/issu
Change by Thomas Klausner :
--
keywords: +patch
pull_requests: +28693
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30490
___
Python tracker
<https://bugs.python.org/issu
New submission from Thomas Klausner :
The configure script uses the test(1) '==' operator, which is only supported by
bash. The standard comparison operator is '='.
--
components: Installation
messages: 410120
nosy: wiz
priority: normal
severity: normal
status: op
Thomas added the comment:
@khaledk I finally got some time off, so here you go
https://github.com/1/ParallelZipFile
I can not offer any support for a more correct implementation of the zip
specification due to time constraints, but maybe the code is useful for you
anyway
Thomas Grainger added the comment:
actually it was already done in 13 months!
--
___
Python tracker
<https://bugs.python.org/issue38415>
___
___
Python-bug
Change by Thomas Grainger :
--
nosy: +graingert
nosy_count: 3.0 -> 4.0
pull_requests: +28454
pull_request: https://github.com/python/cpython/pull/30233
___
Python tracker
<https://bugs.python.org/issu
New submission from Thomas Wouters :
test_pathlib contains, in PosixPathTest.test_expanduser, a check that
expanduser on a nonexistent user will raise RuntimeError. Leaving aside the
question why that's a RuntimeError (which is probably too late to fix anyway),
the test performs this
Change by Thomas Gläßle :
--
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue34624>
___
___
Pyth
Thomas Gläßle added the comment:
Ok, it seems at least the incorrect documentation has been fixed in the mean
time.
I'm going to close this as there seems to be no capacity to deal with this.
--
___
Python tracker
<https://bugs.py
Thomas Grainger added the comment:
> Actually I don't agree with Thomas's logic... his argument feels like
> consistency for its own sake.
Do you expect sync and async contextmanagers to act differently?
Why would sync contextmanagers raise AttributeError and async contextm
New submission from Thomas Wouters :
The PyUnicode_FSConverter function has confusing reference semantics, and
confusing documentation.
https://docs.python.org/3/c-api/unicode.html#c.PyUnicode_FSConverter says the
output argument "must be a PyBytesObject* which must be released when it
Thomas Arendsen Hein added the comment:
Default python3 on Debian buster:
$ python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import email.mim
Change by Thomas Klausner :
--
pull_requests: +28286
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30066
___
Python tracker
<https://bugs.python.org/issu
Change by Thomas Klausner :
--
keywords: +patch
pull_requests: +28285
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30065
___
Python tracker
<https://bugs.python.org/issu
New submission from Thomas Klausner :
When compiling Python on NetBSD, the ossaudio module is not enabled.
1. the code tries to export some #define that are not in the public OSS API
(but that some other implementations provide)
2. on NetBSD, you need to link against libossaudio when using OSS
Change by Thomas Klausner :
--
keywords: +patch
pull_requests: +28272
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30047
___
Python tracker
<https://bugs.python.org/issu
New submission from Thomas Klausner :
On NetBSD by default, the following tests do not finish in > 1h:
1:07:13 load avg: 0.00 running: test_compileall (1 hour 7 min),
test_multiprocessing_fork (1 hour 7 min), test_concurrent_futures (1 hour 6 min)
Defining HAVE_BROKEN_POSIX_SEMAPHORES fi
Thomas Klausner added the comment:
Not interested in this any longer, and Dragonfly's Dports doesn't carry this
patch, so it's probably not needed any longer.
--
stage: -> resolved
status: open -> closed
___
P
Thomas Klausner added the comment:
I must confess, I don't know.
This patch has been in pkgsrc since at least the import of the first python 2.7
package in 2011, and I haven't dug deeper.
If you think it is unnecessary, I'll trust you. I've just removed it from the
py
Thomas Klausner added the comment:
gcc supports this flag. According to the man page:
This option consistently for both compilation and linking. This option is
supported on GNU/Linux targets, most other Unix derivatives, and also on x86
Cygwin and MinGW targets.
On NetBSD, using -pthread
Change by Thomas Klausner :
--
pull_requests: +28257
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30032
___
Python tracker
<https://bugs.python.org/issu
Thomas Klausner added the comment:
Done: https://github.com/python/cpython/pull/29947
--
___
Python tracker
<https://bugs.python.org/issue46000>
___
___
Pytho
New submission from Thomas Klausner :
The code in Modules/_cursesmodule.c has an assumption on ncurses.
The attached simple patch fixes this and works with both NetBSD curses and
ncurses.
--
components: Extension Modules
files: patch-Modules___cursesmodule.c
messages: 407825
nosy: wiz
Thomas Grainger added the comment:
you can see the analogous sync contextmanager issue on python3.6 with:
```
import logging
from contextlib import contextmanager
@contextmanager
def foo():
yield
def test():
f = foo()
f.__enter__()
f.__enter__()
test()
```
on python3.7
Thomas Grainger added the comment:
I see the change here:
https://github.com/python/cpython/commit/1c5c9c89ffc36875afaf4c3cc6a716d4bd089bbf#diff-e00601a380ba6c916ba4333277fe6ea43d2477804002ab1ae64480f80fec8e3aR177-R179
this is intentionally implementing https://bugs.python.org/issue30306 for
Thomas Grainger added the comment:
ah I can repeat this on python3.8.10 trio but not python3.9.9 trio:
```
import logging
import trio
from contextlib import asynccontextmanager
@asynccontextmanager
async def foo():
await trio.sleep(1)
yield
async def test():
async with
Thomas Grainger added the comment:
or consider the trio version:
```
import logging
import trio
from contextlib import asynccontextmanager
@asynccontextmanager
async def foo():
await trio.sleep(1)
yield
async def test():
async with trio.open_nursery() as n:
f = foo
Thomas Grainger added the comment:
I think `AttributeError: args` is the desired/expected behaviour
consider the sync version:
```
import logging
from asyncio import sleep, gather, run
from contextlib import asynccontextmanager, contextmanager
@contextmanager
def foo():
yield
def test
Thomas Kluyver added the comment:
It's not my decision, so I can't really say. But the Queue API is pretty
stable, and exists 3 times over in Python (the queue module for use with
threads, in multiprocessing and in asyncio). So I'd guess that anyone wanting
to add to that AP
Thomas Kluyver added the comment:
I think this is expected. The queue itself doesn't know that one particular
process is meant to put data into it. It just knows that there's no data to
get, so .get() blocks as the docs say it should.
This doesn't apply to issue22393, because
Thomas Kluyver added the comment:
In the example script, I believe you need to close the write end of the pipe in
the parent after forking:
cpid = os.fork()
if cpid == 0:
# Write to pipe (child)
else:
# Parent
os.close(ctx)
# Read from pipe
This is the same with synchronous
Thomas Stolarski added the comment:
I figured this would probably be the case, but since YIQ also requires a
profile (and the FCC one it implements is pretty weird for digital work), I
thought I'd give it a shot anyway.
Would it be worth moving the test/formatting changes over
Thomas Wouters added the comment:
Py_CompileString() in Python 3.9 and later, using the PEG parser, appears to no
longer honours source encoding cookies. A reduced test case:
#include "Python.h"
#include
const char *src = (
"# -*- coding: Latin-1 -*-\n&quo
Change by Thomas Stolarski :
--
keywords: +patch
pull_requests: +27763
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/29512
___
Python tracker
<https://bugs.python.org/issu
New submission from Thomas Stolarski :
Since the implementation of `rgb_to_yiq` roughly 30 years ago now, the advent
of HDTV has resulted in most broadcasting and video processing having moved
towards Rec 709 (or BT.709).
While I know colorsys has been on the chopping block for a while, it
New submission from Thomas Trummer :
3.7 and later are all working fine.
First good commit: 55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0
First bad commit: fdbd01151dbd5feea3e4c0316d102db3d2a2a412
git checkout v3.6.15
#0 0x76cc52a0 in PyCFuncPtr_new (type=0x559157f8,
args
Thomas added the comment:
> An example of multiple descriptors would be to have:
> @cached_property
> @property
> def expensive_calc(self):
> #Do something expensive
That's decorator chaining. The example you gave is not working code (try to
return something from expe
Thomas added the comment:
Just to rephrase, because the explanation in my last message can be ambiguous:
At dataclass construction time (when the @dataclass decorator inspects and
enhances the class):
for field in fields:
if descriptor := getattr(field, 'descriptor'):
Thomas added the comment:
Agreed on everything but that last part, which I'm not sure I understand:
> If we allow descriptor to accept an iterable as well you could have multiple
> descriptors just like normal.
Could you give an example of what you mean with a regular class?
I
Thomas added the comment:
Scratch that last one, it leads to problem when mixing descriptors with actual
default values:
@dataclass
class Foo:
bar = field(default=some_descriptor)
# technically this is a descriptor field without a default value or at the
very least, the dataclass
Thomas added the comment:
Thinking a little more about this, maybe a different solution would be to have
default values be installed at the class level by default without being
overwritten in the init, as is the case today. default_factory should keep
being set in the init as is the case
Thomas added the comment:
Hello everyone,
A quick look on SO and Google + this python issue + this blog post and its
comments:
https://florimond.dev/en/posts/2018/10/reconciling-dataclasses-and-properties-in-python/
show that this is still a problem where dataclass users keep hitting a
Change by Thomas Grainger :
--
nosy: +graingert
nosy_count: 10.0 -> 11.0
pull_requests: +27360
pull_request: https://github.com/python/cpython/pull/29091
___
Python tracker
<https://bugs.python.org/issu
Change by Thomas Wouters :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue29941>
___
___
Python-bugs-list
Thomas Wouters added the comment:
Victor, what's the benefit of doing this work? Are there real problems this
fixes? I'm worried about the churn in third-party extensions, examples,
tutorials, etc, especially for audiences that upon seeing a compiler error
won't immediate
Thomas Grainger added the comment:
it's as part of this discussion in
https://mail.python.org/archives/list/python-...@python.org/thread/ABR2L6BENNA6UPSPKV474HCS4LWT26GY/#IAOCDDCJ653NBED3G2J2YBWD7HHPFHT6
and others in #python-dev
specifically
https://github.com/python/cpython
Change by Thomas Grainger :
--
keywords: +patch
pull_requests: +27181
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/28886
___
Python tracker
<https://bugs.python.org/issu
Change by Thomas Grainger :
--
assignee: docs@python
components: Documentation
nosy: docs@python, graingert
priority: normal
severity: normal
status: open
title: delete misleading faq entry about atomic operations
___
Python tracker
<ht
New submission from Thomas Hobson :
Not entirely sure if this is intended.
When using urllib.request.urlopen, with a hostname and a varying port the SNI
information sent differs.
To my undersnding, the SNI info shouldn't include the port and should only
include the actual host.
Attach
Thomas Grainger added the comment:
afaik this is intentional https://bugs.python.org/issue31033
--
nosy: +graingert
___
Python tracker
<https://bugs.python.org/issue45
Change by Thomas Grainger :
--
keywords: +patch
pull_requests: +26930
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/28546
___
Python tracker
<https://bugs.python.org/issu
New submission from Thomas Grainger :
refactor to avoid redundant _commit_removals pending_removals guard
--
components: Library (Lib)
messages: 402554
nosy: graingert
priority: normal
severity: normal
status: open
title: avoid redundant _commit_removals pending_removals guard
versions
Change by Thomas Grainger :
--
nosy: +graingert
___
Python tracker
<https://bugs.python.org/issue45278>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Thomas Grainger :
--
keywords: +patch
pull_requests: +26925
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/28541
___
Python tracker
<https://bugs.python.org/issu
New submission from Thomas Grainger :
the weak collections should have the same threadsafe/thread unsafe guarantees
as their strong reference counterparts - eg dict.copy and set.copy are atomic
and so the weak versions should be atomic also
--
components: Interpreter Core, asyncio
Change by Thomas :
--
versions: +Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8
___
Python tracker
<https://bugs.python.org/issue45259>
___
___
Change by Thomas :
--
nosy: +rhettinger, stutzbach -ThomasLee94
___
Python tracker
<https://bugs.python.org/issue45259>
___
___
Python-bugs-list mailin
New submission from Thomas :
There is no heappush function for a max heap when the other supporting helper
functions are already implemented (_siftdown_max())
--
components: Library (Lib)
messages: 402351
nosy: ThomasLee94
priority: normal
severity: normal
status: open
title: No
1 - 100 of 1806 matches
Mail list logo