Re: Should constants be introduced to Python?

2017-11-17 Thread Marcin Tustin
Yes the same consideration applies to any new feature. I think that Python's reticence to add new features has been a strength. And I do think the benefit here is absolutely negligible. It's not that I don't like constants - but there's a bunch of things that go great together, like constants, fun

Re: Should constants be introduced to Python?

2017-11-17 Thread bartc
On 17/11/2017 15:14, Marcin Tustin wrote: I'm against this because Python's strength is its simplicity. If it was simple once, then it isn't any more. Perhaps you mean consistency, in having only one class of identifier which can always be assigned to. All the benefits of this can be achie

Re: Should constants be introduced to Python?

2017-11-17 Thread Marko Rauhamaa
Marcin Tustin : > I'm against this because Python's strength is its simplicity. This > doesn't actually simplify anything, but it does add a new language > feature to understand. And there will be eternal debates on the correct use of the feature. One of the ugliest features of C is the "const"

Re: Should constants be introduced to Python?

2017-11-17 Thread Marcin Tustin
I'm against this because Python's strength is its simplicity. This doesn't actually simplify anything, but it does add a new language feature to understand. All the benefits of this can be achieved with linting. On Thu, Nov 16, 2017 at 1:16 AM, Saeed Baig wrote: > Hey guys I am thinking of perh

Re: Should constants be introduced to Python?

2017-11-17 Thread bartc
On 16/11/2017 06:16, Saeed Baig wrote: Hey guys I am thinking of perhaps writing a PEP to introduce constants to Python. Something along the lines of Swift’s “let” syntax (e.g. “let pi = 3.14”). Since I’m sort of new to this, I just wanted to ask: - Has a PEP for this already been written? If

Re: Should constants be introduced to Python?

2017-11-16 Thread Chris Angelico
On Fri, Nov 17, 2017 at 9:27 AM, Terry Reedy wrote: > CPython, at least, already has anonymous constant objects. Number and > string literals are turned into objects when parsed. I presume that all > implementations do this. Some constant expressions are replaced by > (constant) objects during

Re: Should constants be introduced to Python?

2017-11-16 Thread Terry Reedy
On 11/16/2017 4:55 PM, Michael Torrie wrote: On 11/15/2017 11:16 PM, Saeed Baig wrote: - Do you guys think it would be a good idea? Why or why not? Do you think there’s a better way to do it? I’d like to know what others think about this idea before making any formal submission. Except for for

Re: Should constants be introduced to Python?

2017-11-16 Thread Michael Torrie
On 11/15/2017 11:16 PM, Saeed Baig wrote: > - Do you guys think it would be a good idea? Why or why not? Do you > think there’s a better way to do it? I’d like to know what others > think about this idea before making any formal submission. Except for forcing it to be read-only, there's absolutely

Re: Should constants be introduced to Python?

2017-11-16 Thread Ned Batchelder
On 11/16/17 1:16 AM, Saeed Baig wrote: Hey guys I am thinking of perhaps writing a PEP to introduce constants to Python. Something along the lines of Swift’s “let” syntax (e.g. “let pi = 3.14”). Since I’m sort of new to this, I just wanted to ask: - Has a PEP for this already been written? If