@@ -12,15 +12,13 @@ use crate::{
1212 class:: { PyClassDef , PyClassImpl } ,
1313 common:: ascii,
1414 dictdatatype:: { self , DictKey } ,
15- function:: {
16- ArgIterable , FuncArgs , KwArgs , OptionalArg , PyArithmeticValue :: * , PyComparisonValue ,
17- } ,
15+ function:: { ArgIterable , KwArgs , OptionalArg , PyArithmeticValue :: * , PyComparisonValue } ,
1816 iter:: PyExactSizeIterator ,
1917 protocol:: { PyIterIter , PyIterReturn , PyMappingMethods , PyNumberMethods , PySequenceMethods } ,
2018 recursion:: ReprGuard ,
2119 types:: {
22- AsMapping , AsNumber , AsSequence , Callable , Comparable , Constructor , Initializer , IterNext ,
23- Iterable , PyComparisonOp , Representable , SelfIter , Unconstructible ,
20+ AsMapping , AsNumber , AsSequence , Callable , Comparable , Constructor , DefaultConstructor ,
21+ Initializer , IterNext , Iterable , PyComparisonOp , Representable , SelfIter , Unconstructible ,
2422 } ,
2523 vm:: VirtualMachine ,
2624 AsObject , Context , Py , PyObject , PyObjectRef , PyPayload , PyRef , PyRefExact , PyResult ,
@@ -410,15 +408,7 @@ impl PyRef<PyDict> {
410408 }
411409}
412410
413- impl Constructor for PyDict {
414- type Args = FuncArgs ;
415-
416- fn py_new ( cls : PyTypeRef , _args : FuncArgs , vm : & VirtualMachine ) -> PyResult {
417- PyDict :: default ( )
418- . into_ref_with_type ( vm, cls)
419- . map ( Into :: into)
420- }
421- }
411+ impl DefaultConstructor for PyDict { }
422412
423413impl Initializer for PyDict {
424414 type Args = ( OptionalArg < PyObjectRef > , KwArgs ) ;
@@ -835,7 +825,7 @@ macro_rules! dict_view {
835825 }
836826 }
837827
838- #[ pyclass( with( Constructor , IterNext , Iterable ) ) ]
828+ #[ pyclass( with( Unconstructible , IterNext , Iterable ) ) ]
839829 impl $iter_name {
840830 fn new( dict: PyDictRef ) -> Self {
841831 $iter_name {
@@ -908,7 +898,7 @@ macro_rules! dict_view {
908898 }
909899 }
910900
911- #[ pyclass( with( Constructor , IterNext , Iterable ) ) ]
901+ #[ pyclass( with( Unconstructible , IterNext , Iterable ) ) ]
912902 impl $reverse_iter_name {
913903 fn new( dict: PyDictRef ) -> Self {
914904 let size = dict. size( ) ;
@@ -1114,7 +1104,7 @@ trait ViewSetOps: DictView {
11141104impl ViewSetOps for PyDictKeys { }
11151105#[ pyclass( with(
11161106 DictView ,
1117- Constructor ,
1107+ Unconstructible ,
11181108 Comparable ,
11191109 Iterable ,
11201110 ViewSetOps ,
@@ -1178,7 +1168,7 @@ impl AsNumber for PyDictKeys {
11781168impl ViewSetOps for PyDictItems { }
11791169#[ pyclass( with(
11801170 DictView ,
1181- Constructor ,
1171+ Unconstructible ,
11821172 Comparable ,
11831173 Iterable ,
11841174 ViewSetOps ,
@@ -1253,7 +1243,7 @@ impl AsNumber for PyDictItems {
12531243 }
12541244}
12551245
1256- #[ pyclass( with( DictView , Constructor , Iterable , AsSequence , Representable ) ) ]
1246+ #[ pyclass( with( DictView , Unconstructible , Iterable , AsSequence , Representable ) ) ]
12571247impl PyDictValues {
12581248 #[ pygetset]
12591249 fn mapping ( zelf : PyRef < Self > ) -> PyMappingProxy {
0 commit comments