-
-
Notifications
You must be signed in to change notification settings - Fork 488
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
Meta-ticket: Review of Python 3 features that sagelib should use systematically #29756
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
About types, has a general policy been discussed on sage-devel? |
comment:3
|
comment:4
Are there reasons (e.g. performance) not to use it in certain circumstances? |
comment:5
I created this ticket as a place for discussions of these new features to make sure that we use them systematically in the Sage library, rather than in an ad-hoc way. For example, for typing, I think there are opportunities to integrate it with the various dynamically generated classes that come in from the category system, as I noted in #29775. |
comment:6
There shouldn't be any performance issues with typing as it is deactivated on runtime (the only additional overhead is the import of the |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:11
Regarding f-strings, see this comment: |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:18
Replying to @egourgoulhon:
+1 for using typing. Return types in particular are useful for tab-completion on the result of function calls. For example
this tab-completes without evaluating the code (i.e. without setting IPython's |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:29
Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review of ticket status, priority, and last modification date. |
For Sage 10.4, all of the following features can be used
Python 3.6 features (https://docs.python.org/3.10/whatsnew/3.6.html):
__annotations__
) and coercion/Cythonyield from
- use yield from in poset code #29857.sage
modules importable)__matmul__
(infix@
operator) - Add support for __matmul__ in the coercion model #22760from ..a import b
Python 3.7 features (https://docs.python.org/3.10/whatsnew/3.7.html)
importlib.resources (sage.repl: Replace use of SAGE_EXTCODE by importlib.resources #31306)
from
futureimport annotations
(Add more typing information to manifold package #31006)https://docs.python.org/3/library/dataclasses.html
Python 3.8 features (https://docs.python.org/3.10/whatsnew/3.8.html)
:=
(https://docs.python.org/3.10/whatsnew/3.8.html#assignment-expressions)f'{expr=}'
https://docs.python.org/3.10/whatsnew/3.8.html#f-strings-support-for-self-documenting-expressions-and-debuggingfunctools.cached_property()
https://docs.python.org/3.10/whatsnew/3.8.html#functoolspprint(sort_dicts=False)
shutil.copytree(dirs_exist_ok=True)
https://docs.python.org/3.10/whatsnew/3.8.html#shutilas_integer_ratio
,__index__
special method (https://docs.python.org/3.10/whatsnew/3.8.html#other-language-changes)math.dist
,hypot
,prod
,perm
,comb
,isqrt
https://docs.python.org/3.10/whatsnew/3.8.html#mathtyping.TypedDict
,typing.Literal
,Final
,Protocol
https://docs.python.org/3.10/whatsnew/3.8.html#typingPython 3.9 features (https://docs.python.org/3.10/whatsnew/3.9.html)
Features introduced in Python 3.10 or later cannot be used in Sage yet because we support system Python 3.9.x
Python 3.10 features (https://docs.python.org/3.10/whatsnew/3.10.html):
match ... case
itertools.pairwise
#36609Python 3.11 features (https://docs.python.org/3.11/whatsnew/3.11.html):
Python 3.12 features (https://docs.python.org/3.12/whatsnew/3.12.html):
Python 3.13 features (https://docs.python.org/3.13/whatsnew/3.13.html):
See also
CC: @fchapoton @dimpase @jhpalmieri @tobiasdiez @tscrim @nthiery @slel @nbruin
Component: python3
Keywords: sd109
Issue created by migration from https://trac.sagemath.org/ticket/29756
The text was updated successfully, but these errors were encountered: