class documentation

class twisted.words.protocols.jabber.jid.JID: (source)

View In Hierarchy

Represents a stringprep'd Jabber ID.

JID objects are hashable so they can be used in sets and as keys in dictionaries.

Method __init__ Undocumented
Instance Variable user Undocumented
Instance Variable host Undocumented
Instance Variable resource Undocumented
Method userhost Extract the bare JID as a unicode string.
Method userhostJID Extract the bare JID.
Method full Return the string representation of this JID.
Method __eq__ Equality comparison.
Method __hash__ Calculate hash.
Method __unicode__ Get unicode representation.
Method __repr__ Get object representation.
def __init__(self, str=None, tuple=None): (source)

Undocumented

user = (source)

Undocumented

host = (source)

Undocumented

resource = (source)

Undocumented

def userhost(self): (source)

Extract the bare JID as a unicode string.

A bare JID does not have a resource part, so this returns either user@host or just host.

ReturnsUndocumented (type: str)
def userhostJID(self): (source)

Extract the bare JID.

A bare JID does not have a resource part, so this returns a JID object representing either user@host or just host.

If the object this method is called upon doesn't have a resource set, it will return itself. Otherwise, the bare JID object will be created, interned using internJID.

ReturnsUndocumented (type: JID)
def full(self): (source)

Return the string representation of this JID.

ReturnsUndocumented (type: str)
def __eq__(self, other): (source)

Equality comparison.

JIDs compare equal if their user, host and resource parts all compare equal. When comparing against instances of other types, it uses the default comparison.

ParametersotherUndocumented (type: object)
ReturnsUndocumented (type: bool)
def __hash__(self): (source)

Calculate hash.

JIDs with identical constituent user, host and resource parts have equal hash values. In combination with the comparison defined on JIDs, this allows for using JIDs in sets and as dictionary keys.

def __unicode__(self): (source)

Get unicode representation.

Return the string representation of this JID as a unicode string.

See Alsofull
def __repr__(self): (source)

Get object representation.

Returns a string that would create a new JID object that compares equal to this one.

ReturnsUndocumented (type: str)
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.