utils.py
changeset 4881 39fc30001a20
parent 4880 fa6671e83639
child 4899 c666d265fb95
equal deleted inserted replaced
4880:fa6671e83639 4881:39fc30001a20
    44     description
    44     description
    45     """
    45     """
    46     # type doesn't accept unicode name
    46     # type doesn't accept unicode name
    47     # return type.__new__(type, str(clsname), (cls,), {})
    47     # return type.__new__(type, str(clsname), (cls,), {})
    48     # __autogenerated__ attribute is just a marker
    48     # __autogenerated__ attribute is just a marker
    49     return type(str(clsname), (cls,), {'__autogenerated__': True})
    49     return type(str(clsname), (cls,), {'__autogenerated__': True,
    50 
    50                                        '__doc__': cls.__doc__,
    51 
    51                                        '__module__': cls.__module__})
    52 
    52 
    53 
    53 
    54 # use networkX instead ?
    54 # use networkX instead ?
    55 # http://networkx.lanl.gov/reference/algorithms.traversal.html#module-networkx.algorithms.traversal.astar
    55 # http://networkx.lanl.gov/reference/algorithms.traversal.html#module-networkx.algorithms.traversal.astar
    56 def transitive_closure_of(entity, relname, _seen=None):
    56 def transitive_closure_of(entity, relname, _seen=None):