-
-
Notifications
You must be signed in to change notification settings - Fork 504
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 some typing annotations to gens methods (-> tuple) #39233
base: develop
Are you sure you want to change the base?
Conversation
Documentation preview for this PR (built with commit e336e04; changes) is ready! 🎉 |
@@ -3919,10 +3918,12 @@ def __hash__(self): | |||
return 0 | |||
|
|||
@cached_method | |||
def gens(self): | |||
def gens(self): # -> PolynomialSequence |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least here its relatively clear that it's returning PolynomialSequence_generic
or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have used Sequence_generic
here
@@ -622,7 +622,7 @@ def reduce(self, f): | |||
""" | |||
return f # default | |||
|
|||
def gens(self): | |||
def gens(self): # -> tuple | PolynomialSequence |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also not a class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and I did not make any serious analysis of the possible types that can appear here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could use from sage.structure.sequence import Sequence_generic
maybe. But I would rather keep it as it is now.
adding some annotations in`rings` folder to help find the cases where `gens` and related methods do not return a tuple (mostly for ideals now) ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. URL: sagemath#39233 Reported by: Frédéric Chapoton Reviewer(s): Frédéric Chapoton, Tobias Diez
adding some annotations in
rings
folderto help find the cases where
gens
and related methods do not return a tuple (mostly for ideals now)📝 Checklist