Quantcast
Channel: Mako: Ticket Query
Viewing all articles
Browse latest Browse all 38

#98: remove amateurish pythonisms

$
0
0

this includes:

  • super long lines of code, lets chop them all at 60 chars or whatever pep8 calls for
  • this beauty:
[module_identifiers.declared.add(x) for x in ["UNDEFINED"]]

and also this:

[module_identifiers.declared.add(x) for x in impcode.declared_identifiers]

use instead:

module_identifiers.declared.update(impcode.declared_identifiers)
  • all the "foo %s" % repr(x) - use %r
  • x = property(lambda x: ...) - use def instead.
  • someset = someset.union(x); someset = someset.union(y); geez just use union_update()


Viewing all articles
Browse latest Browse all 38

Trending Articles