Skip to content

Commit 7029d51

Browse files
committed
Revert change of global Protocol variables
1 parent 8d2ec0a commit 7029d51

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/test_typing_extensions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3572,13 +3572,13 @@ class P(Protocol):
35723572
self.assertEqual(Alias, Alias2)
35733573

35743574
def test_protocols_pickleable(self):
3575-
global GlobalProto, CP # pickle wants to reference the class by name
3575+
global P, CP # pickle wants to reference the class by name
35763576
T = TypeVar('T')
35773577

35783578
@runtime_checkable
3579-
class GlobalProto(Protocol[T]):
3579+
class P(Protocol[T]):
35803580
x = 1
3581-
class CP(GlobalProto[int]):
3581+
class CP(P[int]):
35823582
pass
35833583

35843584
c = CP()
@@ -3591,7 +3591,7 @@ class CP(GlobalProto[int]):
35913591
self.assertEqual(x.bar, 'abc')
35923592
self.assertEqual(x.x, 1)
35933593
self.assertEqual(x.__dict__, {'foo': 42, 'bar': 'abc'})
3594-
s = pickle.dumps(GlobalProto)
3594+
s = pickle.dumps(P)
35953595
D = pickle.loads(s)
35963596
class E:
35973597
x = 1

0 commit comments

Comments
 (0)