Bartc <b...@freeuk.com> writes: > Is there no way then in Python to declare: > > pi = 3.141519 # etc > > and make it impossible to override?
No, and it would be a bad thing if that were something a library author could forbid. Python assumes the programmers using it are consenting adults. Doing harmful things is difficult but not forbidden. Notably, the author of a library should not be forbidding the Pythonic ability to change name bindings as needed. If you want to have a different value bound to the name ‘math.pi’, and you go ahead and explicitly ask to change that binding, the library author has no business forbidding that. -- \ “Software patents provide one more means of controlling access | `\ to information. They are the tool of choice for the internet | _o__) highwayman.” —Anthony Taylor | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list