PEP Request: Advanced Data Structures

Shrey Desai shrey.desai at gmail.com
Sat Jul 16 18:33:12 EDT 2016


On Saturday, July 16, 2016 at 3:19:56 PM UTC-7, Chris Angelico wrote:
> On Sun, Jul 17, 2016 at 8:14 AM,  <shrey.desai at gmail.com> wrote:
> > I have found it slightly frustrating that Python does not have built-in support for advanced data structures (Linked Lists, Stacks/Queues, BST) in its distribution. Many computer science students, developers, and software engineers rely on these data structures; having the data structures be a part of the distribution and be maintained by the Python community would be immensely useful.
> >
> 
> Why do you need a linked list? That's an implementation detail; why
> not simply use a regular list?
> 
> Not trolling, genuinely asking. Is there something that you
> specifically need those exact structures for?
> 
> Also: You may find what you want on PyPI. There's no need for them to
> be in the core language if they can be published as third-party
> modules.
> 
> ChrisA

Hi Chris, thanks for the reply. There's a couple of reasons why I would need a Linked List (and other data structures):
- Education: the Linked List is a core data structure that CS undergraduates (among others) use and study, so it is vital that they have hands on access to them. A list is basically a dynamic array; the only property it shares with a Linked List is that it's dynamic.
- Development: the use of correct data structures is important when developing applications, especially for issues like scaling and efficiency. For instance, when working with polynomials, Linked Lists provide a great interface to access and edit them.

Also, I have a couple of issues with them being published as third-party modules:
1. These data structures have to be rock solid. They should be clearly defined, rigorously tested, and they should simply work. Python would put more emphasis on its development rather than some external developer that might quit half way.
2. Some external packages might contain better data structures than others. For instance, there might be some "DataStructures" package that contains everything, but maybe some developer published a "LinkedList" package that has the best Linked List implementation and some other developer published a "BST" package that has the best BST implementation. Why mix and match when everything can be in one place?
3. Python, fundamentally, is an easy to use language and it should stay that way. Beginners shouldn't have to worry about installing external modules when the data structures package is in the distribution and all they need to do to use it is import it.



More information about the Python-list mailing list