Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Private Attributes
pprint._safe_key Class Reference

List of all members.

Public Member Functions

def __init__
def __lt__

Public Attributes


Static Private Attributes

list __slots__ = ['obj']

Detailed Description

Helper function for key functions when sorting unorderable objects.

The wrapped-object will fallback to an Py2.x style comparison for
unorderable types (sorting first comparing the type name and then by
the obj ids).  Does not work recursively, so dict.items() must have
_safe_key applied to both the key and the value.

Definition at line 73 of file

Constructor & Destructor Documentation

def pprint._safe_key.__init__ (   self,

Definition at line 85 of file

00086     def __init__(self, obj):
00087         self.obj = obj

Here is the caller graph for this function:

Member Function Documentation

def pprint._safe_key.__lt__ (   self,

Definition at line 88 of file

00089     def __lt__(self, other):
00090         rv = self.obj.__lt__(other.obj)
00091         if rv is NotImplemented:
00092             rv = (str(type(self.obj)), id(self.obj)) < \
00093                  (str(type(other.obj)), id(other.obj))
00094         return rv

Member Data Documentation

list pprint._safe_key.__slots__ = ['obj'] [static, private]

Definition at line 83 of file

Definition at line 86 of file

The documentation for this class was generated from the following file: