Code Comments
Programming Forum and web based access to our favorite programming groups.sam a écrit : > Bruno Desthuilliers napisa³(a): > > > > > I think I will get back to this discussion after learning "descriptor > protocol" Add lookup (name resolution) rules, metaclasses, 'magic' methods etc to the list then, so you'll get a general view of Python's object model. > and maybe I will not talk about syntax then, and maybe it > won't get off topic. > > As you can see I'm novice in Python, but I can show python-experts some > newbie opinions. If somebody is an expert then he can't take a fresh > look at his many years work. This is indeed true. But be assured their are quite a few newbies (whether nwebie to Python or newbie to programming) posting here to comment on what they perceive as warts - sometimes making good points, sometimes just not knowing enough about the language's inners and/or philosophy to understand why what they think is a wart is considered a feature by more "advanced" users. As some other contributor (hi Diez !) to this thread already mentionned, "Is [Python] perfect? Heck no! But it sure is fun enough to deal with the occasional wart."
Post Follow-up to this messageOn 3 avr, 10:32, sam <s...@mas.pl> wrote: > Bruno Desthuilliers napisa=B3(a): > > > I think I will get back to this discussion after learning "descriptor prot=[/color ] ocol" > and maybe I will not talk about syntax then, and maybe it won't get off to=[/color ] pic. may I recommend this http://www.cafepy.com/article/ (the first 2)?
Post Follow-up to this messageOn Thu, 03 Apr 2008 10:07:38 +0200, sam wrote: > bruno.desthuilliers@gmail.com napisał(a): > > > > > And people start asking why this is that or the other way in Python, and y ou > can't give a good answer to newcomers, especially if Python was chosen as a > first learning language. You can't tell "because Python's parsing mechanis m > don't allow statements in expressions...". But one can tell "because the way Python's syntax is based on indentation, no one has come up with a syntax for anonymous functions without the limitations of the current ``lambda``, that doesn't need 'curly braces' and is still as readable as Python is now." Ciao, Marc 'BlackJack' Rintsch
Post Follow-up to this messageEn Thu, 03 Apr 2008 05:20:48 -0300, sam <sam@mas.pl> escribió: > Gabriel Genellina napisał(a): > > > Actually I don't know what is "descriptor protocol", so maybe I should > have > finished discussing. I will aslo search for "self magic" -- some pieces > of old > code, or something. I meant the way instance methods acquire their "self" argument; the transformation from someobject.foo(arg1,arg2) into (ClassOfSomeobject.foo)(someobject, arg1, arg2) that classic classes do themselves and could not be changed nor extended. The descriptor protocol provides a way for attributes to modify the way they're handled; this is how instance methods get their self argument, and allows for the existence of class methods, static methods, and properties, among other things. The descriptor protocol is very important for Python and understanding it is a good idea, but not before you are rather fluent with the language or it will be fairly incomprehensible. -- Gabriel Genellina
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.