J2 proposal: keyword
Michael Sparks
zathras at thwackety.com
Sun Aug 22 19:23:32 EDT 2004
On 22 Aug 2004, Paul Rubin wrote:
> "Robert Brewer" <fumanchu at amor.org> writes:
> > -Candidates for keywords have fallen into two or three camps, and
> > emphasize different aspects of decorators:
> >
> > -Declarative: declare, predef, moddef
> > -Transformative: transform, wrap, modify, mutate
> > -Attributive/Annotative: amend, using, having
> > -Directive: pragma, signify
> > -Associative: helper, qualify, qual, meta
> > -Cross-cutting: imbue, endow, bestow, embellish, extend, accum, glom,
> > confer
> > -Prepositions/Adverbs: using, through, per, via, by
>
> Not sure where these would go: prologue, preamble, preface
>
> How about something like "def_using"?
How is def_using different from "using ... def ..." ? ;-)
FWIW, I've spent a significant chunk of today after getting the patch for
J2 working looking at what keywords clash and what doesn't.
* decorate, transform and declare have clashes with several easy to
find projects. This includes commonly used things like mailman &
pyrex.
* "using" appears to be used only by python itself in webbrowser.py in
the get function as a single named parameter, however which I can't
find any project using it.
I discovered this after replacing "decorate" with "using" and
rerunning the test suite... Incidentally the syntax also allows
code like this:
using:
staticmethod synchronised memoise deprecated
def: foo(bar):
"This function foos bars all day long"
pass
Personally, I think that's quite nice. I've not posted the updated
patch yet because I'm looking at the short/single line version.
Projects I've grepped (and looked through the results) through include:
wxPython, libxml2, SWIG, PyXML, ZODB4, distutils (as a standalone)
egenix-mx, Redfoot RDF tools, PyLucene, dbxml
libxslt, jabber-py, PyEgads, PyChecker, soappy
m2crypto, epydoc, 4suite, Chandler
At some point Zope and Twisted need checking as well. (I'd like to check
most things, but those 2 strike me as important checks)
On a more general note, I think when suggesting a new keyword how widely
used a keyword is should be taken into account, which really needs to take
into account how widely used projects are that use the keyword.
At the end of the day, hopefully this helps Guido and everyone make a
decision, and helps build consensus either in favour of keyword based
(and a keyword), or towards the current @pie syntax.
Regards,
Michael.
More information about the Python-list
mailing list