You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The collections in this package PatchSet and PatchedFile do not annotate the type of their elements, so iterating over them creates a variable of type Any. For my code, this means either not getting any type hints when working with those elements or manually annotating them when they are accessed (usually by putting a type definition right after the start of a loop).
forfileinpatchset: # type of 'file' is 'Any'file: PatchedFile# type is 'PatchedFile | Any'file=cast(PatchedFile, file) # type is 'PatchedFile'
It appears fixing this would require switching to Python 3 type annotations, rather than the current ones which are compatible with Python 2. What are your thoughts on dropping Python 2 support? I understand not wanting to stop supporting any versions, especially for a problem as simple as this one, but it seems to me the value of continuing to support Python 2 is very limited at this point, and continues to fall, and anyone still using it probably isn't updating their packages anyway.
The text was updated successfully, but these errors were encountered:
A pretty simple library. It has inline type comments, so stubgen was able to
write most of the stubs for me.
There is an open issue about switching to inline types (matiasb/python-unidiff#117).
The collections in this package
PatchSet
andPatchedFile
do not annotate the type of their elements, so iterating over them creates a variable of typeAny
. For my code, this means either not getting any type hints when working with those elements or manually annotating them when they are accessed (usually by putting a type definition right after the start of a loop).It appears fixing this would require switching to Python 3 type annotations, rather than the current ones which are compatible with Python 2. What are your thoughts on dropping Python 2 support? I understand not wanting to stop supporting any versions, especially for a problem as simple as this one, but it seems to me the value of continuing to support Python 2 is very limited at this point, and continues to fall, and anyone still using it probably isn't updating their packages anyway.
The text was updated successfully, but these errors were encountered: