On 06/11/2015 02:33, wa...@travelsky.com wrote:
Hello, python-list guys:

     I am a newbie of python from Beijing. China.
     I have a question about "math.pi".
     As you can see in the attachment, why i can modify "math.pi"?
     (in "mathmodule.c" "pi" is a "static const double")

Python isn't C.

Your attachment isn't visible, but it can be demonstrated easily:

import math

math.pi=0

print (math.pi)

In Python, presumably 'pi' is just another variable, and variables can be written to.

(Perhaps math.pi would be better off as a function.)

--
Bartc

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

Reply via email to