@@ -208,8 +208,6 @@ internal static unsafe PyType CreateType(Type impl)
208208 Runtime . PyDict_SetItem ( dict , PyIdentifier . __module__ , mod ) ;
209209 mod . Dispose ( ) ;
210210
211- InitMethods ( dict , impl ) ;
212-
213211 dict . Dispose ( ) ;
214212
215213 // The type has been modified after PyType_Ready has been called
@@ -806,43 +804,6 @@ static void InitializeSlot(IntPtr type, int slotOffset, ThunkInfo thunk, SlotsHo
806804 }
807805 }
808806
809- /// <summary>
810- /// Given a dict of a newly allocated Python type object and a managed Type that
811- /// implements it, initialize any methods defined by the Type that need
812- /// to appear in the Python type __dict__ (based on custom attribute).
813- /// </summary>
814- private static void InitMethods ( BorrowedReference typeDict , Type type )
815- {
816- Type marker = typeof ( PythonMethodAttribute ) ;
817-
818- BindingFlags flags = BindingFlags . Public | BindingFlags . Static ;
819- var addedMethods = new HashSet < string > ( ) ;
820-
821- while ( type != null )
822- {
823- MethodInfo [ ] methods = type . GetMethods ( flags ) ;
824- foreach ( MethodInfo method in methods )
825- {
826- if ( ! addedMethods . Contains ( method . Name ) )
827- {
828- object [ ] attrs = method . GetCustomAttributes ( marker , false ) ;
829- if ( attrs . Length > 0 )
830- {
831- string method_name = method . Name ;
832- var mi = new MethodInfo [ 1 ] ;
833- mi [ 0 ] = method ;
834- MethodObject m = new TypeMethod ( type , method_name , mi ) ;
835- Runtime . PyDict_SetItemString ( typeDict , method_name , m . ObjectReference ) ;
836- m . DecrRefCount ( ) ;
837- addedMethods . Add ( method_name ) ;
838- }
839- }
840- }
841- type = type . BaseType ;
842- }
843- }
844-
845-
846807 /// <summary>
847808 /// Utility method to copy slots from a given type to another type.
848809 /// </summary>
0 commit comments