Pyjo.String.Mixin - Object with to_bytes/to_str methods¶
import Pyjo.Base
import Pyjo.String.Mixin
class SubClass(Pyjo.Base.object, Pyjo.String.Mixin.object):
def to_bytes(self):
return b'value'
def to_str(self):
return 'value'
The mixin class for objects with to_bytes()
and/or to_str()
methods.
Classes¶
-
class
Pyjo.String.Mixin.
Pyjo_String_Mixin
¶ This mixin does not provide own constructor method and implements the following new methods.
-
__bool__
()¶ boolean = bool(obj)
True if string representation is also true. (Python 3.x)
-
__bytes__
()¶ bstring = bytes(obj)
Byte-string representation of an object. (Python 3.x)
-
__complex__
()¶ complexnumber = complex(obj)
Converts string representation into complex number.
-
__eq__
(other)¶ boolean = obj == other
True if string representation of the object is equal to other value.
-
__float__
()¶ floatnumber = float(self)
Converts string representation into float number.
-
__ge__
(other)¶ boolean = obj >= other
True if string representation of the object is equal or greater than other value.
-
__gt__
(other)¶ boolean = obj > other
True if string representation of the object is greater than other value.
-
__hash__
()¶ hashvalue = hash(obj)
Returns hash value of string representation of this object.
-
__hex__
()¶ hexnumber = hex(obj)
Converts string representation into hexadecimal number.
-
__int__
()¶ intnumber = int(obj)
Converts string representation into integer number.
-
__le__
(other)¶ boolean = obj <= other
True if string representation of the object is equal or lesser than other value.
-
__long__
()¶ longnumber = long(obj)
Converts string representation into long number.
-
__lt__
(other)¶ boolean = obj < other
True if string representation of the object is lesser than other value.
-
__ne__
(other)¶ boolean = obj != other
True if string representation of the object is not equal to other value.
-
__nonzero__
()¶ boolean = bool(obj)
True if string representation is also true. (Python 2.x)
-
__oct__
()¶ octnumber = oct(obj)
Converts string representation into octadecimal number.
-
__repr__
()¶ reprstring = repr(obj)
String representation of an object shown in console.
-
__str__
()¶ string = str(obj)
String representation of an object.
-
__unicode__
()¶ ustring = unicode(obj)
Unicode-string representation of an object. (Python 2.x)
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
Pyjo.String.Mixin.
object
¶ alias of
Pyjo_String_Mixin