Python weirdness

Status
You're currently viewing only karmakaze's posts. Click here to go back to viewing the entire thread.
Not open for further replies.

karmakaze

Ars Tribunus Militum
1,700
Subscriptor
You might want to check out PyLint, it should help catch gotchas like that: http://www.logilab.org/857

if you want to keep your code a little more concise 'self.content = content or []' also works just like the if block on most fairly recent versions of Python (definitely 2.5+, not sure about 2.4-). Not a big deal with one default value, but if you have 5 or 6 all those if blocks get in the way of readability.
 
Status
You're currently viewing only karmakaze's posts. Click here to go back to viewing the entire thread.
Not open for further replies.