Re: python 3 constant

2011-06-25 Thread Waldek M.
Dnia Sat, 25 Jun 2011 20:59:17 +1000, Chris Angelico napisał(a): > In all seriousness, sometimes adding features to one language is best > done by dropping to another. This is probably not as useful in > interpreted languages like Python, but I have on multiple occasions > run code through the C pr

Re: python 3 constant

2011-06-25 Thread Chris Angelico
2011/6/25 Waldek M. : > Dnia Fri, 24 Jun 2011 08:00:06 +1000, Chris Angelico napisał(a): >>> Yup, got the sarcasm, that's for sure. >>> But your point was...? >> >> That if you want something, there's usually a way to get it. >> Sometimes, giving someone what they want - or showing them how to get

Re: python 3 constant

2011-06-25 Thread Waldek M.
Dnia Fri, 24 Jun 2011 08:00:06 +1000, Chris Angelico napisał(a): >> Yup, got the sarcasm, that's for sure. >> But your point was...? > > That if you want something, there's usually a way to get it. > Sometimes, giving someone what they want - or showing them how to get > it - makes it obvious to t

Re: python 3 constant

2011-06-25 Thread Waldek M.
Dnia Thu, 23 Jun 2011 20:04:43 -0700 (PDT), alex23 napisał(a): >> But your point was...? > > That it's easier for you to find ways to achieve what you want than it > is require Python to change to accommodate your need. And when exactly did I write that I require anyone to change anything? I'd li

Re: python 3 constant

2011-06-25 Thread Waldek M.
Dnia Thu, 23 Jun 2011 23:04:37 +1000, Ben Finney napisał(a): >>> The ability to re-bind any attribute, even ones which the author >>> thought should be constant, makes writing unit tests much easier. I >>> don't see that putative benefits of constant bindings would be >>> anywhere near as valuable.

Re: python 3 constant

2011-06-23 Thread alex23
"Waldek M." wrote: > But your point was...? That it's easier for you to find ways to achieve what you want than it is require Python to change to accommodate your need. -- http://mail.python.org/mailman/listinfo/python-list

Re: python 3 constant

2011-06-23 Thread Chris Angelico
2011/6/24 Waldek M. : > Dnia Fri, 24 Jun 2011 01:29:38 +1000, Chris Angelico napisał(a): >> You can have them in Python. Just run your code through cpp (the C >> preprocessor) first. Voila! >> >> It's handy for other things too. Don't like Python's lack of "then" >> and "end if"? > [...] > Yup, got

Re: python 3 constant

2011-06-23 Thread Waldek M.
Dnia Fri, 24 Jun 2011 01:29:38 +1000, Chris Angelico napisał(a): > You can have them in Python. Just run your code through cpp (the C > preprocessor) first. Voila! > > It's handy for other things too. Don't like Python's lack of "then" > and "end if"? [...] Yup, got the sarcasm, that's for sure. B

Re: python 3 constant

2011-06-23 Thread Chris Angelico
On Thu, Jun 23, 2011 at 9:58 PM, Waldek M. wrote: > Of course, it is just my personal opinion. It might be not pythonic, > I may be wrong, yet - concept of constants is not something new and > if other languages, like C/C++/Java/Perl/ (bash even) have them, > I can't see the reason not to have the

Re: python 3 constant

2011-06-23 Thread Ben Finney
"Waldek M." writes: > Dnia Thu, 23 Jun 2011 17:22:37 +1000, Ben Finney napisał(a): > > The ability to re-bind any attribute, even ones which the author > > thought should be constant, makes writing unit tests much easier. I > > don't see that putative benefits of constant bindings would be > > a

Re: python 3 constant

2011-06-23 Thread Waldek M.
Dnia Thu, 23 Jun 2011 17:22:37 +1000, Ben Finney napisał(a): > If you mean creating a binding which can't be re-bound: −1. Perhaps. Or perhaps that could be done in some other fashion; I admit that I usually stick to more strict languages and while Python's flexibility is great... I'm really missi

Re: python 3 constant

2011-06-23 Thread Ben Finney
"Waldek M." writes: > Still, I'd reallly like to have constants as a built-in... If you mean creating a binding which can't be re-bound: −1. The ability to re-bind any attribute, even ones which the author thought should be constant, makes writing unit tests much easier. I don't see that putati

Re: python 3 constant

2011-06-22 Thread Waldek M.
Dnia Wed, 22 Jun 2011 22:17:49 +0100, Noah Hall napisał(a): > On Wed, Jun 22, 2011 at 7:54 PM, sidRo wrote: >> How to declare a constant in python 3? > > There aren't true constants in Python, but instead we use a standard > defined by PEP 8, which states constants are in all caps, for example,

Re: python 3 constant

2011-06-22 Thread Noah Hall
On Wed, Jun 22, 2011 at 7:54 PM, sidRo wrote: > How to declare a constant in python 3? There aren't true constants in Python, but instead we use a standard defined by PEP 8, which states constants are in all caps, for example, PI = 3.14, as opposed to pi = 3.14 which could change (according to PE

Re: python 3 constant

2011-06-22 Thread Benjamin Kaplan
On Jun 22, 2011 12:03 PM, "sidRo" wrote: > > How to declare a constant in python 3? > -- You don't. Python doesn't have declarations (other than global and nonlocal). Convention is that anything in all caps should be considered a constant but there's no language-level enforcement of it. -- http