-
-
Notifications
You must be signed in to change notification settings - Fork 491
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 information to interval-posets #30989
Comments
New commits:
|
Branch: u/chapoton/30989 |
Commit: |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:4
In general, this looks good to me (I have admit I didn't went through the code in detail to check whether the added typing information is correct.) One suggestion for improvement: for lists, tuple and iterators there are special typing annotation that allow to specify also the type of elements in these lists, e.g. https://docs.python.org/3/library/typing.html#typing.Iterator Moreover, it would be good to also annotate the method parameters. For example, https://github.com/microsoft/pyright/blob/master/docs/getting-started.md comments
|
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:6
Thanks for the hint. I think it would be slightly premature to add more typing here, without thinking in general about the relationship with the Parent/Element framework. |
Reviewer: Tobias Diez |
comment:7
Sure, it's already better than no typing at all. Feel free to set it to "positive review" after the tests pass. |
comment:8
ok, thanks. For sure, only a first step. I was wondering how to add typing information explaining that the output type has the same "Parent" as self. |
comment:10
Replying to @fchapoton:
In general you can use
The category framework probably needs further work to be able to provide meaningful typing information. One way path would be to use generics. For example, sage.categories.action.Action could be declared as
|
Dependencies: #30551 |
comment:12
To my understanding, type annotations themselves are supported in Python 3.6. I think the annotations added on this ticket do not need |
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. This was a forced push. New commits:
|
comment:14
ok, here is a more basic annotation, without future import Using python 3.8.5, I needed to change back please review again |
Changed dependencies from #30551 to none |
comment:15
If you don't want to use I think it's a good idea to specify the complete typing information, so also specify the type of the list items, i.e. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:17
ok, here is a commit for using List[Tuple] |
comment:19
There are merged conflicts now. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:21
merged |
comment:22
LGTM. The patchbot fails, but the errors seem not relevant to the changes on the branch. |
Changed branch from u/chapoton/30989 to |
just as a little experiment
CC: @tobiasdiez
Component: combinatorics
Author: Frédéric Chapoton
Branch/Commit:
2272bc3
Reviewer: Tobias Diez
Issue created by migration from https://trac.sagemath.org/ticket/30989
The text was updated successfully, but these errors were encountered: