antonagestam / phantom-types

Phantom types for Python.
https://pypi.org/project/phantom-types/
BSD 3-Clause "New" or "Revised" License
203 stars 9 forks source link

typeguard 4.3.0 breaks sized types #299

Open antonagestam opened 2 months ago

antonagestam commented 2 months ago

This passes on typeguard 4.2.1, but breaks on 4.3.0.

from phantom.sized import SizedIterable
from phantom.predicates.generic import of_complex_type
assert of_complex_type(SizedIterable)(()), 'unexpectedly not of type'

Work-around at the moment is to pin 'typeguard<4.3.0'.

antonagestam commented 2 months ago

Reported some details of the issue back on the typeguard repository: https://github.com/agronholm/typeguard/issues/465#issuecomment-2351651934.