Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #5279 > unrolled thread

Re: Peculiar Behaviour of __builtins__

Started by"Gabriel Genellina" <gagsl-py2@yahoo.com.ar>
First post2011-05-12 23:02 -0300
Last post2011-05-12 23:02 -0300
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Peculiar Behaviour of __builtins__ "Gabriel Genellina" <gagsl-py2@yahoo.com.ar> - 2011-05-12 23:02 -0300

#5279 — Re: Peculiar Behaviour of __builtins__

From"Gabriel Genellina" <gagsl-py2@yahoo.com.ar>
Date2011-05-12 23:02 -0300
SubjectRe: Peculiar Behaviour of __builtins__
Message-ID<mailman.1505.1305252309.9059.python-list@python.org>
En Thu, 12 May 2011 22:59:24 -0300, Gabriel Genellina  
<gagsl-py2@yahoo.com.ar> escribió:

> En Thu, 12 May 2011 20:29:57 -0300, Aman Nijhawan  
> <amannijhawan@gmail.com> escribió:
>
>> I was trying to call the builtin function min by using
>> getattr(__builtins__,'min')
>>
>> This works at the interpretter prompt
>>
>> However when I called it inside a module that was imported by another  
>> module
>> it fails and gives an attribute error
>
> __builtins__ (note the final 's') is an implementation detail. You want  
> the __builtin__ (no 's') module, renamed 'builtin' in Python 3.x

Should read "...renamed 'builtins' in Python 3.x, just to add to the  
confusion." :)


-- 
Gabriel Genellina

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web