Package pyxb :: Package utils :: Module utility :: Class UniqueIdentifier
[hide private]
[frames] | no frames]

Class UniqueIdentifier

source code

object --+
         |
        UniqueIdentifier

Records a unique identifier, generally associated with a binding generation action.

The identifier is a string, but gets wrapped in an instance of this class to optimize comparisons and reduce memory footprint.

Invoking the constructor for this class on the same string multiple times will return the same Python object.

An instance of this class compares equal to, and hashes equivalent to, the uid string. When str'd, the result is the uid; when repr'd, the result is a constructor call to pyxb.utils.utility.UniqueIdentifier.

Instance Methods [hide private]
 
uid(self)
The string unique identifier
source code
 
__getnewargs__(self) source code
 
__getstate__(self) source code
 
__setstate__(self, state) source code
 
associateObject(self, obj)
Associate the given object witth this identifier.
source code
 
associatedObjects(self)
The set of objects that have been associated with this identifier instance.
source code
 
__init__(self, uid=None)
Create a new UniqueIdentifier instance.
source code
 
__eq__(self, other) source code
 
__hash__(self)
hash(x)
source code
 
__str__(self)
str(x)
source code
 
__repr__(self)
repr(x)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Static Methods [hide private]
a new object with type S, a subtype of T
__new__(cls, *args) source code
Class Variables [hide private]
  __ExistingUIDs = {'PyXB-1.1.3-Builtin': pyxb.utils.utility.Uni...
  __uid = None
hash(x)
  __associatedObjects = None
hash(x)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__new__(cls, *args)
Static Method

source code 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__
(inherited documentation)

associateObject(self, obj)

source code 

Associate the given object witth this identifier.

This is a one-way associatoin: the object is not provided with a return path to this identifier instance.

__init__(self, uid=None)
(Constructor)

source code 

Create a new UniqueIdentifier instance.

Parameters:
  • uid (str or unicode) - The unique identifier string. If present, it is the callers responsibility to ensure the value is universally unique. If None, one will be provided.
Overrides: object.__init__

__hash__(self)
(Hashing function)

source code 

hash(x)

Overrides: object.__hash__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

Class Variable Details [hide private]

__ExistingUIDs

Value:
{'PyXB-1.1.3-Builtin': pyxb.utils.utility.UniqueIdentifier('PyXB-1.1.3\
-Builtin')}