@@ -208,8 +208,6 @@ internal static unsafe PyType CreateType(Type impl)
208
208
Runtime . PyDict_SetItem ( dict , PyIdentifier . __module__ , mod ) ;
209
209
mod . Dispose ( ) ;
210
210
211
- InitMethods ( dict , impl ) ;
212
-
213
211
dict . Dispose ( ) ;
214
212
215
213
// 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
806
804
}
807
805
}
808
806
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
-
846
807
/// <summary>
847
808
/// Utility method to copy slots from a given type to another type.
848
809
/// </summary>
0 commit comments