Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6216493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:15:32+00:00 2026-05-24T07:15:32+00:00

One of the reasons I love Python is the expressive power / reduced programming

  • 0

One of the reasons I love Python is the expressive power / reduced programming effort provided by tuples, lists, sets and dictionaries. Once you understand list comprehensions and a few of the basic patterns using in and for, life gets so much better! Python rocks.

However I do wonder why these constructs are treated as differently as they are, and how this is changing (getting stranger) over time. Back in Python 2.x, I could’ve made an argument they were all just variations of a basic collection type, and that it was kind of irritating that some non-exotic use cases require you to convert a dictionary to a list and back again. (Isn’t a dictionary just a list of tuples with a particular uniqueness constraint? Isn’t a list just a set with a different kind of uniqueness constraint?).

Now in the 3.x world, it’s gotten more complicated. There are now named tuples — starting to feel more like a special-case dictionary. There are now ordered dictionaries — starting to feel more like a list. And I just saw a recipe for ordered sets. I can picture this going on and on … what about unique lists, etc.

The Zen of Python says “There should be one– and preferably only one –obvious way to do it”. It seems to me this profusion of specialized collections types is in conflict with this Python precept.

What do the hardcore Pythonistas think?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T07:15:33+00:00Added an answer on May 24, 2026 at 7:15 am

    These data types all serve different purposes, and in an ideal world you might be able to unify them more. However, in the real world we need to have efficient implementations of the basic collections, and e.g. ordering adds a runtime penalty.

    The named tuples mainly serve to make the interface of stat() and the like more usable, and also can be nice when dealing with SQL row sets.

    The big unification you’re looking for is actually there, in the form of the different access protocols (getitem, getattr, iter, …), which these types mix and match for their intended purposes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm programming an online game for two reasons, one to familiarize myself with server/client
For a few different reasons one of my projects is hosted on a shared
One of the reasons I usually don't use an IDE for development is that
There are many security reasons why one would want to drop an HTTP connection
Switch statement fallthrough is one of my personal major reasons for loving switch vs.
Are there good reasons why it's a better practice to have only one return
Which one is recommended considering readability, memory usage, other reasons? 1. String strSomething1 =
For various reasons, we are writing a new business objects/data storage library. One of
I've heard in a few places that one of the main reasons why distributed
I love triggers for one reason - they just work. I hate triggers for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.