@@ -385,7 +385,7 @@ internal static ReflectedEvent GetReflectedEvent(EventTracker tracker) {
385385 ReflectedEvent res ;
386386 lock ( _eventCache ) {
387387 if ( ! _eventCache . TryGetValue ( tracker , out res ) ) {
388- if ( PythonBinder . IsExtendedType ( tracker . DeclaringType ) ) {
388+ if ( PythonBinder . IsExtendedPythonType ( tracker . DeclaringType ) ) {
389389 _eventCache [ tracker ] = res = new ReflectedEvent ( tracker , true ) ;
390390 } else {
391391 _eventCache [ tracker ] = res = new ReflectedEvent ( tracker , false ) ;
@@ -640,8 +640,8 @@ private static bool IsMethodAlwaysVisible(Type/*!*/ type, MemberInfo/*!*/[]/*!*/
640640 if ( PythonBinder . IsPythonType ( type ) ) {
641641 // only show methods defined outside of the system types (object, string)
642642 foreach ( MethodInfo mi in methods ) {
643- if ( PythonBinder . IsExtendedType ( mi . DeclaringType ) ||
644- PythonBinder . IsExtendedType ( mi . GetBaseDefinition ( ) . DeclaringType ) ||
643+ if ( PythonBinder . IsExtendedPythonType ( mi . DeclaringType ) ||
644+ PythonBinder . IsExtendedPythonType ( mi . GetBaseDefinition ( ) . DeclaringType ) ||
645645 PythonHiddenAttribute . IsHidden ( mi ) ) {
646646 alwaysVisible = false ;
647647 break ;
@@ -651,12 +651,22 @@ private static bool IsMethodAlwaysVisible(Type/*!*/ type, MemberInfo/*!*/[]/*!*/
651651 // check if this is a virtual override helper, if so we
652652 // may need to filter it out.
653653 foreach ( MethodInfo mi in methods ) {
654- if ( PythonBinder . IsExtendedType ( mi . DeclaringType ) ) {
654+ if ( PythonBinder . IsExtendedPythonType ( mi . DeclaringType ) ) {
655+ alwaysVisible = false ;
656+ break ;
657+ }
658+ }
659+ } else if ( type . IsAssignableFrom ( typeof ( int ) ) ) { // GH #52
660+ // only show methods defined outside of int
661+ foreach ( MethodInfo mi in methods ) {
662+ Debug . Assert ( ! mi . DeclaringType . IsInterface || typeof ( int ) . GetInterfaces ( ) . Contains ( mi . DeclaringType ) ) ;
663+ if ( PythonBinder . IsPythonSupportingType ( mi . DeclaringType ) ||
664+ mi . DeclaringType . IsInterface ||
665+ PythonHiddenAttribute . IsHidden ( mi ) ) {
655666 alwaysVisible = false ;
656667 break ;
657668 }
658669 }
659-
660670 }
661671 return alwaysVisible ;
662672 }
@@ -675,7 +685,8 @@ internal static PythonTypeSlot GetReflectedField(FieldInfo info) {
675685 PythonTypeSlot res ;
676686
677687 NameType nt = NameType . Field ;
678- if ( ! PythonBinder . IsExtendedType ( info . DeclaringType ) &&
688+ if ( ! PythonBinder . IsExtendedPythonType ( info . DeclaringType ) &&
689+ ! PythonBinder . IsPythonSupportingType ( info . DeclaringType ) &&
679690 ! PythonHiddenAttribute . IsHidden ( info ) ) {
680691 nt |= NameType . PythonField ;
681692 }
@@ -758,7 +769,7 @@ internal static ReflectedGetterSetter GetReflectedProperty(PropertyTracker pt, M
758769 }
759770
760771 if ( pt is ReflectedPropertyTracker rpt ) {
761- if ( PythonBinder . IsExtendedType ( pt . DeclaringType ) ||
772+ if ( PythonBinder . IsExtendedPythonType ( pt . DeclaringType ) ||
762773 PythonHiddenAttribute . IsHidden ( rpt . Property , true ) ) {
763774 nt = NameType . Property ;
764775 }
0 commit comments