[Tutor] New class, how return value of x in interactive shell

Vincent Davis vincent at vincentdavis.net
Mon Apr 5 21:03:27 CEST 2010

Take a look at the repr and str methods:

Ok so I am still a little confused, It seems that __str__ is used for print
and str()
byt what allows whats below. That is why does just entering the name of the
instance return print(b). I have tried a few combinations but not the right
in   >>>b
out >>>21-letter "BString" instance
               seq: I am a BString object

*Vincent Davis
720-301-3003 *
vincent at vincentdavis.net
 my blog <http://vincentdavis.net> |

On Mon, Apr 5, 2010 at 11:24 AM, Wayne Werner <waynejwerner at gmail.com>wrote:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100405/366f64ab/attachment.html>

More information about the Tutor mailing list