Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
say 1st or 2nd?
#4
I think all 3 are pretty easy to write and for a caller to use. Personally, I prefer named tuples or classes over dicts because they allow you to name the structure itself (as opposed to just the fields). That's clearly good for documentation, too. I don't know whether named tuples already implement __eq__ and __hash__ should you need them.
Reply


Messages In This Thread
say 1st or 2nd? - by Skaperen - Mar-02-2021, 12:12 AM
RE: say 1st or 2nd? - by ndc85430 - Mar-02-2021, 07:11 AM
RE: say 1st or 2nd? - by Skaperen - Mar-02-2021, 07:11 AM
RE: say 1st or 2nd? - by ndc85430 - Mar-02-2021, 07:51 AM
RE: say 1st or 2nd? - by DeaD_EyE - Mar-02-2021, 09:06 AM
RE: say 1st or 2nd? - by Skaperen - Mar-02-2021, 06:43 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020