-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
PR for #36198: fix return types in permutation.py so that methods return type Integer
instead of type int
.
#36199
base: develop
Are you sure you want to change the base?
Conversation
…hods return type `Integer` instead of type `int`.
We could add some doctests but I have not done that. |
Documentation preview for this PR (built with commit de93962; changes) is ready! 🎉 |
Does it not make more sense to fix the type annotation to use |
(a) I think whoever added the type hints had a reason for preferring |
And (d), the motivating problem arose because it was returning |
For a) let's ask @fchapoton about his intentions (d7a9ea8). The other things are good points, although personally having |
I have no precise intention, and no preference between "int" and "Integer". In my opinion, the type should be an abstract version of the integers, not any specific implementation. Alas, there is nothing like that readily available, as far as I can tell. So if I wrote "-> Integer", the intended meaning was "return an integer in NN" and not "return a Sage integer". |
In general, as @jhpalmieri said, Sage should return Sage integers as the behavior is better (and this is consistent with what we do elsewhere in Sage). If it returns a Python |
For methods in combinat/permutation.py which have return type hint of
Integer
, actually return anInteger
rather than anint
.This should fix #36198.
📝 Checklist
⌛ Dependencies