Method / Functions - What are the differences?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Wed Mar 10 20:37:18 EST 2010


En Wed, 10 Mar 2010 11:45:38 -0300, John Posner <jjposner at 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




More information about the Python-list mailing list