Learning Python advanced features

J

jvpic

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
 
B

Bruno Desthuilliers

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 ?-)
 
M

Michel Claveau - MVP

Bonsoir !

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

@+

MCI
 
J

Jonathan Gardner

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.
 
J

jvpic

Bruno Desthuilliers a écrit :
jvpic a écrit :

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...
 
B

Bruno Desthuilliers

jvpic a écrit :
Bruno Desthuilliers a écrit :
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 !-)
 
B

Bruno Desthuilliers

Jonathan Gardner a écrit :
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 !-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top