Initializing Python struct objects with optional defaultsRecently I was writing code to register names and their
attributes. There were enough attributes that I didn't want to specify
all of them all of the time, so I did the obvious Python thing: I made
the The straightforward way to initialize the struct object was to write
' It turns out that you can use the
(I did not strictly need the A similar pattern can be done directly in a
(You really want to exclude |
These are my WanderingThoughts GettingAround This is part of CSpace, and is written by ChrisSiebenmann. * * * Atom feeds are available; see the bottom of most pages. Categories: links, linux, programming, python, snark, solaris, spam, sysadmin, tech, unix, web |