GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — TYP: modelling various integer types as a specialized version of the generic class breaks type-checking in pyright · Issue #23007 · numpy/numpy Closed Labels DescriptionDescribe the issue:I want to make sure that some variable is an instance of However, in that case I have the following error on that line during type-checking with As the developers of pyright explained, this is due to fact that type stubs model Are there any reasons to model these types (like Reproduce the code example:import numpy as np import pandas as pd def foo(x: np.uint64): pass series = pd.Series([1, 2, 3], index=np.array([10, 20, 30], dtype='uint64')) idx = series.index[0] assert isinstance(idx, np.uint64) foo(idx) Error message:(type alias) uint64: Type[unsignedinteger[_64Bit]] Second argument to "isinstance" must be a class or tuple of classes TypeVar or generic type with type arguments not allowed Runtime information:1.24.1 Context for the issue:Initially, I had a code that looked like the following: On the type-checking, I have an error: And that leads to type-checker error, as explained above. Activity
MetadataMetadataAssigneesLabelsTypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |