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/076871.html below:

[Python-Dev] Calling a builtin from C code; PEP 3101 format() builtin

[Python-Dev] Calling a builtin from C code; PEP 3101 format() builtin [Python-Dev] Calling a builtin from C code; PEP 3101 format() builtinNick Coghlan ncoghlan at gmail.com
Thu Feb 14 14:14:01 CET 2008
Eric Smith wrote:
> I see 2 approaches:
> 
> 1: exposing builtin_format(), probably giving it another name 
> (PyObject_Format?) and moving it somewhere other than bltinmodule.c.
> 
> 2: Instead of calling the C code directly, lookup "format" in Python's
> builtins, and call it.  This, I think, would allow you to override the
> global format() function if you wanted to modify the behavior (although
> I can't think of any use case for wanting to do that).
> 
> I don't see where either behavior is specified in the PEP.

abstract.h/abstract.c is where most of the PyObject_* functions live, so 
that would be a likely location if we do go with option 1.

Given that the formatting PEP goes to great lengths to describe how to 
make your own custom formatters, I'd be inclined to favour option 1 myself.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
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