durusmail: quixote-users: Generalizing form/widget API a bit
Generalizing form/widget API a bit
2003-11-25
2003-11-25
2003-11-25
2003-11-25
2003-11-25
2003-11-26
2003-11-26
2003-11-26
2003-11-26
2003-11-26
2003-11-26
2003-11-26
2003-11-26
2003-11-26
2003-11-26
2003-11-26
2003-11-29
2003-11-30
2003-11-26
2003-11-26
2003-11-26
Patch: add html_attrs keyword arg to widget classes
2003-11-30
Patch: add html_attrs keyword arg to widget classes
2003-12-01
Patch: add html_attrs keyword arg to widget classes
2003-12-01
Patch: add html_attrs keyword arg to widget classes
2003-12-01
2003-12-02
2003-12-03
2003-12-02
Patch: add html_attrs keyword arg to widget classes
2003-12-01
Patch: add html_attrs keyword arg to widget classes
2003-12-01
Generalizing form/widget API a bit
Nicola Larosa
2003-11-26
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>>> Note 'class_' instead of 'css_class' -- this is the convention used by
>>> PyGTK to avoid collisions with keywords (builtins too? can't remember),
>>> and it's as good as any.

>> I have seen this gimmick in a few places, so there should be no
>> problem with Quixote doing it, too.  Easier to spell than "css_class".

> It's a nasty, inconsistent gimmick, IMO.  Or does it allow for
> consistent use of the trailing underscore even with non-keywords?

Hey, look out before you speak up against the wise words of Da Man himself: ;^)


"In addition, the following special forms using leading or trailing
underscores are recognized (these can generally be combined with any
case convention):

...

- - single_trailing_underscore_: used by convention to avoid
  conflicts with Python keyword, e.g.
  "Tkinter.Toplevel(master, class_='ClassName')".

...

Public attributes should have no leading or trailing
underscores, unless they conflict with reserved words, in which
case, a single trailing underscore is preferrable to a leading
one, or a corrupted spelling, e.g. class_ rather than klass.
(This last point is a bit controversial; if you prefer klass
over class_ then just be consistent. :)."


PEP 8 - Style Guide for Python Code
http://www.python.org/peps/pep-0008.html


(Someone's got to read the bloody guidelines. ;^) )


- --
"Having a smoking section in a restaurant is like having
a peeing section in a swimming pool." -- Edward Burr

Nicola Larosa - nico@tekNico.net



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/xM9dXv0hgDImBm4RApUNAJsEiA8Qi9ZxP9W1NeMsKjtGn9G/PQCfQb/k
rdImp6hKA8qtUYN8baewGo0=
=jf1i
-----END PGP SIGNATURE-----



reply