Commit b43c820
committed
Remove runtime checks that duplicate type hints
The code contained many runtime checks that threw TypeErrors
if wrong types were passed, even though it is considered
to be more "pythonic" to not check types at runtime at all.
In general, these checks add runtime cost and we can't
realistically check all arguments to all functions.
Instead we should focus on adding more asserts on stuff
that can't be checked using type hints.
If runtime checks are desired, they can still be added
by using runtime type-checkers like Beartype.
Replicates graphql/graphql-js@a4b085b1 parent 0dc7b09 commit b43c820
File tree
22 files changed
+165
-1710
lines changed- src/graphql
- execution
- type
- utilities
- validation
- tests
- execution
- pyutils
- type
- utilities
- validation
22 files changed
+165
-1710
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
| 254 | + | |
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| |||
1104 | 1104 | | |
1105 | 1105 | | |
1106 | 1106 | | |
1107 | | - | |
1108 | | - | |
1109 | 1107 | | |
1110 | 1108 | | |
1111 | 1109 | | |
| |||
1114 | 1112 | | |
1115 | 1113 | | |
1116 | 1114 | | |
1117 | | - | |
1118 | | - | |
1119 | | - | |
1120 | 1115 | | |
1121 | 1116 | | |
1122 | 1117 | | |
1123 | | - | |
1124 | | - | |
1125 | | - | |
1126 | | - | |
1127 | | - | |
1128 | | - | |
1129 | | - | |
1130 | | - | |
1131 | 1118 | | |
1132 | 1119 | | |
1133 | 1120 | | |
| |||
1345 | 1332 | | |
1346 | 1333 | | |
1347 | 1334 | | |
1348 | | - | |
| 1335 | + | |
1349 | 1336 | | |
1350 | 1337 | | |
1351 | 1338 | | |
| |||
0 commit comments