]> SALOME platform Git repositories - modules/smesh.git/commit
Salome HOME
22465: [CEA] sometimes isinstance(m, Mesh) returns False for Mesh objects // PPGP pb
authoreap <eap@opencascade.com>
Wed, 5 Feb 2014 08:08:10 +0000 (08:08 +0000)
committereap <eap@opencascade.com>
Wed, 5 Feb 2014 08:08:10 +0000 (08:08 +0000)
commitfce720f2d2f461f2812cc618cb7655eb26f7a993
tree8e8dde1d6772e92d5cd1c1c854db7f5d7d37c656
parentcc9e7d544292b687b0cc729bc455c147bd65ac54
22465: [CEA] sometimes isinstance(m, Mesh) returns False for Mesh objects // PPGP pb

class MeshMeta(type):
    def __instancecheck__(cls, inst):
        """Implement isinstance(inst, cls)."""
        return any(cls.__subclasscheck__(c)
                   for c in {type(inst), inst.__class__})

    def __subclasscheck__(cls, sub):
        """Implement issubclass(sub, cls)."""
        return type.__subclasscheck__(cls, sub) or (cls.__name__ == sub.__name__ and cls.__module__ == sub.__module__)

...

class Mesh:
    __metaclass__ = MeshMeta

...
src/SMESH_SWIG/smeshBuilder.py