>From my understanding, str is a string representation, that one uses if 
they want to perform comparisons with other strings.

If you create the str method it will trump the repr method when printing. 
repr is usualy used to show what the object represents, but wont be used in 
evaluations.

*class *str(*object=”*) 
<https://docs.python.org/2/library/functions.html#str>

Return a string containing a nicely printable representation of an object. 
For strings, this returns the string itself. The difference with 
repr(object) is that str(object) does not always attempt to return a string 
that is acceptable toeval() 
<https://docs.python.org/2/library/functions.html#eval>; its goal is to 
return a printable string. If no argument is given, returns the empty 
string, ''.

For more information on strings see Sequence Types — str, unicode, list, 
tuple, bytearray, buffer, xrange 
<https://docs.python.org/2/library/stdtypes.html#typesseq> which describes 
sequence functionality (strings are sequences), and also the 
string-specific methods described in the String Methods 
<https://docs.python.org/2/library/stdtypes.html#string-methods> section. 
To output formatted strings use template strings or the % operator 
described in the String Formatting Operations 
<https://docs.python.org/2/library/stdtypes.html#string-formatting> section. 
In addition see the String Services 
<https://docs.python.org/2/library/strings.html#stringservices> section. 
See also unicode() 
<https://docs.python.org/2/library/functions.html#unicode>.

repr(*object*)¶ <https://docs.python.org/2/library/functions.html#repr>

Return a string containing a printable representation of an object. This is 
the same value yielded by conversions (reverse quotes). It is sometimes 
useful to be able to access this operation as an ordinary function. For 
many types, this function makes an attempt to return a string that would 
yield an object with the same value when passed to eval() 
<https://docs.python.org/2/library/functions.html#eval>, otherwise the 
representation is a string enclosed in angle brackets that contains the 
name of the type of the object together with additional information often 
including the name and address of the object. A class can control what this 
function returns for its instances by defining a __repr__() 
<https://docs.python.org/2/reference/datamodel.html#object.__repr__> method.

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/bf44260a-9186-4157-bdce-829b9dc4b87c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to