qualifying built-in functions

Fredrik Lundh fredrik at pythonware.com
Sun May 4 11:02:02 EDT 2003


Jp Calderone wrote:

> > For know I can rename max to maxVal, or something, but I am interested
> > in knowing whether there is a way to qualify built-in functions so I
> > don't need to do this. Hardly critical, I know, but interesting none the
> > less.
>
>   __builtins__.max
>
>   (Not that I'd recommend actually using this just to avoid name
> collisions).

the module is named __builtin__ (no s), and should be imported
like any other module:

    import __builtin__
    v =__builtin__.max(x, y)

the __builtins__ object is an implementation detail, and should
not be used directly.

</F>








More information about the Python-list mailing list