sqlite3: fix Connection.cursor() factory argument handling (#6783) · sheeeng/rustpython-rustpython@050db47 · GitHub
Skip to content

Commit 050db47

Browse files
authored
sqlite3: fix Connection.cursor() factory argument handling (RustPython#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

2 files changed

Lines changed: 25 additions & 14 deletions

File tree

Lib/test/test_sqlite3/test_factory.py

Lines changed: 0 additions & 2 deletions

crates/stdlib/src/sqlite.rs

Lines changed: 25 additions & 12 deletions

0 commit comments

Comments
 (0)