Commit 50b797d
committed
Refactor Sentinel to conform to PEP 661
`repr` parameter removed, explicit repr tests removed
`__repr__` modified to match PEP implementation (removed angle brackets)
Added `module_name` parameter following PEP implementation and tweaking
to use `_caller` helper function.
`name` required support for qualified names to follow PEP implementation.
Added `__reduce__` to track Sentinel by name and module_name.
Added a Sentinel registry to preserve Sentinel identity across multiple
calls to the class. Added tests for this.
Added an import step to allow forward compatibility with other sentinel libraries.
Import step is tested.
This was not required by the PEP but it is required for
typing_extensions to have a forward compatible type.
Added copy and pickle tests.
Updated documentation for Sentinel.1 parent 40e22eb commit 50b797d
File tree
3 files changed
+113
-34
lines changed- doc
- src
3 files changed
+113
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1030 | 1030 | | |
1031 | 1031 | | |
1032 | 1032 | | |
1033 | | - | |
| 1033 | + | |
1034 | 1034 | | |
1035 | | - | |
1036 | | - | |
| 1035 | + | |
1037 | 1036 | | |
1038 | | - | |
1039 | | - | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
1040 | 1046 | | |
1041 | 1047 | | |
1042 | 1048 | | |
| |||
1050 | 1056 | | |
1051 | 1057 | | |
1052 | 1058 | | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
1053 | 1077 | | |
1054 | 1078 | | |
1055 | 1079 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9269 | 9269 | | |
9270 | 9270 | | |
9271 | 9271 | | |
9272 | | - | |
9273 | | - | |
| 9272 | + | |
9274 | 9273 | | |
9275 | | - | |
9276 | | - | |
9277 | | - | |
9278 | | - | |
9279 | | - | |
9280 | | - | |
9281 | | - | |
| 9274 | + | |
| 9275 | + | |
| 9276 | + | |
9282 | 9277 | | |
9283 | 9278 | | |
9284 | 9279 | | |
| |||
9298 | 9293 | | |
9299 | 9294 | | |
9300 | 9295 | | |
9301 | | - | |
9302 | | - | |
9303 | | - | |
9304 | | - | |
9305 | | - | |
9306 | | - | |
9307 | | - | |
| 9296 | + | |
| 9297 | + | |
| 9298 | + | |
| 9299 | + | |
| 9300 | + | |
| 9301 | + | |
| 9302 | + | |
| 9303 | + | |
| 9304 | + | |
| 9305 | + | |
| 9306 | + | |
| 9307 | + | |
| 9308 | + | |
| 9309 | + | |
| 9310 | + | |
| 9311 | + | |
| 9312 | + | |
| 9313 | + | |
| 9314 | + | |
9308 | 9315 | | |
9309 | 9316 | | |
9310 | 9317 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
4155 | 4156 | | |
4156 | 4157 | | |
4157 | 4158 | | |
| 4159 | + | |
| 4160 | + | |
| 4161 | + | |
4158 | 4162 | | |
4159 | | - | |
| 4163 | + | |
4160 | 4164 | | |
4161 | | - | |
| 4165 | + | |
| 4166 | + | |
4162 | 4167 | | |
4163 | | - | |
4164 | | - | |
| 4168 | + | |
| 4169 | + | |
| 4170 | + | |
| 4171 | + | |
| 4172 | + | |
| 4173 | + | |
4165 | 4174 | | |
4166 | 4175 | | |
4167 | | - | |
4168 | | - | |
| 4176 | + | |
| 4177 | + | |
4169 | 4178 | | |
4170 | | - | |
| 4179 | + | |
4171 | 4180 | | |
4172 | | - | |
4173 | | - | |
| 4181 | + | |
| 4182 | + | |
| 4183 | + | |
| 4184 | + | |
| 4185 | + | |
| 4186 | + | |
| 4187 | + | |
| 4188 | + | |
| 4189 | + | |
| 4190 | + | |
| 4191 | + | |
| 4192 | + | |
| 4193 | + | |
| 4194 | + | |
| 4195 | + | |
| 4196 | + | |
| 4197 | + | |
| 4198 | + | |
| 4199 | + | |
| 4200 | + | |
| 4201 | + | |
| 4202 | + | |
| 4203 | + | |
| 4204 | + | |
| 4205 | + | |
| 4206 | + | |
| 4207 | + | |
| 4208 | + | |
| 4209 | + | |
| 4210 | + | |
| 4211 | + | |
| 4212 | + | |
| 4213 | + | |
| 4214 | + | |
4174 | 4215 | | |
4175 | | - | |
4176 | | - | |
| 4216 | + | |
| 4217 | + | |
4177 | 4218 | | |
4178 | 4219 | | |
4179 | 4220 | | |
| |||
4188 | 4229 | | |
4189 | 4230 | | |
4190 | 4231 | | |
4191 | | - | |
4192 | | - | |
| 4232 | + | |
| 4233 | + | |
| 4234 | + | |
| 4235 | + | |
| 4236 | + | |
| 4237 | + | |
| 4238 | + | |
| 4239 | + | |
| 4240 | + | |
4193 | 4241 | | |
4194 | 4242 | | |
4195 | 4243 | | |
| |||
0 commit comments