-
Notifications
You must be signed in to change notification settings - Fork 184
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
Why did we choose to make Vec2 and Vec4 namedtuples? #234
Comments
Maybe this doesn't address your problem, but "modifying" a namedtuple doesn't have to be too bad: new_vec2 = vec2._replace(x=2.0) |
In What task does the |
It is an old topic but I think the We need to cast whatever type they are defined in Python as a ImVec2 anyway before forwarding them. |
Thank you! |
Hello!
Using namedtuples make those vectors immutable, which makes them way less convenient to use.
It seems like there are mutable alternatives where you can set the components of the vector directly, were those too difficult to implement? Or maybe it was a conscious choice because of limitations (sounds weird since the C++ version does allow it)
https://stackoverflow.com/questions/2970608/what-are-named-tuples-in-python
Cheers!
The text was updated successfully, but these errors were encountered: