I was trying to call the builtin function min by using <div>getattr(__builtins__,'min') </div><div><br></div><div>This works at the interpretter prompt </div><div><br></div><div>However when I called it inside a module that was imported by another module it fails and gives an attribute error</div>
<div><br></div><div><div>print getattr(__builtins__,'min')(range(20))</div><div>AttributeError: 'dict' object has no attribute 'min'</div></div><div><br></div><div>Also in the interpreter </div><div>
<div>>>>type(__builtins__)</div><div><type 'module'></div><div>but in my module </div><div><br></div><div>print type(__builtins__)</div><div><type 'dict'></div><div><br></div></div><div>
Can anyone help me understand whats going on here?</div><div><br></div><div><br></div><div>Thanks</div><div><br></div><div>-- </div><div>Aman Nijhawan<br><br><br>
</div>