When using the Python interpreter, just writing
3+4
causes it to print '7'
But when importing some class ('Something', which has its own str and add implemented) and do this:
a=Something(var2)
b=Something(var2)
a+b
the interpreter just prints a message reporting the action (EDIT: by this, I meant the message class.Something object at 0xspam..., which is the output of repr when it's not actually implemented, when I thought I'd get something like the output of str), it doesn't prints the str version of the new object that was just created
Why does this happen? How can it be changed?
EDIT: The problem had to do with confusion over what str and repr do (I didn't know about that repr existed when I asked the question), I thought it was enough for a class to have str implemented to both being able to obtain a string from an object, and being able to print it directly to the interpreter without having to write 'print'. But the latter is something that's actually done by implementing repr appropiately