-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a Tuple type #80
Comments
Hi @0nyr, you could use from nptyping import NDArray, Shape, UInt8
# A 1-dimensional array (i.e. 1 RGB color).
RGBArray1D = NDArray[Shape["[r, g, b]"], UInt8]
# A 2-dimensional array (i.e. an array of RGB colors).
RGBArrayND = NDArray[Shape["*, [r, g, b]"], UInt8] |
Thanks for the answer. I edited mine. Have a look here | StackOverflow. However, this solution is not well handled by VSCode Pylance; I get: Expected class type but received "Literal"
"Literal" is not a class
"Literal" is not a classPylance[reportGeneralTypeIssues](https://github.com/microsoft/pylance-release/blob/main/DIAGNOSTIC_SEVERITY_RULES.md#diagnostic-severity-rules)
Pylance(reportGeneralTypeIssues) |
Thank you for reporting and answering on StackOverflow! Pyright/Pylance can be kinda tricky to get done to be honest. Especially while also maintaining MyPy acceptance. However, for this particular error that you show, I managed to trick my way out and get Pyright/Pylance acceptance. There will be a EDIT: v2.1.3 is released |
Ok very kind of you. I will try it ASAP and give a final response before closing the issue. Have a nice day. |
No recent activity: closing |
Associated StackOverflow question
There is no 'Tuple' inside nptyping/typing.py. Hence it is not possible to write something like that:
This gives an error:
The text was updated successfully, but these errors were encountered: