A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/305146.html below:

defining __repr__

defining __repr__ defining __repr__Gerrit Holl gerrit at nl.linux.org
Thu Sep 15 13:22:54 EDT 2005
sven wrote:
> i'd like to define __repr__ in a class to return the standardrepr
> a la "<__main__.A instance at 0x015B3DA0>"
> plus additional information.
> how would i have to do that?
> how to get the standardrepr after i've defined __repr__?

>>> object.__repr__(4)
'<int object at 0x94f7d8c>'

Gerrit.

-- 
Temperature in Luleå, Norrbotten, Sweden:
| Current temperature   05-09-15 19:19:58    7.8 degrees Celsius ( 46.0F) |
-- 
Det finns inte dåligt väder, bara dåliga kläder.

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4