Prev: getting rpy2 from repository
Next: cpan for python?
From: John Posner on 10 Mar 2010 09:45 [ cross-posting to edu-sig ] Bruno (and anyone else interested) -- As I promised/threatened, here's the *start* of a write-up on properties, aimed at non-advanced Python programmers: http://www.jjposner.net/media/python-properties-0310.pdf I'm interested in corrections, of course. But I'm also interested in opinions as to whether this somewhat lengthy treatment is worth the effort -- does it improve on existing write-ups? Tx, John
From: Edward Cherlin on 10 Mar 2010 10:31 On Wed, Mar 10, 2010 at 09:45, John Posner <jjposner(a)optimum.net> wrote: > [ cross-posting to edu-sig ] > > Bruno (and anyone else interested) -- > > As I promised/threatened, here's the *start* of a write-up on properties, > aimed at non-advanced Python programmers: > >  http://www.jjposner.net/media/python-properties-0310.pdf > > I'm interested in corrections, of course. But I'm also interested in > opinions as to whether this somewhat lengthy treatment is worth the effort > -- does it improve on existing write-ups? I find that it will explain things to those who already understand most of the concepts. However, I felt as though I were being led through a maze without knowing where we were headed. This suggests that the concepts can be re-ordered in a manner that will help your readers more, and then we can refactor further. (Yes, you can apply Extreme Programming concepts to create Extreme Documentation, including consultations with users, pair or group writing, frequent refactoring, and more, as at FLOSSManuals.net.) Who is your expected audience? > Tx, > John > > _______________________________________________ > Edu-sig mailing list > Edu-sig(a)python.org > http://mail.python.org/mailman/listinfo/edu-sig > -- Edward Mokurai (é»é·/धरà¥à¤®à¤®à¥à¤à¤¶à¤¬à¥à¤¦à¤à¤°à¥à¤/دھر٠٠Ûگھشبدگر ج) Cherlin Silent Thunder is my name, and Children are my nation. The Cosmos is my dwelling place, the Truth my destination. http://www.earthtreasury.org/
From: Gabriel Genellina on 10 Mar 2010 20:37 En Wed, 10 Mar 2010 11:45:38 -0300, John Posner <jjposner(a)optimum.net> escribi�: > As I promised/threatened, here's the *start* of a write-up on > properties, aimed at non-advanced Python programmers: > > http://www.jjposner.net/media/python-properties-0310.pdf I'd use 'function' instead of 'procedure', as this last word is very uncommon in Python literature (also, "the procedure's return value..." may look very strange to some people). I'm unsure if one should make a distinction 'storage attribute' vs. 'method attribute', or even if it makes things actually more clear. I think you could present the motivating idea first ("I want to execute some code when accessing an attribute") and only later talk about properties and descriptors (as written, the reader still doesn't know how to define a simple property and you've already talked about deleting attributes...) -- Gabriel Genellina
From: John Posner on 18 Mar 2010 12:48 On 3/10/2010 8:37 PM, Gabriel Genellina wrote: > En Wed, 10 Mar 2010 11:45:38 -0300, John Posner <jjposner(a)optimum.net> > escribi�: > >> As I promised/threatened, here's the *start* of a write-up on >> properties, aimed at non-advanced Python programmers: >> >> http://www.jjposner.net/media/python-properties-0310.pdf > > I'd use 'function' instead of 'procedure', as this last word is very > uncommon in Python literature (also, "the procedure's return value..." may > look very strange to some people). I was trying to avoid the function-vs-method swamp, and so I used "procedure". I agree that it was an unfortunate strategy. In a rewrite, I'm using "function" for the most part > > I'm unsure if one should make a distinction 'storage attribute' vs. > 'method attribute', or even if it makes things actually more clear. Agreed -- I was trying too hard to be helpful, and introduced unnecessary terminology. > ... I > think you could present the motivating idea first ("I want to execute some > code when accessing an attribute") and only later talk about properties That was my intention. I hope it comes across more clearly in the rewrite. > and descriptors (as written, the reader still doesn't know how to define a > simple property and you've already talked about deleting attributes...) That doesn't bother me. It's OK to describe capabilities -- but not give how-to's -- in an overview section. And Edward Cherlin wrote: > I find that it will explain things to those who already understand > most of the concepts. However, I felt as though I were being led > through a maze without knowing where we were headed. ... > Who is your expected audience? I was headed toward having the reader *really* understand the @property decorator. And I was intending that reader to be a non-advanced Python user -- say, at the CS 101 level. I'm now convinced that such a goal was "a bridge too far". It has a lot moving parts, including a prerequisite that is a major topic in itself -- the descriptor protocol. That puts the goal way beyond reach. There's another draft at: http://www.jjposner.net/media/python-properties-0318.pdf Many thanks for your comments, John
From: Aahz on 21 Mar 2010 17:34
In article <mailman.555.1268232321.23598.python-list(a)python.org>, John Posner <jjposner(a)optimum.net> wrote: > >Bruno (and anyone else interested) -- > >As I promised/threatened, here's the *start* of a write-up on >properties, aimed at non-advanced Python programmers: > > http://www.jjposner.net/media/python-properties-0310.pdf I'm interested, but not interested enough to download a PDF and fire up a PDF reader. Are you really using features that require PDF instead of just writing a web page? -- Aahz (aahz(a)pythoncraft.com) <*> http://www.pythoncraft.com/ "Many customs in this life persist because they ease friction and promote productivity as a result of universal agreement, and whether they are precisely the optimal choices is much less important." --Henry Spencer |