@@ -55,7 +55,7 @@ pub fn init(context: &PyContext) {
5555 context. set_attr (
5656 & function_type,
5757 "__code__" ,
58- context. new_member_descriptor ( function_code) ,
58+ context. new_property ( function_code) ,
5959 ) ;
6060
6161 let builtin_function_or_method_type = & context. builtin_function_or_method_type ;
@@ -65,25 +65,6 @@ pub fn init(context: &PyContext) {
6565 context. new_rustfunc ( bind_method) ,
6666 ) ;
6767
68- let member_descriptor_type = & context. member_descriptor_type ;
69- context. set_attr (
70- & member_descriptor_type,
71- "__get__" ,
72- context. new_rustfunc ( member_get) ,
73- ) ;
74-
75- let data_descriptor_type = & context. data_descriptor_type ;
76- context. set_attr (
77- & data_descriptor_type,
78- "__get__" ,
79- context. new_rustfunc ( data_get) ,
80- ) ;
81- context. set_attr (
82- & data_descriptor_type,
83- "__set__" ,
84- context. new_rustfunc ( data_set) ,
85- ) ;
86-
8768 let classmethod_type = & context. classmethod_type ;
8869 context. set_attr (
8970 & classmethod_type,
@@ -130,36 +111,6 @@ fn function_code(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
130111 }
131112}
132113
133- fn member_get ( vm : & mut VirtualMachine , mut args : PyFuncArgs ) -> PyResult {
134- match args. shift ( ) . get_attr ( "function" ) {
135- Some ( function) => vm. invoke ( function, args) ,
136- None => {
137- let attribute_error = vm. context ( ) . exceptions . attribute_error . clone ( ) ;
138- Err ( vm. new_exception ( attribute_error, String :: from ( "Attribute Error" ) ) )
139- }
140- }
141- }
142-
143- fn data_get ( vm : & mut VirtualMachine , mut args : PyFuncArgs ) -> PyResult {
144- match args. shift ( ) . get_attr ( "fget" ) {
145- Some ( function) => vm. invoke ( function, args) ,
146- None => {
147- let attribute_error = vm. context ( ) . exceptions . attribute_error . clone ( ) ;
148- Err ( vm. new_exception ( attribute_error, String :: from ( "Attribute Error" ) ) )
149- }
150- }
151- }
152-
153- fn data_set ( vm : & mut VirtualMachine , mut args : PyFuncArgs ) -> PyResult {
154- match args. shift ( ) . get_attr ( "fset" ) {
155- Some ( function) => vm. invoke ( function, args) ,
156- None => {
157- let attribute_error = vm. context ( ) . exceptions . attribute_error . clone ( ) ;
158- Err ( vm. new_exception ( attribute_error, String :: from ( "Attribute Error" ) ) )
159- }
160- }
161- }
162-
163114// Classmethod type methods:
164115fn classmethod_get ( vm : & mut VirtualMachine , args : PyFuncArgs ) -> PyResult {
165116 trace ! ( "classmethod.__get__ {:?}" , args. args) ;
0 commit comments