On Jan 3, 7:04 am, Bernhard Merkle <[EMAIL PROTECTED]>
wrote:
> Hi there,
>
> I am reading Learning Python 3e from Mark Lutz and just found out that
> reassigning to builtins is possible.
> What is the reason, why Python allows this ? IMO this is very risky
> and can lead to hard to find errors.
I don't think it's a huge issue. In fact, I think it's a feature. For
example, it'd be extremely issue to reassign open, if you wanted to
implement a virtual file system, and you couldn't modify the module
the used open.
> (see also Learning Python 3e, Chapter 16, Page 315)
>
> >>> True
> True
> >>> False
> False
> >>> True = 1
> >>> True
> 1
> >>> True = 0
> >>> True
>
> 0
>
> TIA,
> Berni

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to