mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-119180: Rename SOURCE format to STRING (#124620)
This commit is contained in:
parent
a4d1fdfb15
commit
2c10832887
11 changed files with 156 additions and 171 deletions
|
@ -485,10 +485,10 @@ class _CallableGenericAlias(GenericAlias):
|
|||
def __repr__(self):
|
||||
if len(self.__args__) == 2 and _is_param_expr(self.__args__[0]):
|
||||
return super().__repr__()
|
||||
from annotationlib import value_to_source
|
||||
from annotationlib import value_to_string
|
||||
return (f'collections.abc.Callable'
|
||||
f'[[{", ".join([value_to_source(a) for a in self.__args__[:-1]])}], '
|
||||
f'{value_to_source(self.__args__[-1])}]')
|
||||
f'[[{", ".join([value_to_string(a) for a in self.__args__[:-1]])}], '
|
||||
f'{value_to_string(self.__args__[-1])}]')
|
||||
|
||||
def __reduce__(self):
|
||||
args = self.__args__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue