Re: Descriptors vs Property

2016-03-11 Thread Chris Angelico
On Sat, Mar 12, 2016 at 5:24 PM, Veek. M wrote: >> Also, what's this bit: >> self.default = default if default else type() > But type() just gives me: > TypeError: type() takes 1 or 3 arguments > on py2,3 Check out the context of the original line of code and see what it's doing. It isn't the sam

Re: Descriptors vs Property

2016-03-11 Thread Ian Kelly
On Fri, Mar 11, 2016 at 11:24 PM, Veek. M wrote: > Ian Kelly wrote: > >> On Fri, Mar 11, 2016 at 10:59 PM, Veek. M wrote: >>> Also, what's this bit: >>> self.default = default if default else type() >> >> If the default parameter has a truthy value, it gets set to >> self.default. Otherwise, the

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-11 Thread Marko Rauhamaa
Chris Angelico : > Definitely agree with this. Having a way to declare that a name is > "truly constant" would be extremely handy; I don't think it would be all that handy. I'm afraid all this type hinting will turn Python into a poor man's Java. > Maybe, but I honestly don't miss 'switch' all t

<    1   2