On 06/11/2015 13:30, Bartc wrote:
On 06/11/2015 02:33, [email protected] 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.)
Still nothing stops you from doing: math.sin = 0 If you really want to? -- https://mail.python.org/mailman/listinfo/python-list
