pytypes icon indicating copy to clipboard operation
pytypes copied to clipboard

Typing-toolbox for Python 3 _and_ 2.7 w.r.t. PEP 484.

Results 40 pytypes issues
Sort by recently updated
recently updated
newest added

`type_util.py` references `collections.Iterable` and `collections.Iterator` which is incorrect, it should be `collections.abc.Iterable` and `collections.abc.Iterator`. It causes actual crashes like this: ```python3 Traceback (most recent call last): ... import pytypes File...

example: ```python from pytypes import typechecked @typechecked def foo(a: int, *, c: str): for _ in range(a): print(c) foo(10,c="1") ``` leads to this: ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call...

Some code needs to be updated now that the deprecated top-level ABCs in `collections` have been removed. ``` File "/path/to/lib/python3.10/site-packages/pytypes/type_util.py", line 2252, in class _typechecked_Iterable(collections.Iterable): AttributeError: module 'collections' has no...

If I decorate a class method with `@typechecked`, it works, but breaks autoreload, generating this error: ``` [autoreload of pytypes.typechecker failed: Traceback (most recent call last): File "/Users/srinivas/opt/anaconda3/lib/python3.8/site-packages/IPython/extensions/autoreload.py", line 245,...

```python from typing import List, TypeVar from pytypes import is_subtype T = TypeVar("T") is_subtype(List[int], List[T]) ``` Fails with (Python 3.9): ``` Traceback (most recent call last): File "/Users/beto/Projects/datajunction/bug.py", line 5,...

Is it possible to infer the return type based on the input, for generic functions? Eg, with this [classic example](https://mypy.readthedocs.io/en/stable/generics.html#generic-functions): ```python from typing import TypeVar, Sequence T = TypeVar('T') #...

this is what my function looks like: ``` @typechecked def my_func( a: int, b: str, ): ``` I (deliberately) call the function with an incorrect type using: ``` my_func(1,1) ```...

Test results: https://github.com/cclauss/pytypes/actions https://docs.python.org/3/howto/pyporting.html#use-feature-detection-instead-of-version-detection

Compatibility with the new upcoming typing module is not yet established. I'm working on this as far as time allows, help welcome. https://github.com/Stewori/pytypes/commit/928fd6257272656c346e91fe433dd4e0fc08cff7 was the first milestone of this process,...

I know that Python 3.7/3.8 support is still in progress and I was testing the `master` branch and found some differences so I am reporting them to maybe use them...