Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

whitespace cleanup #289

Open
pyjsorg opened this Issue Apr 27, 2012 · 3 comments

Comments

Projects
None yet
1 participant
Contributor

pyjsorg commented Apr 27, 2012

f not kwargs.has_key('StyleName'): kwargs['StyleName'] = 'gwt-XXXXX'
gets changed to:
kwargs['StyleName'] = kwargs.get('StyleName', 'gwt-XXXXX')

and likewise anything with if kwargs.has_key('Element'): element =
gets changed to element = kwargs.get('Element', DOM.createXXXXX())

and any other code which has the same sort of thing where two statements
are on one line and shouldn't be.

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=430 (June 24, 2010 23:35:48)

Contributor

pyjsorg commented Apr 27, 2012

From luke.lei...@gmail.com on June 25, 2010 10:45:22:
done DisclosurePanel

Contributor

pyjsorg commented Apr 27, 2012

From dim...@gmail.com on September 10, 2010 17:19:37:
should you not be using kwargs.setdefault('StyleName', 'gwt-XXXX') instead?

also in the second example there is a side effect of extra DOM.createXXXX() even if it was not needed.

Contributor

pyjsorg commented Apr 27, 2012

From luke.lei...@gmail.com on September 10, 2010 18:05:20:
yehhs, someone pointed this out, i started using a different style, something like
kwargs.get('Element', None) or DOM.createXXXXX().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment