Java is killing me! (AKA: Java for Pythonheads?)
rosuav at gmail.com
Fri Aug 12 16:39:33 EDT 2011
On Fri, Aug 12, 2011 at 6:02 PM, kj <no.email at please.post> wrote:
> I ask myself, how does the journeyman Python programmer cope with
> such nonsense?
Firstly, figure out how many combinations of optional arguments
actually make sense. Any that don't, don't support. That may well cut
it down significantly. And then, if there are any that make sense but
will be really rare (eg if you allow optional specification of a max
and a min, and most times you'll use either both bounds or neither),
you can save a few by having the "optional" argument specified with a
sentinel meaning "default". It's ugly in a few places to justify
simplicity in most.
If you really need 100% flexibility, then the suggestions already
posted will definitely be the best.
More information about the Python-list