A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-February/076853.html below:

[Python-Dev] Adding __format__ to classic classes

[Python-Dev] Adding __format__ to classic classes [Python-Dev] Adding __format__ to classic classesGuido van Rossum guido at python.org
Wed Feb 13 23:39:46 CET 2008
On Feb 13, 2008 2:20 PM, Eric Smith <eric+python-dev at trueblade.com> wrote:
> Nick Coghlan wrote:
> > Eric Smith wrote:
> >> I hate to be dense, but could you point me to some code that does
> >> something similar but looks up the method by name?
> >
> > I was going to suggest __enter__/__exit__, but that code relies mainly
> > on existing opcodes and just does an attribute lookup rather than
> > explicitly bypassing the instance dictionary.
> >
> > However, the source code for cPickle may provide some ideas (when it
> > looks up _reduce__/__getstate__/etc).
>
> Those do look promising.  Thanks!

Or look in classobject.c itself; e.g. instance_str().
-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev 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