Question about math.pi is mutable

Ben Finney ben+python at benfinney.id.au
Mon Nov 9 14:52:07 EST 2015


BartC <bc at freeuk.com> writes:

> On 09/11/2015 01:04, Ben Finney wrote:
> > There isn't a way for the compiler to *know*, in all cases, whether
> > module attributes will be updated during the lifetime of the program
>
> In what way can an attribute be updated, other than deleting it
> altogether?

* Bind a new name to a value.
* Re-bind an existing name to a different value.
* Delete an existing name.

Any of those can be done at run-time, in any module's namespace, by
arbitrary code somewhere in the program.

-- 
 \        “Sane people have an appropriate perspective on the relative |
  `\     importance of foodstuffs and human beings. Crazy people can't |
_o__)                 tell the difference.” —Paul Z. Myers, 2010-04-18 |
Ben Finney




More information about the Python-list mailing list