J2 paper 0.2.1

Shalabh Chaturvedi shalabh at cafepy.com
Mon Aug 23 17:24:52 EDT 2004


Robert Brewer wrote:
> The first draft of the J2 proposal is ready. You can read it here:
> http://www.aminus.org/rbre/python/pydec.html
> 
> At this point, I am looking for comments regarding the proposal.

Good work! I raise some concerns but don't claim to offer solutions 
(that I leave to others :).

I.3 Additional Benifits:

    1. Within a suite, my editor (and many Python editors) indents code 
to 4 spaces. This aligns the decorators with the function name itself, 
due to which the function name gets a little lost. In fact, this happens 
in your examples as well.

    2. Using '|' instead of '@' in the example reduces the visual 
readability advantage of the suite version IMO.

    3. Nitpick. Since you are selling to GvR, it might be nice to spell 
his name correctly in the code examples :) Use lowercase 'v' in van when 
writing the full name.

III Choosing a keyword:

    1. "Reads correctly" but only if you know that 'using' preceeds the 
definition.

using:
     classmethod
def foo(cls):
     pass
using:
     staticmethod
def bar():
     pass

    Using classmethod def foo or def foo using staticmethod?

    2. "Should be easy to search for, in both docs and Google."
       Hmm, 'Python using' is more likely to show irrelevant results 
than, say, 'Python predef'.

    3. Because of above I'd favour the 'predef' keyword. It has almost 
all the advantages you list for 'using', and a few more.

I don't mind the @ syntax at all, but I'll consider signing the proposal 
as an alternative since I now think it to be at least as good. Perhaps 
only if you change the keyword <wink>.

Cheers,
Shalabh




More information about the Python-list mailing list