Path: csiph.com!eternal-september.org!feeder.eternal-september.org!newsfeed.kamp.net!newsfeed.kamp.net!fu-berlin.de!uni-berlin.de!not-for-mail From: Terry Reedy Newsgroups: comp.lang.python Subject: Re: PEP Request: Advanced Data Structures Date: Sat, 16 Jul 2016 20:10:47 -0400 Lines: 37 Message-ID: References: <21fcec53-cf5b-4529-9790-63a1c46f534b@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de nO6jodh6V2XnfoObGUx8vQIgm7O4UsGYO4XloJZFDtgQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:PEP': 0.07; 'branching': 0.09; 'mutable': 0.09; 'optional': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.10; 'jan': 0.11; 'inverse': 0.16; 'presume': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'reedy': 0.16; 'subject:Advanced': 0.16; 'wrote:': 0.16; 'tests': 0.18; 'tuples': 0.22; 'programming': 0.22; 'nearly': 0.23; 'slightly': 0.23; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'currently,': 0.29; 'routine': 0.29; 'usable': 0.29; 'code': 0.30; 'functional': 0.32; 'class': 0.33; 'instances': 0.33; 'wrap': 0.33; 'case,': 0.34; 'structure': 0.34; 'lists': 0.34; 'list': 0.34; 'could': 0.35; 'programming.': 0.35; 'skip:i 20': 0.36; 'modules': 0.36; 'structures': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'method': 0.37; 'received:org': 0.37; 'summer': 0.38; 'represent': 0.38; 'data': 0.39; 'does': 0.39; 'easily': 0.39; 'to:addr:python.org': 0.40; 'advanced': 0.61; 'email addr:gmail.com': 0.62; 'linked': 0.63; 'received:96': 0.63; 'different': 0.63; 'our': 0.64; 'between': 0.65; 'subject:Data': 0.66; 'today.': 0.67; 'hand': 0.82; 'frustrating': 0.84; 'british': 0.88; 'received:fios.verizon.net': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: pool-96-227-207-81.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 In-Reply-To: <21fcec53-cf5b-4529-9790-63a1c46f534b@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <21fcec53-cf5b-4529-9790-63a1c46f534b@googlegroups.com> Xref: csiph.com comp.lang.python:111533 On 7/16/2016 6:14 PM, shrey.desai@gmail.com wrote: > I have found it slightly frustrating that Python does not have > built-in support for advanced data structures (Linked Lists, You and I have different ideas of 'advanced data structures' ;-). To me, linked list are limited structures used in functional programming to make mutable structure from immutable-except-on-creation cells. In any case, one can easily use tuples to create branching structures. Tuples and lists containing tuples and lists are routine in python programming. Wrapping such usage in a LinkedList class is optional -- and unusual. > Stacks/Queues, Nearly two decades ago, I promoted the addition of the list.pop method as the inverse of list.append, in order to make lists easily usable as stacks. This is routine in python code today. collections.deque instances are advanced data structures that can be used as stacks, queues, or both, at either end. The class has tests that I presume are rigorous. > BST) British Summer Time? (Suggestion from Google) > Currently, we are required to write our own modules that represent > these data structures and rigorously test/refactor them before we can > actually use them. If an instructor makes you wrap the structures that Python provides before you can use then, that is between you and the instructor, and not our doing. The instructor could let you use Python as it is or hand you the wrapping he likes. -- Terry Jan Reedy