Commit 98ba075
committed
fix: reject unbound methods instead of silently breaking at runtime
Codex review found that skipping self/cls from schema generation makes
unbound methods appear supported, but execution fails with TypeError
because the receiver is never injected. Bound methods (instance.method)
already work - Python strips self before inspect.signature sees it.
- Raise UserError for unbound self/cls instead of silent schema-only skip
- Remove dead receiver_was_skipped logic and call_sig stripping (P2 fix)
- Clean up self_or_cls_skipped variable (now unreachable)
- Update tests to expect UserError for unbound methods1 parent 22f1f83 commit 98ba075
2 files changed
+23
-49
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | 290 | | |
298 | 291 | | |
299 | 292 | | |
| |||
305 | 298 | | |
306 | 299 | | |
307 | 300 | | |
308 | | - | |
309 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
310 | 308 | | |
311 | 309 | | |
312 | 310 | | |
313 | 311 | | |
314 | | - | |
315 | | - | |
316 | | - | |
| 312 | + | |
317 | 313 | | |
318 | 314 | | |
319 | 315 | | |
320 | 316 | | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | 317 | | |
327 | 318 | | |
328 | 319 | | |
| |||
426 | 417 | | |
427 | 418 | | |
428 | 419 | | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
| 420 | + | |
438 | 421 | | |
439 | 422 | | |
440 | 423 | | |
441 | 424 | | |
442 | 425 | | |
443 | 426 | | |
444 | | - | |
| 427 | + | |
445 | 428 | | |
446 | 429 | | |
447 | 430 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
887 | 887 | | |
888 | 888 | | |
889 | 889 | | |
890 | | - | |
891 | | - | |
| 890 | + | |
| 891 | + | |
892 | 892 | | |
893 | 893 | | |
894 | 894 | | |
| |||
902 | 902 | | |
903 | 903 | | |
904 | 904 | | |
905 | | - | |
906 | | - | |
| 905 | + | |
| 906 | + | |
907 | 907 | | |
908 | 908 | | |
909 | 909 | | |
| |||
912 | 912 | | |
913 | 913 | | |
914 | 914 | | |
915 | | - | |
916 | | - | |
917 | | - | |
918 | | - | |
| 915 | + | |
| 916 | + | |
919 | 917 | | |
920 | 918 | | |
921 | | - | |
922 | | - | |
| 919 | + | |
| 920 | + | |
923 | 921 | | |
924 | 922 | | |
925 | 923 | | |
| |||
928 | 926 | | |
929 | 927 | | |
930 | 928 | | |
| 929 | + | |
931 | 930 | | |
932 | 931 | | |
933 | 932 | | |
| |||
946 | 945 | | |
947 | 946 | | |
948 | 947 | | |
949 | | - | |
950 | | - | |
| 948 | + | |
| 949 | + | |
951 | 950 | | |
952 | 951 | | |
953 | 952 | | |
| |||
958 | 957 | | |
959 | 958 | | |
960 | 959 | | |
961 | | - | |
962 | | - | |
963 | | - | |
964 | | - | |
965 | | - | |
966 | | - | |
967 | | - | |
968 | | - | |
969 | | - | |
970 | | - | |
| 960 | + | |
| 961 | + | |
971 | 962 | | |
972 | 963 | | |
973 | 964 | | |
| |||
0 commit comments