Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #5279 > unrolled thread
| Started by | "Gabriel Genellina" <gagsl-py2@yahoo.com.ar> |
|---|---|
| First post | 2011-05-12 23:02 -0300 |
| Last post | 2011-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.
Re: Peculiar Behaviour of __builtins__ "Gabriel Genellina" <gagsl-py2@yahoo.com.ar> - 2011-05-12 23:02 -0300
| From | "Gabriel Genellina" <gagsl-py2@yahoo.com.ar> |
|---|---|
| Date | 2011-05-12 23:02 -0300 |
| Subject | Re: 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
Back to top | Article view | comp.lang.python
csiph-web