Esempio n. 1
0
def formatclass(cls, fullname=True, args=True,
                formatvalue=formatvalue.formatvalue):
    """todo"""
    name = cls.__name__ + formatbases(cls, fullname=fullname)
    # args = False # by default no
    if not issharedobject(cls) and hasattr(cls, "__init__"):
        # if iscyfunction(cls.__init__):
            # args = False
        # else:
        if inspect.ismethoddescriptor(cls.__init__):
            args = False
        else:  # python source
            if len(defargs(cls.__init__)) == 1:
                args = False
    if not args:
        return name
    return name + formatfunction(cls.__init__,
                                 name=False,
                                 formatvalue=formatvalue,
                                 firstarg=False
                                 )
Esempio n. 2
0
#!/usr/bin/env python
from issharedobject import issharedobject

try:
    pycurl = __import__("pycurl")
    print(issharedobject(pycurl))  # True
    print(issharedobject(issharedobject))  # False
    print(issharedobject(None))  # False
except ImportError:
    pass