Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is/are the Python equivalent(s) to the Java Collections Framework?

The Java Collections Framework is like the C++ Standard Template Library: "a unified architecture for representing and manipulating collections (objects that group multiple elements into a single unit)."

http://java.sun.com/docs/books/tutorial/collections/intro/index.html

like image 698
saidimu apale Avatar asked Jan 12 '10 06:01

saidimu apale


1 Answers

As it turns out, the equivalent to the Java Collections Framework in Python is... Python. All of the core collections featured in the Java Collections Framework are already present in core Python.

Give it a try! Sequences provide lists, queues, stacks, etc. Dictionaries are your hash-tables and maps. Sets are present, etc.

One might consider Python a "higher" language than Java, because it natively provides all of these higher order abstract data types intrinsically. (It also supports Object Oriented, procedural, and functional programming methodologies.)

like image 188
Travis Bradshaw Avatar answered Oct 04 '22 03:10

Travis Bradshaw