Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

11
  • 7
    Semi-relatedly, algebraic data types would be absolutely wonderful, but to use them well you usually need pattern matching. Commented Sep 6, 2010 at 3:03
  • 61
    Is there anything wrong with this method other than it's tedious to write? Commented Sep 14, 2010 at 21:32
  • 2
    You may find dstruct useful: github.com/dorkitude/dstruct Commented Aug 20, 2014 at 20:58
  • 17
    @levesque harder to re-factor without typos, harder to read at a glance while skimming code, than MyStruct = namedtuple("MyStruct", "field1 field2 field3") Commented Sep 2, 2014 at 22:05
  • 7
    Skip to the 2018 answer: stackoverflow.com/a/45426493/703382 Commented May 13, 2018 at 0:13