[show private | hide private]

epydoc.uid
Class epydoc.uid.UID


A globally unique identifier used to refer to a Python object. UIDs are used by ObjDoc objects for the purpose of cross-referencing. It is important that each object have one unique identifier, because one object may have more than one name. The UIDs are constructed directly from the objects that they point to, so they are guaranteed to be consistant.
Method Summary
  __init__(self, obj)
Create a globally unique identifier for obj.
  __cmp__(self, other)
  __hash__(self)
  __repr__(self)
UID cls(self)
Return the UID of the class that contains the object identified by this UID.
boolean descendant_of(self, ancestor)
Return true if the object identified by this UID is a descendant of ancestor.
boolean found_fullname(self)
Return true if this UID encodes the absolute name for the object.
boolean is_builtin_function(self)
Return true if this is the UID for a builtin function.
boolean is_builtin_method(self)
Return true if this is the UID for a builtin method.
boolean is_class(self)
Return true if this is the UID for a class.
boolean is_function(self)
Return true if this is the UID for a function.
boolean is_method(self)
Return true if this is the UID for a method.
boolean is_module(self)
Return true if this is the UID for a module.
boolean is_package(self)
Return true if this is the UID for a package.
UID or None module(self)
Return the UID of the module that contains the object identified by this UID.
string name(self)
Return the complete name of this UID.
any object(self)
Return the object identified by this UID; or None if that object is not available.
UID package(self)
Return the UID of the package that contains the object identified by this UID.
string shortname(self)
Return the "short name" for this UID.

Method Details

Constructor

__init__(self, obj)

Create a globally unique identifier for obj.
Parameters:
obj - The object for which a unique identifier should be created.
           (type=any)

Comparison operator

__cmp__(self, other)

Hashing function

__hash__(self)

Representation operator

__repr__(self)

cls

cls(self)

Returns:
The UID of the class that contains the object identified by this UID.
           (type=UID)

descendant_of

descendant_of(self, ancestor)

Parameters:
ancestor - The UID of the potential ancestor.
           (type=UID)
Returns:
True if the object identified by this UID is a descendant of ancestor. d is a descendant of a if d=a; or if d is a descendent of an object contained by a.
           (type=boolean)

found_fullname

found_fullname(self)

Returns:
True if this UID encodes the absolute name for the object. If found_fullname is false, then the UID's name is based on the object's internal id.
           (type=boolean)

is_builtin_function

is_builtin_function(self)

Returns:
True if this is the UID for a builtin function.
           (type=boolean)

is_builtin_method

is_builtin_method(self)

Returns:
True if this is the UID for a builtin method.
           (type=boolean)

is_class

is_class(self)

Returns:
True if this is the UID for a class.
           (type=boolean)

is_function

is_function(self)

Returns:
True if this is the UID for a function.
           (type=boolean)

is_method

is_method(self)

Returns:
True if this is the UID for a method.
           (type=boolean)

is_module

is_module(self)

Returns:
True if this is the UID for a module.
           (type=boolean)

is_package

is_package(self)

Returns:
True if this is the UID for a package.
           (type=boolean)

module

module(self)

Returns:
The UID of the module that contains the object identified by this UID. If the module cannot be found (e.g., if this is the UID for a builtin method), return None.
           (type=UID or None)

name

name(self)

Returns:
The complete name of this UID. This is typically a fully qualified dotted name, such as epydoc.epytext.UID; but if the dotted name of an object cannot be found, a name will be constructed based on the object's Python identifier.
           (type=string)

object

object(self)

Returns:
The object identified by this UID; or None if that object is not available.
           (type=any)

package

package(self)

Returns:
The UID of the package that contains the object identified by this UID.
           (type=UID)

shortname

shortname(self)

Returns:
The "short name" for this UID. This is typically the last part of the fully qualified dotted name, such as UID; but if the dotted name of an object cannot be found, a name will be constructed based on the object's Python identifier.
           (type=string)

Generated by Epydoc on Sun Oct 6 03:32:15 2002 http://epydoc.sf.net