You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dropping support for Python 3.8 allows you to take advantage of features and improvements introduced in Python 3.9 and later versions. Here are some key changes and upgrades you can consider:
Type hinting improvements:
Use built-in collection types in annotations (e.g., list[int] instead of List[int])
Use typing.Annotated for adding context to type hints
Dictionary merge (|) and update (|=) operators:
Use dict1 | dict2 to merge dictionaries
Use dict1 |= dict2 to update dictionaries
New string methods:
str.removeprefix() and str.removesuffix()
New math functions:
math.lcm() for least common multiple
math.gcd() for greatest common divisor with multiple arguments
New functools features:
functools.cache() (simpler @lru_cache)
functools.topological_sort()
Improved decorators:
Use @dataclass with kw_only=True parameter
Enhanced zoneinfo module for working with time zones
Type hinting generics in standard collections
More precise error messages for attribute and index access
Performance improvements in various areas
The text was updated successfully, but these errors were encountered:
Dropping support for Python 3.8 allows you to take advantage of features and improvements introduced in Python 3.9 and later versions. Here are some key changes and upgrades you can consider:
list[int]
instead ofList[int]
)typing.Annotated
for adding context to type hints|
) and update (|=
) operators:dict1 | dict2
to merge dictionariesdict1 |= dict2
to update dictionariesstr.removeprefix()
andstr.removesuffix()
math.lcm()
for least common multiplemath.gcd()
for greatest common divisor with multiple argumentsfunctools
features:functools.cache()
(simpler@lru_cache
)functools.topological_sort()
@dataclass
withkw_only=True
parameterzoneinfo
module for working with time zonesThe text was updated successfully, but these errors were encountered: