Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.1k
Commit8349403
authored
This alsofixespython/typing#512This alsofixespython/typing#511As was discussed in both issues, some typing forms deserve to be treatedas immutable by copy and pickle modules, so that:* copy(X) is X* deepcopy(X) is X* loads(dumps(X)) is X # pickled by referenceThis PR adds such behaviour to:* Type variables* Special forms like Union, Any, ClassVar* Unsubscripted generic aliases to containers like List, Mapping, IterableThis not only resolves inconsistencies mentioned in the issues, but alsoimproves backwards compatibility with previous versions of Python(including 3.6).Note that this requires some dances with __module__ for type variables(similar to NamedTuple) because the class TypeVar itself is define in typing,while type variables should get module where they were defined.https://bugs.python.org/issue32873
1 parent0e7144b commit8349403
File tree
3 files changed
+58
-11
lines changed- Lib
- test
- Misc/NEWS.d/next/Library
3 files changed
+58
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1057 | 1057 | | |
1058 | 1058 | | |
1059 | 1059 | | |
1060 | | - | |
| 1060 | + | |
| 1061 | + | |
1061 | 1062 | | |
1062 | 1063 | | |
1063 | 1064 | | |
1064 | 1065 | | |
1065 | 1066 | | |
1066 | | - | |
| 1067 | + | |
| 1068 | + | |
1067 | 1069 | | |
1068 | 1070 | | |
1069 | 1071 | | |
1070 | 1072 | | |
1071 | | - | |
1072 | | - | |
1073 | | - | |
| 1073 | + | |
1074 | 1074 | | |
1075 | 1075 | | |
1076 | 1076 | | |
| |||
1082 | 1082 | | |
1083 | 1083 | | |
1084 | 1084 | | |
1085 | | - | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
1086 | 1106 | | |
1087 | 1107 | | |
1088 | 1108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| 288 | + | |
| 289 | + | |
288 | 290 | | |
289 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
290 | 299 | | |
291 | 300 | | |
292 | 301 | | |
| |||
328 | 337 | | |
329 | 338 | | |
330 | 339 | | |
331 | | - | |
332 | | - | |
| 340 | + | |
| 341 | + | |
333 | 342 | | |
334 | 343 | | |
335 | 344 | | |
| |||
496 | 505 | | |
497 | 506 | | |
498 | 507 | | |
499 | | - | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
500 | 513 | | |
501 | 514 | | |
502 | 515 | | |
| |||
536 | 549 | | |
537 | 550 | | |
538 | 551 | | |
| 552 | + | |
| 553 | + | |
539 | 554 | | |
540 | 555 | | |
541 | 556 | | |
542 | | - | |
| 557 | + | |
543 | 558 | | |
544 | 559 | | |
545 | 560 | | |
| |||
558 | 573 | | |
559 | 574 | | |
560 | 575 | | |
| 576 | + | |
561 | 577 | | |
562 | 578 | | |
563 | 579 | | |
| |||
582 | 598 | | |
583 | 599 | | |
584 | 600 | | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
585 | 604 | | |
586 | 605 | | |
587 | 606 | | |
| |||
724 | 743 | | |
725 | 744 | | |
726 | 745 | | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
727 | 751 | | |
728 | 752 | | |
729 | 753 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments
Comments
(0)