Skip to content
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

NDArray backward compatibility with v1.4.4 #87

Open
jckhang opened this issue Jul 5, 2022 · 1 comment
Open

NDArray backward compatibility with v1.4.4 #87

jckhang opened this issue Jul 5, 2022 · 1 comment

Comments

@jckhang
Copy link

jckhang commented Jul 5, 2022

I really like the new API for shapes. However the new change in the NDArray is now backward compatible.

In v1.4.4, you can construct a NDArray of int32 with any dimension like this

>>> NDArray[np.int32]
NDArray[(typing.Any, ...), Int[32]]

The old ways of hint no longer works and you need to do the same thing with

>>> NDArray[typing.Any, np.int32]

Backward compatible will make the migration a lot easier.

@ramonhagenaars
Copy link
Owner

Backward compatibility is not possible with the new syntax. The new syntax has been designed to be mypy and pyright compliant and with more expressiveness. These were things that were not possible in the 1.* syntax unfortunately.

What difficulties do you precisely have with migrating to the 2.* version? Have you considered maybe to carefully replace your hints with regular expressions throughout your codebase?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants