[issue45100] Improve help() by making typing.overload() information accessible at runtime

2022-03-05 Thread Alex Waygood


Alex Waygood  added the comment:

The latest plan sounds good to me. I have some Thoughts on the proposed API, 
but it will be easier to express those as part of a PR review. Looking forward 
to seeing the PR!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-05 Thread Alex Waygood


Alex Waygood  added the comment:

I actually have quite a few use cases for this feature. It's true that type 
checkers don't (yet) support it, but that doesn't mean that it should be 
disallowed at runtime. In fact, allowing it at runtime will surely give type  
checkers room to experiment with implementing this feature if it is requested 
by enough users. As it is, they are blocked from doing so.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-05 Thread Alex Waygood


Alex Waygood  added the comment:

> Is there an actual use case that broke?

No, because this was never usable in the first place. But there are those who 
wish it were usable :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39298] add BLAKE3 to hashlib

2022-03-05 Thread Christian Heimes


Christian Heimes  added the comment:

I didn't consult the steering council in 2016, because I lost the keys to the 
time machine. The very first SC election was in 2019. :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11352] Update cgi module doc

2022-03-05 Thread Irit Katriel


Change by Irit Katriel :


--
priority: high -> normal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Please don't revert all changes. It will not make it working right in any case. 
See issue44863 for more correct approach.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44863] Allow TypedDict to inherit from Generics

2022-03-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46921] Vectorcall support for super()

2022-03-05 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39298] add BLAKE3 to hashlib

2022-03-05 Thread Larry Hastings


Larry Hastings  added the comment:

Right, and I did say "(or BDFL)".  Apparently you didn't bother to consult with 
the BDFL in advance, or at least not in the usual public venues--I haven't 
found a record of such a conversation on the bpo issue, nor in python-dev.

BTW you simultaneously proposed adding SHA3/SHAKE.  The total kloc for all this 
work was over 26k; you didn't mention any discomfort with the size of these 
patches at the time in public correspondance.

In fact, quite the opposite.  On 2016/05/28 you said:

> I also don't get your obsession with lines of code. The gzip and expat
> are far bigger than the KeccakCodePackage.

https://mail.python.org/archives/list/python-...@python.org/message/3YHVN2I74UQC36AVY5BGRJJUE4PMU6GX/

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46925] Replace key if not identical to old key in dict

2022-03-05 Thread Jarek Potiuk


Jarek Potiuk  added the comment:

How about if we make PR instead to the documentation about this behaviour? 

I think this behaviour is a little surprising (you need to know the internals 
of how WeakKeyDict keys are constructed and checked) and while I understand you 
do not want breaking change, maybe this should be explained to the users and 
example given how to apply the workaround?

Just following the "least surprise" principle.

--
nosy: +potiuk

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44863] Allow TypedDict to inherit from Generics

2022-03-05 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +AlexWaygood

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44863] Allow TypedDict to inherit from Generics

2022-03-05 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +Jelle Zijlstra, sobolevn

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46927] Improve error message for subscripting non-generic types

2022-03-05 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Currently, if you try to subscript a non-generic type you will get an error:

>>> int[str]
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'type' object is not subscriptable

Yes, 'type' objects are usually not subscriptable, but list[str] works, and it 
is not clear from the error message for what type it is failed.

The following PR changes an error message:

>>> int[str]
Traceback (most recent call last):
  File "", line 1, in 
TypeError: type 'int' is not subscriptable

--
components: Interpreter Core
messages: 414573
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Improve error message for subscripting non-generic types
type: enhancement
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46927] Improve error message for subscripting non-generic types

2022-03-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +gvanrossum, kj

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46927] Improve error message for subscripting non-generic types

2022-03-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +29814
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31694

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46927] Improve error message for subscripting non-generic types

2022-03-05 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +Jelle Zijlstra

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46928] type.__qualname__ ignores module name in tp_name for static types

2022-03-05 Thread Ronald Oussoren


New submission from Ronald Oussoren :

In a static type when the "tp_name" is set to a fully qualified name (such as 
"my.package.TypeName") the "__qualname__" returns the unqualified name 
("TypeName") instead of the fully qualified name.

The type's ``__name__`` and ``__module__`` have the expected value.

This is IMHO a bug in the implementation of type_qualname in 
Objects/typeobject.c.

Note that setting ``__qualname__`` in the types's ``__dict__`` doesn't work, 
that value is ignored.

--
components: Interpreter Core
messages: 414574
nosy: ronaldoussoren
priority: normal
severity: normal
stage: test needed
status: open
title: type.__qualname__ ignores module name in tp_name for static types
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46917] Require IEEE 754 floating point to build Python 3.11

2022-03-05 Thread Mark Dickinson


Mark Dickinson  added the comment:

> * Mention the new build requirement in What's New in Python 3.11.
> * Modify configure script to make it fail if the IEEE 754 support is missing.
> * Remove code handling missing NAN and infinity: float("nan"), float("inf"), 
> math.nan and math.inf are always available.

That sounds fine.

> * Remove @requires_IEEE_754 decorator of test.support and tests.

I'd suggest leaving those decorators. Some of the tests are used by Python 
implementations other than CPython, and we're not requiring IEEE 754 on all 
Python implementations.

> * Remove "unknown_format" code path of pack/unpack functions like 
> _PyFloat_Pack8() (see bpo-46906 which proposes to make these functions 
> public).

Sounds fine.

> platforms with float larger than 64-bit

I'm assuming you mean Python "float" / C "double" here. There seems to be a 
persistent misunderstanding here, and I'd really like to be sure that everyone 
understands what the current code is doing before changing anything. There are 
*no* platforms that Python cares about where the C double is larger than 
64-bits, and as far as I'm aware there never have been.

What there *is* is a set of platforms where the C double is IEEE 754 binary64 
format, but where arithmetic operations between doubles may be performed in 
extended precision (usually 64-bit precision), so those arithmetic operations 
don't conform strictly to IEEE 754 semantics. Most flavours of Linux on x86 
match that description.

Then there's a (possibly empty, but we don't know that for sure) subset of 
*that* set of platforms where we don't know how to temporarily enforce 53-bit 
precision during numeric parsing / formatting operations.

It's that second subset where dtoa.c can't be used, and where we need the 
fallback of the "legacy" float repr.

I'd be more than happy to deprecate and eventually remove support for the 
legacy float repr, but I think it's too big a change to make for 3.11: we'd 
need to deprecate the support for 3.11 and eventually remove it in 3.13.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46798] xml.etree.ElementTree: get() doesn't return default value, always ATTLIST value

2022-03-05 Thread Stefan Behnel


Change by Stefan Behnel :


--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46927] Improve error message for subscripting non-generic types

2022-03-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset ab9301a28fa431d7a32163126fc96de3b2ce6107 by Serhiy Storchaka in 
branch 'main':
bpo-46927: Include the type's name in the error message for subscripting 
non-generic types (GH-31694)
https://github.com/python/cpython/commit/ab9301a28fa431d7a32163126fc96de3b2ce6107


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46927] Improve error message for subscripting non-generic types

2022-03-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46921] Vectorcall support for super()

2022-03-05 Thread Dong-hee Na


Dong-hee Na  added the comment:

Mean +- std dev: [base] 254 ns +- 6 ns -> [vectorcall] 225 ns +- 1 ns: 1.13x 
faster

--
Added file: https://bugs.python.org/file50657/bench_super.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46929] __rrshift__ for same class obj will raise TypeError

2022-03-05 Thread ZhengYu, Xu


New submission from ZhengYu, Xu :

```
class C:
def __rrshift__(self, v):
return 1

C() >> C()   # raise TypeError: unsupported operand types(s) for >>: 'C' and 'C'
```

--
messages: 414578
nosy: zen-xu
priority: normal
severity: normal
status: open
title: __rrshift__ for same class obj will  raise TypeError
type: behavior
versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46929] __rrshift__ for same class obj will raise TypeError

2022-03-05 Thread ZhengYu, Xu


ZhengYu, Xu  added the comment:

But with different classed will be right

```
class C:
def __rrshift__(self, v):
return 1

class D:
def __rrshift__(self, v):
return 2

C() >> D() # 2
```

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46929] __rrshift__ for same class obj will raise TypeError

2022-03-05 Thread Mark Dickinson

Mark Dickinson  added the comment:

This is the intended behaviour. See the docs here: 
https://docs.python.org/3/reference/datamodel.html#object.__ror__

> These functions are only called if the left operand does not support the 
> corresponding operation and the operands are of different types.

There's a further explanation in a footnote:

> For operands of the same type, it is assumed that if the non-reflected method 
> – such as __add__() – fails then the overall operation is not supported, 
> which is why the reflected method is not called.

--
nosy: +mark.dickinson
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46925] Document dict behavior when setting equal but not identical key

2022-03-05 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Agree, I couldn't find a place where this behavior is documented. The second 
paragraph in 
https://docs.python.org/3.10/library/stdtypes.html#mapping-types-dict comes 
close. Reopening as a documentation issue.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
resolution: rejected -> 
stage: resolved -> needs patch
status: closed -> open
title: Replace key if not identical to old key in dict -> Document dict 
behavior when setting equal but not identical key
versions: +Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43292] xml.ElementTree iterparse filehandle left open

2022-03-05 Thread Jacob Walls


Change by Jacob Walls :


--
keywords: +patch
nosy: +jacobtylerwalls
nosy_count: 4.0 -> 5.0
pull_requests: +29815
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31696

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25707] Add the close method for ElementTree.iterparse() object

2022-03-05 Thread Jacob Walls


Change by Jacob Walls :


--
keywords: +patch
nosy: +jacobtylerwalls
nosy_count: 4.0 -> 5.0
pull_requests: +29816
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/31696

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46930] Iterating over cls.__dict__ in classmethod causes RuntimeError when printing __annotations__

2022-03-05 Thread Fabian Zills


New submission from Fabian Zills :

When iterating over __dict__ inside a classmethod, accessing __annotations 
causses RuntimeError: dictionary changed size during iteration.
This only seems to affect Python 3.10.x on a Ubuntu system.

The following can be used to reproduce this issue:

class ExampleCls:
@classmethod
def iter_cls(cls):
for name, val in cls.__dict__.items():
print(cls.__annotations__)


This can be fixed for this Example by calling  _ = cls.__annotations__ before 
iterating over the __dict__

--
messages: 414582
nosy: PythonF
priority: normal
severity: normal
status: open
title: Iterating over cls.__dict__ in classmethod causes RuntimeError when 
printing __annotations__
type: crash
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46930] Iterating over cls.__dict__ in classmethod causes RuntimeError when printing __annotations__

2022-03-05 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Can reproduce this:

>>> ExampleCls.__dict__
mappingproxy({'__module__': '__main__', 'iter_cls': )>, '__dict__': , '__weakref__': , '__doc__': None})
>>> ExampleCls.iter_cls()
{}
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 4, in iter_cls
RuntimeError: dictionary changed size during iteration
>>> ExampleCls.__dict__
mappingproxy({'__module__': '__main__', 'iter_cls': )>, '__dict__': , '__weakref__': , '__doc__': None, '__annotations__': {}})

The descriptor for type.__annotations__ writes a new attribute into the class's 
dict if it doesn't exist yet. This was done in bpo-43901 / GH-25263.

I don't see a way to fix this bug while preserving the behavior bpo-43901 was 
aiming for.

--
nosy: +Jelle Zijlstra, larry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46930] Iterating over cls.__dict__ in classmethod causes RuntimeError when printing __annotations__

2022-03-05 Thread Alex Waygood


Change by Alex Waygood :


--
type: crash -> behavior
versions: +Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

Can you be more specific about your use cases?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46920] Remove code made dead long ago with #if 0

2022-03-05 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-05 Thread Alex Waygood


Alex Waygood  added the comment:

Consider the typeshed stub for `concurrent.futures.DoneAndNotDoneFutures`. At 
runtime this is a `collections.namedtuple`, but in the stub, we need it to be 
generic to allow precise type inference. But we can't have a generic 
NamedTuple, so the stub is currently this:

```
class DoneAndNotDoneFutures(Sequence[set[Future[_T]]]):
@property
def done(self) -> set[Future[_T]]: ...
@property
def not_done(self) -> set[Future[_T]]: ...
def __new__(_cls, done: set[Future[_T]], not_done: set[Future[_T]]) -> 
DoneAndNotDoneFutures[_T]: ...
def __len__(self) -> int: ...
@overload
def __getitem__(self, __i: SupportsIndex) -> set[Future[_T]]: ...
@overload
def __getitem__(self, __s: slice) -> DoneAndNotDoneFutures[_T]: ...
```

Until two days ago, this stub actually had a bug: `done` and `not_done` were 
both given as writeable attributes, whereas they are read-only properties at 
runtime.

With generic NamedTuples, we could write the stub for the class far more simply 
(and more accurately) like this:

```
class DoneAndNotDoneFutures(NamedTuple, Generic[_T]):
done: set[Future[_T]]
not_done: set[Future[_T]]
```

And in code that actually needs to run at runtime, I frequently find it 
frustrating that I have to use dataclasses instead of NamedTuples if I want a 
simple class that just happens to be generic. dataclasses are great, but for 
small, lightweight classes, I prefer to use NamedTuples where possible. I often 
find that I don't need to use the full range of features dataclasses provide; 
and NamedTuples are often more performant than dataclasses, especially in cases 
where there's a lot of tuple unpacking.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46925] Document dict behavior when setting equal but not identical key

2022-03-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The weakref docs in particular should point out the OP's example and highlight 
the workaround.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-05 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +graingert

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9305] Don't use east/west of UTC in date/time documentation

2022-03-05 Thread Stanley


Change by Stanley :


--
nosy: +slateny
nosy_count: 14.0 -> 15.0
pull_requests: +29817
pull_request: https://github.com/python/cpython/pull/31697

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46794] Please update bundled libexpat to 2.4.6 with security fixes (5 CVEs)

2022-03-05 Thread mattip


mattip  added the comment:

> [T]he test has been removed in CPython pull request 
> https://github.com/python/cpython/pull/31453/files

Thanks, I missed that. Makes sense.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46928] type.__qualname__ ignores module name in tp_name for static types

2022-03-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

What do you expect?

The full qualified name of the object is __module__ + '.' + __qualname__.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-05 Thread Guido van Rossum

Guido van Rossum  added the comment:

Okay, that's a sensible use case.

I do doubt your intuition of preferring named tuples over dataclasses a bit. 
This seems to encourage premature optimization. I'd say for simple cases use 
plain tuples (most performant), for complex cases use dataclasses (named fields 
and many other features that you may eventually want).

Compare concurent.futures.wait()'s return type (a named tuple) to 
asyncio.tasks.wait()'s return type (a plain tuple). I don't think that naming 
the fields of the return tuple (awkwardly :-) makes the c.f.wait() API easier 
to understand than the asyncio.wait() API.

Maybe named tuples, like typed dicts, are "in-between" solutions on the 
spectrum of data types (tuple - named tuple - dataclass; dict - typed dict - 
dataclass), and we should encourage people to use the neighboring solutions 
instead.

I'd rather spend efforts making dataclasses faster than adding features to 
named tuples.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46931] zipfile library will raise uncaught oserror when reading length incorrect zip file

2022-03-05 Thread Vertu Joe


New submission from Vertu Joe :

I intentionally made some corrupted zip archive files for testing.
If some contents were removed from the archive instead of changing the bits. 
when trying to read such files, the zipfile will raise an uncaught  OSError, 
instead of a badzipfile error as expected.

os is windows 10 x64 not sure if this also happens on the UNIX system or it's 
intended to be happen.

code:

import zipfile
with zipfile.ZipFile(r'damaged.zip') as dmg:
dmg.testzip()

result:
OSError
[Errno 22] Invalid argument
  File "test.py", line 20, in 
file = dmg.testzip()

--
components: Library (Lib)
files: damaged.zip
messages: 414590
nosy: ultimalium
priority: normal
severity: normal
status: open
title: zipfile library will raise uncaught oserror when reading length 
incorrect zip file
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file50658/damaged.zip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46414] Add typing.reveal_type

2022-03-05 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46932] Please update bundled libexpat to 2.4.7 with an important fix

2022-03-05 Thread sping


New submission from sping :

Hi!

I believe the fix documented at 
https://github.com/libexpat/libexpat/blob/27d5b8ba1771f916d9cfea2aac6bdac72071dc66/expat/Changes#L7-L11
 is important to users of CPython.  Please update bundled libexpat to 2.4.7.  
Thank you!

Best, Sebastian

--
components: XML
messages: 414591
nosy: sping
priority: normal
severity: normal
status: open
title: Please update bundled libexpat to 2.4.7 with an important fix
type: behavior
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-05 Thread Alex Waygood

Alex Waygood  added the comment:

I sense we'll have to agree to disagree on the usefulness of NamedTuples in the 
age of dataclasses :)

For me, I find the simplicity of the underlying idea behind namedtuples — 
"tuples with some properties bolted on" — very attractive. Yes, standard tuples 
are more performant, but it's great to have a tool in the arsenal that's 
essentially the same as a tuple (and is backwards-compatible with a tuple, for 
APIs that require a tuple), but can also, like dataclasses, be 
self-documenting. (You're right that DoneAndNotDoneFutures isn't a great 
example of this.)

But I agree that this shouldn't be a priority if it's hard to accomplish; and 
there'll certainly be no complaints from me if energy is invested into making 
dataclasses faster.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2022-03-05 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +29818
pull_request: https://github.com/python/cpython/pull/31698

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-05 Thread Thomas Grainger

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 NamedTuples
> in the age of dataclasses :)
>
> For me, I find the simplicity of the underlying idea behind namedtuples —
> "tuples with some properties bolted on" — very attractive. Yes, standard
> tuples are more performant, but it's great to have a tool in the arsenal
> that's essentially the same as a tuple (and is backwards-compatible with a
> tuple, for APIs that require a tuple), but can also, like dataclasses, be
> self-documenting. (You're right that DoneAndNotDoneFutures isn't a great
> example of this.)
>
> But I agree that this shouldn't be a priority if it's hard to accomplish;
> and there'll certainly be no complaints from me if energy is invested into
> making dataclasses faster.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46928] type.__qualname__ ignores module name in tp_name for static types

2022-03-05 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

You're right. I was sure that __qualname__ included the module name, but PEP 
3155 is clear about actual semantics.

Sorry about the noise.

--
resolution:  -> not a bug
stage: test needed -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45582] Rewrite getpath.c in Python

2022-03-05 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +29819
pull_request: https://github.com/python/cpython/pull/31699

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46933] Make pwd module optional for wasm32-emscripten and wasi

2022-03-05 Thread Christian Heimes


New submission from Christian Heimes :

WebAssembly platforms like wasm32-emscripten and wasm32-wasi don't have a 
typical user and group database.

WASI platform does not provide necessary API functions at all. Emscripten 
provides dummy stubs. On Emscripten the pwd module compiles, but is 
non-functional:

Python 3.11.0a4+ (heads/main-dirty:b1a3446, Jan 25 2022, 10:19:07) [Clang 
14.0.0 (https://github.com/llvm/llvm-project f142c45f1e494f8dbdcc1bcf1412 on 
emscripten
Type "help", "copyright", "credits" or "license" for more information.
>>> import pwd, os
>>> os.getuid()
0
>>> pwd.getpwall()
[]
>>> pwd.getpwuid(os.getuid())
Traceback (most recent call last):
  File "", line 1, in 
KeyError: 'getpwuid(): uid not found: 0'

I propose to make the pwd optional and catch import error in few places where 
the pwd module is used to look up user home directory.

--
assignee: christian.heimes
components: Library (Lib)
messages: 414595
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: Make pwd module optional for wasm32-emscripten and wasi
type: behavior
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46933] Make pwd module optional for wasm32-emscripten and wasi

2022-03-05 Thread Christian Heimes


Change by Christian Heimes :


--
keywords: +patch
pull_requests: +29820
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31700

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46920] Remove code made dead long ago with #if 0

2022-03-05 Thread Oleg Iarygin


Oleg Iarygin  added the comment:

I reverted my changes in Modules/_ctypes/libffi_osx/x86/x86-ffi64.c and 
Modules/_decimal/libmpdec/*step.c to not disturb third-party vendored libraries.

As a result, macOS component is no longer affected along with the corresponding 
experts in a nosy list.

--
components:  -macOS
nosy:  -ned.deily, ronaldoussoren

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46934] A started multiprocessing.Process instance cannot be serialised

2022-03-05 Thread Géry

New submission from Géry :

The Python program:

```
import multiprocessing
import time


class Application:

def __init__(self):
self._event = multiprocessing.Event()
self._processes = [
multiprocessing.Process(target=self._worker)
for _ in range(multiprocessing.cpu_count())]

def _worker(self):
while not self._event.is_set():
print(multiprocessing.current_process().name)
time.sleep(1)

def start(self):
for process in self._processes:
print('starting')
process.start()

def stop(self):
self._event.set()
for process in self._processes:
process.join()


if __name__ == '__main__':
application = Application()
application.start()
time.sleep(3)
application.stop()
```

Its output:

```none
starting
starting
Traceback (most recent call last):
  File "/Users/maggyero/Desktop/application.py", line 31, in 
application.start()
  File "/Users/maggyero/Desktop/application.py", line 21, in start
process.start()
  File 
"/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py",
 line 121, in start
self._popen = self._Popen(self)
  File 
"/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/context.py",
 line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
  File 
"/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/context.py",
 line 284, in _Popen
return Popen(process_obj)
  File 
"/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_spawn_posix.py",
 line 32, in __init__
super().__init__(process_obj)
  File 
"/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_fork.py",
 line 19, in __init__
self._launch(process_obj)
  File 
"/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_spawn_posix.py",
 line 47, in _launch
reduction.dump(process_obj, fp)
  File 
"/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/reduction.py",
 line 60, in dump
ForkingPickler(file, protocol).dump(obj)
TypeError: cannot pickle 'weakref' object
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/spawn.py",
 line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
  File 
"/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/spawn.py",
 line 126, in _main
self = reduction.pickle.load(from_parent)
  File 
"/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/synchronize.py",
 line 110, in __setstate__
self._semlock = _multiprocessing.SemLock._rebuild(*state)
FileNotFoundError: [Errno 2] No such file or directory
```

In the function `Application.__init__`, each call 
`multiprocessing.Process(target=self._worker)` initializes a 
`multiprocessing.Process` instance with the instance method `self._worker` as 
its `target` argument. `self._worker` is bound to `self` which has the instance 
attribute `self._processes`.

In the function `Application.start`, each call `process.start()` serialises the 
`target` argument and therefore `self._processes`. `self._processes` is a list 
of `multiprocessing.Process` instances, initially not started yet. The first 
call `process.start()` starts the first `multiprocessing.Process` instance in 
that list without issue, but the second call `process.start()` fails.

So a started `multiprocessing.Process` instance cannot be serialised.

The root of the problem is that the `start` method of a 
`multiprocessing.Process` instance sets its `_popen` instance attribute to a 
`multiprocessing.popen_*.Popen` instance. The initialization of that instance 
performs these two steps (among others):

1. For a `multiprocessing.popen_spawn_posix.Popen` instance, a 
`multiprocessing.popen_spawn_win32.Popen` instance, or a 
`multiprocessing.popen_forkserver.Popen` instance but not a 
`multiprocessing.popen_fork.Popen` instance (i.e. for the start method 
`'spawn'` or the start method `'forkserver'` but not the start method 
`'fork'`), it 
[serialises](https://github.com/python/cpython/blob/v3.10.2/Lib/multiprocessing/popen_spawn_posix.py#L47)
 the `multiprocessing.Process` instance for writing it to the end of the pipe 
used by the parent process to communicate with the child process so that the 
child process can execute the `run` method of the `multiprocessing.Process` 
instance.

2. It 
[sets](https://github.com/python/cpython/blob/v3.10.2/Lib/multiprocessing/p

[issue38364] inspect.iscoroutinefunction / isgeneratorfunction / isasyncgenfunction can't handle partialmethod objects

2022-03-05 Thread Jameel Al-Aziz


Jameel Al-Aziz  added the comment:

I've recently ran into this via unittest.mock.patch.object. Mocking an 
asynchronous partial method returns MagicMock and not AsyncMagicMock, causing 
some pretty hard to debug failures.

--
nosy: +me3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46935] import of submodule polutes global namespace

2022-03-05 Thread Max Bachmann


New submission from Max Bachmann :

In my environment I installed the following two libraries:
```
pip install rapidfuzz
pip install python-Levenshtein
```
Those two libraries have the following structures:
rapidfuzz
|-distance
  |- __init__.py (from . import Levenshtein)
  |- Levenshtein.*.so
|-__init__.py (from rapidfuzz import distance)


Levenshtein
|-__init__.py

When importing Levenshtein first everything behaves as expected:
```
>>> import Levenshtein
>>> Levenshtein.
Levenshtein.apply_edit(   Levenshtein.jaro_winkler( Levenshtein.ratio(
Levenshtein.distance( Levenshtein.matching_blocks(  
Levenshtein.seqratio(
Levenshtein.editops(  Levenshtein.median(   
Levenshtein.setmedian(
Levenshtein.hamming(  Levenshtein.median_improve(   
Levenshtein.setratio(
Levenshtein.inverse(  Levenshtein.opcodes(  
Levenshtein.subtract_edit(
Levenshtein.jaro( Levenshtein.quickmedian(   
>>> import rapidfuzz
>>> Levenshtein.
Levenshtein.apply_edit(   Levenshtein.jaro_winkler( Levenshtein.ratio(
Levenshtein.distance( Levenshtein.matching_blocks(  
Levenshtein.seqratio(
Levenshtein.editops(  Levenshtein.median(   
Levenshtein.setmedian(
Levenshtein.hamming(  Levenshtein.median_improve(   
Levenshtein.setratio(
Levenshtein.inverse(  Levenshtein.opcodes(  
Levenshtein.subtract_edit(
Levenshtein.jaro( Levenshtein.quickmedian( 
```

However when importing rapidfuzz first it import 
`rapidfuzz.distance.Levenshtein` when running `import Levenshtein`
```
>>> import rapidfuzz
>>> Levenshtein
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'Levenshtein' is not defined
>>> import Levenshtein
>>> Levenshtein.
Levenshtein.array(  Levenshtein.normalized_distance(
Levenshtein.similarity(
Levenshtein.distance(   Levenshtein.normalized_similarity(  
Levenshtein.editops(Levenshtein.opcodes( 
```

My expectation was that in both cases `import Levenshtein` should import the 
`Levenshtein` module. I could reproduce this behavior on all Python versions I 
had available (Python3.8 - Python3.10) on Ubuntu and Fedora.

--
components: Interpreter Core
messages: 414599
nosy: maxbachmann
priority: normal
severity: normal
status: open
title: import of submodule polutes global namespace
type: behavior
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38364] inspect.iscoroutinefunction / isgeneratorfunction / isasyncgenfunction can't handle partialmethod objects

2022-03-05 Thread Jameel A.


Change by Jameel A. :


--
versions: +Python 3.10, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46935] import of submodule polutes global namespace

2022-03-05 Thread Max Bachmann


Max Bachmann  added the comment:

It appears this only occurs when a C Extension is involved. When the so is 
imported first it is preferred over the .py file that the user would like to 
import. I could not find any documentation on this behavior, so I assume that 
this is not the intended.

My current workaround is the usage of a unique name for the C Extension and the 
importing everything from a Python file with the corresponding name.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46934] A started multiprocessing.Process instance cannot be serialised

2022-03-05 Thread Géry

Change by Géry :


--
keywords: +patch
pull_requests: +29821
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31701

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46934] Started multiprocessing.Process instances are unserialisable

2022-03-05 Thread Géry

Change by Géry :


--
title: A started multiprocessing.Process instance cannot be serialised -> 
Started multiprocessing.Process instances are unserialisable

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40172] ZipInfo corrupts file names in some old zip archives

2022-03-05 Thread Yudi Levi


Yudi Levi  added the comment:

The main issue is that when extracting older zip files, files are actually 
written to disk with corrupted (altered) names.
Unfortunately it's been a while since I saw this issue and I can't tell if it 
was fixed or if I simply can't reproduce it.
I do see that encoding/decoding in ZipInfo is still inconsistent, sometimes 
uses ascii codepage and sometimes uses cp437 codepage which seems wrong to me.
Not sure how we should handle it but I think that switching the default ascii 
encoding to cp437 to be consistent with the old implementation (and with the 
filename decoding) seems like the right way to go.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46911] Early tracing has lineno=None for modules

2022-03-05 Thread Ned Batchelder


Ned Batchelder  added the comment:

Maybe I'm missing something during normal execution, but I'm only seeing this 
effect now during this super-early encodings.py trick.  I don't mind just 
special-casing the Nones in this case.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46935] import of submodule polutes global namespace

2022-03-05 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

This might be something that rapidfuzz can fix, rather than CPython. In 
whatever import process rapidfuzz uses, it populates sys.modules with a module 
named `Levenshtein` in addition to 'rapidfuzz.distance.Levenshtein'. You might 
be able to request that they change something there.

Python 3.10.0 (tags/v3.10.0:b494f59, Oct  4 2021, 19:00:18) [MSC v.1929 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> m1 = set(sys.modules.keys())
>>> import numpy
>>> m2 = set(sys.modules.keys())
>>> import rapidfuzz
>>> m3 = set(sys.modules.keys())
>>> m2 - m1
{'posixpath', 'numpy.random._pcg64', 'numpy.fft._pocketfft_internal', 
'numpy.core._dtype', 'cython_runtime', 'numpy.random._sfc64', 'urllib', 
'numpy.core.einsumfunc', 'sre_parse', 'numpy.polynomial.laguerre', 
'numpy.fft._pocketfft', 'numpy.lib._iotools', 'numpy.core._exceptions', 
'numpy.random._pickle', 'numpy.lib.twodim_base', 'numpy.polynomial._polybase', 
'numpy.lib._datasource', 'copyreg', 'numpy.random._philox', '_ctypes', 
'numpy.core._ufunc_config', 'platform', 'numpy.lib.histograms', 
'numpy.lib.mixins', 'numpy.core._asarray', 'numpy.polynomial.legendre', 
'numpy.polynomial.polyutils', 'subprocess', 'fnmatch', 'numpy.ctypeslib', 
'ast', 'sre_compile', 'json.scanner', 'numpy.core.arrayprint', 'textwrap', 
'numpy.core.multiarray', 'datetime', 'inspect', 'numpy.core.function_base', 
'hmac', 'numpy.lib.utils', '_json', 'signal', 'numpy.core.machar', 
'numpy.ma.core', 'pathlib', 'numbers', 'numpy.core._methods', 
'numpy.lib.type_check', 'numpy.core.defchararray', 'numpy.core.getlimits', 'n
 umpy.lib.ufunclike', 'numpy.version', 'select', '_sre', 
'numpy.core._dtype_ctypes', 'numpy.lib.arrayterator', 'random', '_blake2', 
'numpy.fft', 'token', 'numpy.core._string_helpers', 'numpy', '_hashlib', 
'opcode', 'tokenize', 'numpy.random._bounded_integers', 'numpy.random.mtrand', 
'ctypes._endian', '_weakrefset', 'numpy.ma', 'numpy.lib.nanfunctions', 
'_random', 'numpy.lib.function_base', '_sha512', 'bisect', 
'numpy.core.records', 'numpy._globals', '_compat_pickle', 'urllib.parse', 
'numpy.random.bit_generator', 'numpy.linalg._umath_linalg', 
'numpy.core._add_newdocs_scalars', 'numpy.polynomial.hermite', 'base64', 
'numpy.linalg.linalg', 'numpy.core._multiarray_tests', '_cython_0_29_24', 
'hashlib', '_struct', 'numpy.lib.arraypad', 'numpy.core', 'msvcrt', 
'numpy.ma.extras', 'numpy.lib.index_tricks', '_locale', 'numpy.lib.shape_base', 
'numpy.compat._inspect', 'numpy.polynomial.hermite_e', 'pickle', 
'numpy._distributor_init', 'numpy.lib._version', '_datetime', 'secrets', 
'numpy.lib.polyno
 mial', 'numpy.core.numerictypes', '_ast', 'numpy.lib.scimath', '_winapi', 
'numpy.matrixlib.defmatrix', '_socket', 'numpy.core.shape_base', 
'numpy.lib.format', 'dis', 'numpy.core._multiarray_umath', 'weakref', 
'numpy.compat.py3k', 'json', 'numpy.core.umath', 'numpy.core.numeric', 
'numpy.core.memmap', 'sre_constants', 'numpy.compat', 
'numpy.core._add_newdocs', 'numpy.polynomial.chebyshev', 'math', 
'numpy.random._common', 'numpy.linalg', 'numpy.random', 're', 'threading', 
'numpy._pytesttester', '_bisect', 'collections.abc', 'socket', 
'numpy.lib.stride_tricks', 'linecache', 'numpy.lib', 'numpy.fft.helper', 
'numpy.core.fromnumeric', 'json.encoder', 'numpy.linalg.lapack_lite', 
'selectors', 'numpy.polynomial', 'numpy.core._internal', 'numpy.__config__', 
'numpy.polynomial.polynomial', 'numpy._version', 'errno', 'struct', 'ctypes', 
'numpy.random._mt19937', 'binascii', 'numpy.lib.npyio', 
'numpy.random._generator', 'numpy.lib.arraysetops', 'numpy.matrixlib', 
'_opcode', 'json.decoder', 'numpy.c
 ore._type_aliases', 'enum', 'numpy.core.overrides', '_pickle'}
>>> m3 - m2
{'rapidfuzz.process', 'rapidfuzz.cpp_process', 'rapidfuzz.string_metric', 
'rapidfuzz.distance.Levenshtein', 'rapidfuzz.cpp_utils', 
'rapidfuzz.cpp_process_cdist', 'cpp_utils', 'cpp_process_cdist', 'rapidfuzz', 
'Jaro', '_heapq', 'rapidfuzz.distance.JaroWinkler', 'cpp_fuzz', 
'rapidfuzz.distance.Hamming', '_cython_3_0_0a10', 'rapidfuzz.utils', 
'cpp_process', 'Hamming', 'rapidfuzz.distance', 'rapidfuzz.distance.Jaro', 
'JaroWinkler', '_initialize', 'rapidfuzz.cpp_fuzz', 'cpp_string_metric', 
'rapidfuzz.distance._initialize', 'rapidfuzz.distance.Indel', 'rapidfuzz.fuzz', 
'Levenshtein', 'heapq', 'Indel', 'array', 'rapidfuzz.cpp_string_metric'}
>>> sys.modules['rapidfuzz.distance.Levenshtein'] is sys.modules['Levenshtein']
True


A temporary workaround could be to delete `sys.modules['Levenshtein']`:

>>> import rapidfuzz
>>> del sys.modules['Levenshtein']
>>> import Levenshtein
>>> Levenshtein.__file__ # not the rapidfuzz one
'C:\\Users\\sween\\AppData\\Roaming\\Python\\Python310\\site-packages\\Levenshtein\\__init__.py'

--
nosy: +Dennis Sweeney

___
Python tracker 

___
___

[issue37609] support "UNC" device paths in ntpath.splitdrive

2022-03-05 Thread Barney Gale


Barney Gale  added the comment:

I'd like to pick this up, as it would allow us to remove a duplicate 
implementation in pathlib with its own shortcomings.

If using native functionality if difficult to get right, could I put @eryksun's 
splitdrive.py implementation up for review?

--
nosy: +barneygale

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46864] Deprecate ob_shash in BytesObject

2022-03-05 Thread Inada Naoki


Change by Inada Naoki :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46864] Deprecate ob_shash in BytesObject

2022-03-05 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 2d8b764210c8de10893665aaeec8277b687975cd by Inada Naoki in branch 
'main':
bpo-46864: Deprecate PyBytesObject.ob_shash. (GH-31598)
https://github.com/python/cpython/commit/2d8b764210c8de10893665aaeec8277b687975cd


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40512] [subinterpreters] Meta issue: per-interpreter GIL

2022-03-05 Thread Jon Parise


Change by Jon Parise :


--
nosy: +jon

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46921] Vectorcall support for super()

2022-03-05 Thread Ken Jin


Ken Jin  added the comment:


New changeset 602024e6e12c69d836aa191d63db75862aec2493 by Ken Jin in branch 
'main':
bpo-46921: Vectorcall support for `super()` (GH-31687)
https://github.com/python/cpython/commit/602024e6e12c69d836aa191d63db75862aec2493


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37609] support "UNC" device paths in ntpath.splitdrive

2022-03-05 Thread Barney Gale


Change by Barney Gale :


--
pull_requests: +29822
pull_request: https://github.com/python/cpython/pull/31702

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46921] Vectorcall support for super()

2022-03-05 Thread Ken Jin


Change by Ken Jin :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com