1
- import annotations
1
+ import annotationlib
2
2
import asyncio
3
3
import textwrap
4
4
import types
@@ -1421,9 +1421,9 @@ def f[T: int = int, **P = int, *Ts = int](): pass
1421
1421
for case in cases :
1422
1422
with self .subTest (case = case ):
1423
1423
self .assertIs (case (1 ), int )
1424
- self .assertIs (annotations .call_evaluate_function (case , annotations .Format .VALUE ), int )
1425
- self .assertIs (annotations .call_evaluate_function (case , annotations .Format .FORWARDREF ), int )
1426
- self .assertEqual (annotations .call_evaluate_function (case , annotations .Format .SOURCE ), 'int' )
1424
+ self .assertIs (annotationlib .call_evaluate_function (case , annotationlib .Format .VALUE ), int )
1425
+ self .assertIs (annotationlib .call_evaluate_function (case , annotationlib .Format .FORWARDREF ), int )
1426
+ self .assertEqual (annotationlib .call_evaluate_function (case , annotationlib .Format .SOURCE ), 'int' )
1427
1427
1428
1428
def test_constraints (self ):
1429
1429
def f [T : (int , str )](): pass
@@ -1432,6 +1432,6 @@ def f[T: (int, str)](): pass
1432
1432
for case in [T , T2 ]:
1433
1433
with self .subTest (case = case ):
1434
1434
self .assertEqual (case .evaluate_constraints (1 ), (int , str ))
1435
- self .assertEqual (annotations .call_evaluate_function (case .evaluate_constraints , annotations .Format .VALUE ), (int , str ))
1436
- self .assertEqual (annotations .call_evaluate_function (case .evaluate_constraints , annotations .Format .FORWARDREF ), (int , str ))
1437
- self .assertEqual (annotations .call_evaluate_function (case .evaluate_constraints , annotations .Format .SOURCE ), '(int, str)' )
1435
+ self .assertEqual (annotationlib .call_evaluate_function (case .evaluate_constraints , annotationlib .Format .VALUE ), (int , str ))
1436
+ self .assertEqual (annotationlib .call_evaluate_function (case .evaluate_constraints , annotationlib .Format .FORWARDREF ), (int , str ))
1437
+ self .assertEqual (annotationlib .call_evaluate_function (case .evaluate_constraints , annotationlib .Format .SOURCE ), '(int, str)' )
0 commit comments