@@ -466,6 +466,7 @@ class SubClass(runtime):  # type: ignore[misc]
466466            stub_desc = repr (stub ),
467467        )
468468
469+ 
469470SIZEOF_PYOBJECT  =  struct .calcsize ("P" )
470471
471472
@@ -474,33 +475,19 @@ def _shape_differs(t1: type[object], t2: type[object]) -> bool:
474475
475476    Mirrors the shape_differs() function in typeobject.c in CPython.""" 
476477    if  sys .version_info  >=  (3 , 12 ):
477-         return  (
478-             t1 .__basicsize__  !=  t2 .__basicsize__  or  t1 .__itemsize__  !=  t2 .__itemsize__ 
479-         )
478+         return  t1 .__basicsize__  !=  t2 .__basicsize__  or  t1 .__itemsize__  !=  t2 .__itemsize__ 
480479    else :
481480        # CPython had more complicated logic before 3.12: 
482481        # https://github.com/python/cpython/blob/f3c6f882cddc8dc30320d2e73edf019e201394fc/Objects/typeobject.c#L2224 
483482        # We attempt to mirror it here well enough to support the most common cases. 
484483        if  t1 .__itemsize__  or  t2 .__itemsize__ :
485-             return  (
486-                 t1 .__basicsize__  !=  t2 .__basicsize__ 
487-                 or  t1 .__itemsize__  !=  t2 .__itemsize__ 
488-             )
484+             return  t1 .__basicsize__  !=  t2 .__basicsize__  or  t1 .__itemsize__  !=  t2 .__itemsize__ 
489485        t_size  =  t1 .__basicsize__ 
490-         if  (
491-             not  t2 .__weakrefoffset__ 
492-             and  t1 .__weakrefoffset__  +  SIZEOF_PYOBJECT  ==  t_size 
493-         ):
486+         if  not  t2 .__weakrefoffset__  and  t1 .__weakrefoffset__  +  SIZEOF_PYOBJECT  ==  t_size :
494487            t_size  -=  SIZEOF_PYOBJECT 
495-         if  (
496-             not  t2 .__dictoffset__ 
497-             and  t1 .__dictoffset__  +  SIZEOF_PYOBJECT  ==  t_size 
498-         ):
488+         if  not  t2 .__dictoffset__  and  t1 .__dictoffset__  +  SIZEOF_PYOBJECT  ==  t_size :
499489            t_size  -=  SIZEOF_PYOBJECT 
500-         if  (
501-             not  t2 .__weakrefoffset__ 
502-             and  t2 .__weakrefoffset__  ==  t_size 
503-         ):
490+         if  not  t2 .__weakrefoffset__  and  t2 .__weakrefoffset__  ==  t_size :
504491            t_size  -=  SIZEOF_PYOBJECT 
505492        return  t_size  !=  t2 .__basicsize__ 
506493
@@ -516,7 +503,6 @@ def _is_disjoint_base(typ: type[object]) -> bool:
516503    return  _shape_differs (typ , base )
517504
518505
519- 
520506def  _verify_disjoint_base (
521507    stub : nodes .TypeInfo , runtime : type [object ], object_path : list [str ]
522508) ->  Iterator [Error ]:
0 commit comments