Package epydoc :: Module uid :: Class UID
[show private | hide private]
[frames | no frames]

Class UID

Known Subclasses:
ObjectUID, RelativeUID

A globally unique identifier.

UID is an abstract base class. The base class defines shortname, is_private, __str__, and __repr__; all other methods must be defined by derived classes.
Method Summary
  __init__(self, name)
int __cmp__(self, other)
Compare self and other, based on their globally unique names.
  __eq__(self, other)
  __hash__(self)
string __repr__(self)
Return a string representation of this UID.
string __str__(self)
Return the globally unique name for this identifier.
UID or None cls(self)
Return the UID of the class that contains the object identified by this UID; or None if the object identified by this UID is not part of a class.
boolean descendant_of(self, ancestor)
Return true if the object identified by this UID is a descendant of ancestor.
boolean is_any_function(self)
Return true if this is the UID for a function or a builtin function.
boolean is_any_method(self)
Return true if this is the UID for a method or a builtin method.
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 or a type.
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 or a package.
boolean is_package(self)
Return true if this is the UID for a package.
boolean is_private(self)
Return true if this is a private object, or if any of its ancestors are private objects.
boolean is_property(self)
Return true if this is the UID for a property.
boolean is_public(self)
Return true if this object and all of its ancestor objects are public.
boolean is_routine(self)
Return true if this is the UID for a function, a method, a builtin function, or a builtin method.
boolean is_type(self)
Return true if this is the UID for a type.
boolean is_variable(self)
Return true if this is the UID for a variable.
UID module(self)
Return the UID of the module that contains the object identified by this UID; or None if the object identified by this UID is a module or a package.
string name(self)
Return the globally unique name for this identifier.
UID package(self)
Return the UID of the package that contains the object identified by this UID; or None if the object identified by this UID is not part of a package.
  parent(self)
Return the UID of the object that contains the object identified by this UID; or None if the object identified by this UID is not contained by any other object.
string shortname(self)
Return the short name for this UID.
any value(self)
Return the value of the object or variable specified by this UID.

Method Details

__cmp__(self, other)
(Comparison operator)

Compare self and other, based on their globally unique names.
  • If they have the same name, then return 0.
  • If self's name preceeds other's name alphabetically, return -1.
  • If self's name follows other's name alphabetically, return +1.
Returns:
int

See Also: name

__repr__(self)
(Representation operator)

Returns:
A string representation of this UID. String representations of UIDs have the form:
   <UID: epydoc.uid.UID>

           (type=string)

__str__(self)
(Informal representation operator)

Returns:
The globally unique name for this identifier.
           (type=string)

See Also: name

cls(self)

Returns:
The UID of the class that contains the object identified by this UID; or None if the object identified by this UID is not part of a class.
           (type=UID or None)

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)

is_any_function(self)

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

is_any_method(self)

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

is_builtin_function(self)

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

is_builtin_method(self)

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

is_class(self)

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

is_function(self)

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

is_method(self)

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

is_module(self)

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

is_package(self)

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

is_private(self)

Returns:
True if this is a private object, or if any of its ancestors are private objects.
  • An object whose parent is a module that defines the __all__ variable is private if and only if it is not contained in __all__. If __all__ is not a list, or if any error occurs while accessing __all__, then it is ignored.
  • All other objects are private if and only if their (short) name begins with a single underscore, but does not end with an underscore.

           (type=boolean)

is_property(self)

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

is_public(self)

Returns:
True if this object and all of its ancestor objects are public.
  • An object whose parent is a module that defines the __all__ variable is public if and only if it is contained in __all__. If __all__ is not a list, or if any error occurs while accessing __all__, then it is ignored.
  • All other objects are public if and only if their (short) name does not begins with a single underscore, or ends with an underscore.

           (type=boolean)

is_routine(self)

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

is_type(self)

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

is_variable(self)

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

module(self)

Returns:
The UID of the module that contains the object identified by this UID; or None if the object identified by this UID is a module or a package.
           (type=UID)

name(self)

Returns:
The globally unique name for this identifier. This name consists of several pieces, joined by periods, which indicate where the object is defined. For example, the UID for this class has the name 'epydoc.uid.UID', since it is named UID, and defined in the uid module of the epydoc package.
           (type=string)

package(self)

Returns:
The UID of the package that contains the object identified by this UID; or None if the object identified by this UID is not part of a package.
           (type=UID)

parent(self)

Returns:
The UID of the object that contains the object identified by this UID; or None if the object identified by this UID is not contained by any other object. For methods, class variables, and instance variables, the parent is the containing class; for functions and classes, it is the containing module; and for modules, it is the containing package.

shortname(self)

Returns:
The short name for this UID. A UID's short name is the last piece of its globally unique name, as returned by name. This is typically the name that was used when definining the object. For example, the UID for this class has the name 'UID'.
           (type=string)

value(self)

Returns:
The value of the object or variable specified by this UID.
           (type=any)

Generated by Epydoc 2.1 on Sat Mar 20 17:46:12 2004 http://epydoc.sf.net