Commit 050db47
authored
sqlite3: fix Connection.cursor() factory argument handling (#6783)
Fix test_is_instance in CursorFactoryTests by properly handling the
factory argument in Connection.cursor() method. Now the factory can
be passed as both positional and keyword argument, and returns the
correct subclass type instead of always returning PyRef<Cursor>.
- Use FromArgs derive macro with CursorArgs struct for argument parsing
- Return PyObjectRef instead of PyRef<Cursor> to allow subclasses
- Use fast_issubclass to validate returned cursor is a Cursor subclass
- Properly differentiate between 'no argument' and 'None passed'1 parent 9301ae2 commit 050db47
File tree
2 files changed
+25
-14
lines changed- Lib/test/test_sqlite3
- crates/stdlib/src
2 files changed
+25
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | 83 | | |
86 | 84 | | |
87 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
428 | 434 | | |
429 | 435 | | |
430 | 436 | | |
| |||
1023 | 1029 | | |
1024 | 1030 | | |
1025 | 1031 | | |
1026 | | - | |
| 1032 | + | |
1027 | 1033 | | |
1028 | | - | |
| 1034 | + | |
1029 | 1035 | | |
1030 | 1036 | | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
1041 | 1040 | | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
1042 | 1055 | | |
1043 | 1056 | | |
1044 | 1057 | | |
| |||
0 commit comments