@@ -71,7 +71,7 @@ mod _sqlite {
71
71
sliceable:: { SaturatedSliceIter , SliceableSequenceOp } ,
72
72
types:: {
73
73
AsMapping , AsSequence , Callable , Comparable , Constructor , Hashable , IterNext , Iterable ,
74
- PyComparisonOp , SelfIter ,
74
+ PyComparisonOp , SelfIter , Unconstructible ,
75
75
} ,
76
76
utils:: ToCString ,
77
77
} ;
@@ -2044,13 +2044,7 @@ mod _sqlite {
2044
2044
inner : PyMutex < Option < BlobInner > > ,
2045
2045
}
2046
2046
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 { }
2054
2048
2055
2049
#[ derive( Debug ) ]
2056
2050
struct BlobInner {
@@ -2064,7 +2058,7 @@ mod _sqlite {
2064
2058
}
2065
2059
}
2066
2060
2067
- #[ pyclass( with( AsMapping , Constructor ) ) ]
2061
+ #[ pyclass( with( AsMapping , Unconstructible ) ) ]
2068
2062
impl Blob {
2069
2063
#[ pymethod]
2070
2064
fn close ( & self ) {
@@ -2381,15 +2375,9 @@ mod _sqlite {
2381
2375
}
2382
2376
}
2383
2377
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 { }
2391
2379
2392
- #[ pyclass( with( Constructor ) ) ]
2380
+ #[ pyclass( with( Unconstructible ) ) ]
2393
2381
impl Statement {
2394
2382
fn new (
2395
2383
connection : & Connection ,
0 commit comments