Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Learning Python advanced features (http://www.velocityreviews.com/forums/t696223-learning-python-advanced-features.html)

jvpic 08-27-2009 12:13 PM

Learning Python advanced features
 
Hi,

Learning Python, I understand the mechanism of : closure, __new__,
descriptors, decorators and __metaclass__, but I interrogate myself on
the interest of those technics ?

May somebody explain me the interest ?

Many thanks !

Jackes Bihan

Bruno Desthuilliers 08-27-2009 12:28 PM

Re: Learning Python advanced features
 
jvpic a écrit :
> Hi,
>
> Learning Python, I understand the mechanism of : closure, __new__,
> descriptors, decorators and __metaclass__, but I interrogate myself on
> the interest of those technics ?
>
> May somebody explain me the interest ?


Didn't like my answers on f.c.l.py ?-)

Michel Claveau - MVP 08-27-2009 06:57 PM

Re: Learning Python advanced features
 
Bonsoir !

Tu aurais peut-être dû répondre en anglais (pour certains, "advanced features", c'est mieux que "concepts sophistiqués").

@+

MCI

Jonathan Gardner 08-27-2009 08:44 PM

Re: Learning Python advanced features
 
On Aug 27, 5:13*am, jvpic <jv...@free.fr> wrote:
> Hi,
>
> Learning Python, I understand the mechanism of : closure, __new__,
> descriptors, decorators and __metaclass__, but I interrogate myself on
> the interest of those technics ?
>
> May somebody explain me the interest ?
>


I assume you are asking, "Why do these features exist? What makes them
useful? When would I use them?"

For that, you should re-read the documentation and discussion
surrounding them. The short answer is that the above makes your job,
as a programmer easier. It's easier because you have to write less
code, read less code, and your code has fewer bugs.

jvpic 08-28-2009 06:37 AM

Re: Learning Python advanced features
 
Bruno Desthuilliers a écrit :
> jvpic a écrit :
>> Hi,
>>
>> Learning Python, I understand the mechanism of : closure, __new__,
>> descriptors, decorators and __metaclass__, but I interrogate myself on
>> the interest of those technics ?
>>
>> May somebody explain me the interest ?

>
> Didn't like my answers on f.c.l.py ?-)

Si, mais je voulais savoir ce qu'on en pense sur un autre forum !
Merci encore...

Bruno Desthuilliers 08-28-2009 11:45 AM

Re: Learning Python advanced features
 
jvpic a écrit :
> Bruno Desthuilliers a écrit :
>> jvpic a écrit :
>>> Hi,
>>>
>>> Learning Python, I understand the mechanism of : closure, __new__,
>>> descriptors, decorators and __metaclass__, but I interrogate myself
>>> on the interest of those technics ?
>>>
>>> May somebody explain me the interest ?

>>
>> Didn't like my answers on f.c.l.py ?-)

> Si, mais je voulais savoir ce qu'on en pense sur un autre forum !
> Merci encore...


Hum... I guess the smiley was not big enough !-)


Bruno Desthuilliers 08-28-2009 11:48 AM

Re: Learning Python advanced features
 
Jonathan Gardner a écrit :
> On Aug 27, 5:13 am, jvpic <jv...@free.fr> wrote:
>> Hi,
>>
>> Learning Python, I understand the mechanism of : closure, __new__,
>> descriptors, decorators and __metaclass__, but I interrogate myself on
>> the interest of those technics ?
>>
>> May somebody explain me the interest ?
>>

>
> I assume you are asking, "Why do these features exist? What makes them
> useful? When would I use them?"
>
> For that, you should re-read the documentation and discussion
> surrounding them. The short answer is that the above makes your job,
> as a programmer easier. It's easier because you have to write less
> code, read less code, and your code has fewer bugs.


I think the OP is mostly looking for practical use cases. FWIW, when I
discovered Python's "lambda" (I only knew a couple low-level imperative
languages by that time), I really wondered what an anonymous function
could be used for !-)



All times are GMT. The time now is 03:06 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.