@@ -71,7 +71,7 @@ mod _sqlite {
7171 sliceable:: { SaturatedSliceIter , SliceableSequenceOp } ,
7272 types:: {
7373 AsMapping , AsSequence , Callable , Comparable , Constructor , Hashable , IterNext , Iterable ,
74- PyComparisonOp , SelfIter ,
74+ PyComparisonOp , SelfIter , Unconstructible ,
7575 } ,
7676 utils:: ToCString ,
7777 } ;
@@ -2044,13 +2044,7 @@ mod _sqlite {
20442044 inner : PyMutex < Option < BlobInner > > ,
20452045 }
20462046
2047- impl Constructor for Blob {
2048- type Args = FuncArgs ;
2049-
2050- fn py_new ( _cls : PyTypeRef , _args : Self :: Args , vm : & VirtualMachine ) -> PyResult {
2051- Err ( vm. new_type_error ( "cannot create 'sqlite3.Blob' instances" ) )
2052- }
2053- }
2047+ impl Unconstructible for Blob { }
20542048
20552049 #[ derive( Debug ) ]
20562050 struct BlobInner {
@@ -2064,7 +2058,7 @@ mod _sqlite {
20642058 }
20652059 }
20662060
2067- #[ pyclass( with( AsMapping , Constructor ) ) ]
2061+ #[ pyclass( with( AsMapping , Unconstructible ) ) ]
20682062 impl Blob {
20692063 #[ pymethod]
20702064 fn close ( & self ) {
@@ -2381,15 +2375,9 @@ mod _sqlite {
23812375 }
23822376 }
23832377
2384- impl Constructor for Statement {
2385- type Args = FuncArgs ;
2386-
2387- fn py_new ( _cls : PyTypeRef , _args : Self :: Args , vm : & VirtualMachine ) -> PyResult {
2388- Err ( vm. new_type_error ( "cannot create 'sqlite3.Statement' instances" ) )
2389- }
2390- }
2378+ impl Unconstructible for Statement { }
23912379
2392- #[ pyclass( with( Constructor ) ) ]
2380+ #[ pyclass( with( Unconstructible ) ) ]
23932381 impl Statement {
23942382 fn new (
23952383 connection : & Connection ,
0 commit comments