Notice: While JavaScript is not essential for this website, your interaction with the content will be limited. Please turn JavaScript on for the full experience.
...sorting". This approach offers two advantages. First, it avoids adding overhead to the items() method. Second, it is perhaps more accessible to newbies: when they go looking for a method for sorting dictionaries, they hopefully run into this one, and they will not have to understand the finer points of tuple inversion and list sorting to achieve sort-by-value. To allow the four basic possibilities of sorting by key/value and in forward/reverse order, we could add this method: (4) sorted_item...
Highlights: Python 2.4 Highlights: Python 2.4 Here are the (subjective) highlights of what's new in Python 2.4. Faster A number of modules that were added in Python 2.3 (such as sets and heapq) have been recoded in C. In addition, there's been a number of other speedups to the interpreter. (See section 8.1, Optimizations, of the "What's New" document for more). New language features multi-line imports - when using imports in the form from foo import bar, baz, bing, bang, you c...
...sorting or other operations: k = d.keys(); j = k[:] Dictionary iterators prohibit modifying the dictionary: for k in d.keys(): del[k] stat Methods Replace stat constants or indices with new os.stat attributes and methods. The os.stat attributes and methods are not order-dependent and do not require an import of the stat module. Pattern: os.stat("foo")[stat.ST_MTIME] --> os.stat("foo").st_mtime os.stat("foo")[stat.ST_MTIME] --> os.path.getmtime("foo") Locating: grep os.stat ...
Dependency specification in pyproject.toml based on PEP 508 PEP:631 Title:Dependency specification in pyproject.toml based on PEP 508 Author:Ofek Lev <ofekmeister at gmail.com> Sponsor:Paul Ganssle <paul at ganssle.io> Discussions-To:https://discuss.python.org/t/5018 Status:Accepted Type:Standards Track Created:20-Aug-2020 Post-History:20-Aug-2020 Resolution:https://discuss.python.org/t/how-to-specify-dependencies-pep-508-strings-or-a-table-in-toml/5243/38 Content...
Python Software Foundation: Minutes of Board of Directors Meeting (October 12, 2004) The Python Software Foundation Minutes of Regular Meeting of the Board of Directors October 12, 2004 A regular meeting of the Python Software Foundation (the "PSF") Board of Directors was held over Internet Relay Chat at 17:00 GMT. Stephan Deibel presided at the meeting. 1. Attendance The following members of the Board of Directors were present at the meeting: Jeremy Hylton, Guido van Rossum, Stephan D...
PEP 270 -- uniq method for list objects PEP:270 Title:uniq method for list objects Author:jp at demonseed.net (Jason Petrone) Status:Rejected Type:Standards Track Created:21-Aug-2001 Python-Version:2.2 Post-History: Contents Notice Abstract Rationale Considerations Reference Implementation References Copyright Notice This PEP is withdrawn by the author. He writes: Removing duplicate elements from a list is a common task, but there are only two reasons I can see for making...
...sorting cost. The storage costs are double that for the sorted-list-of-keys approach. A version written in C could use a linked list. The code would be more complex than the other two approaches but it would conserve space and would keep the same big-oh performance as regular dictionaries. It is the fastest and most space efficient. Reference Implementation An implementation with tests and documentation is at: OrderedDict patch The proposed version has several merits: Strict compliance ...
...sorting criteria first: def sort_key(item): return item.attr1, item.attr2 sorted_list = sorted(original, key=sort_key) "Just define a function" has been the rote response to requests for multi-line lambda support for years. As with the above options, it gets the job done, but it really does represent a break between what the user is thinking and what the language allows them to express. I believe the proposal in this PEP would finally let Python get close to the "executable pseudocode" ba...
...sorting versions, it is much preferable if the versioning spec is such that a human can make a reasonable attempt at that sorting without having to run it against some code. Also there's a problem with the use of dates at the "major" version number (e.g. a version string "20090421") with RPMs: it means that any attempt to switch to a more typical "major.minor..." version scheme is problematic because it will always sort less than "20090421". Last, the meaning of - is specific to Setuptools, whil...
Python Software Foundation: Minutes of Board of Directors Meeting (March 11, 2003) The Python Software Foundation Minutes of Regular Meeting of the Board of Directors March 11, 2003 A regular meeting of the Python Software Foundation (the "PSF") Board of Directors was held over Internet Relay Chat at 7 p.m. EST. Guido van Rossum, president of the Foundation and chairman of the Board, presided at the meeting. 1. Attendance The following members of the Board of Directors were present at ...
...sorting matching a sort by Python version of a wheel file name will be kept. Since PEP 515 (Python 3.6), underscores in numeric literals are ignored. This means that int("3_10") and int("310") produce the same result, and ordering based on conversion to an integer will be preserved. However, this is still a bad way to sort tags, and the point is raised here simply to show that this proposal does not make things worse. Security Implications There are no known security concerns. How to Teach T...
Comparing Option-Parsing Libraries Comparing Option-Parsing Libraries NOTE: this page is present for historical purposes only. The getopt-sig is retired, and Optik was added to the Python standard library (as optparse) in Python 2.3. (It was checked in to Python's CVS tree in November 2002, and first released in July 2003.) Since I proposed Optik for the Python standard library, a number of other option-parsing libraries have come to light. I'm trying to evaluate them by ...
...sorting to generator comprehension", https://mail.python.org/pipermail/python-3000/2006-April/001295.html Slices and extended slices won't go away (even if the __getslice__ and __setslice__ APIs may be replaced) nor will they return views for the standard object types. Thread: Future of slices https://mail.python.org/pipermail/python-3000/2006-May/001563.html It will not be forbidden to reuse a loop variable inside the loop's suite. Thread: elimination of scope bleeding of iteration variab...
PEP 359 -- The "make" Statement PEP:359 Title:The "make" Statement Author:Steven Bethard <steven.bethard at gmail.com> Status:Withdrawn Type:Standards Track Created:05-Apr-2006 Python-Version:2.6 Post-History:05-Apr-2006, 06-Apr-2006, 13-Apr-2006 Contents Abstract Withdrawal Notice Motivation Example: simple namespaces Example: GUI objects Example: custom descriptors Example: property namespaces Example: interfaces Specification Open Issues Keyword The make-s...
PEP 3002 -- Procedure for Backwards-Incompatible Changes PEP:3002 Title:Procedure for Backwards-Incompatible Changes Author:Steven Bethard <steven.bethard at gmail.com> Status:Final Type:Process Created:27-Mar-2006 Post-History:27-Mar-2006, 13-Apr-2006 Contents Abstract Rationale Python Enhancement Proposals Identifying Problematic Code References Copyright Abstract This PEP describes the procedure for changes to Python that are backwards-incompatible between the Pytho...
...Sorting Compatibility (Unfiltered): 45441/47114 (96.45%) Total Sorting Compatibility (Filtered): 47057/47114 (99.88%) Projects with No Compatible Versions: 498/47114 (1.06%) Projects with Differing Latest Version: 688/47114 (1.46%) Appendix B : Parsing version strings with regular expressions As noted earlier in the Public version identifiers section, published version identifiers SHOULD use the canonical format. This section provides regular expressions that can be used to test wheth...
PEP 242 -- Numeric Kinds PEP:242 Title:Numeric Kinds Author:paul at pfdubois.com (Paul F. Dubois) Status:Rejected Type:Standards Track Created:17-Mar-2001 Python-Version:2.2 Post-History:17-Apr-2001 Contents Abstract Rationale Supported Kinds of Ints and Floats Kind Objects Attributes of Module kinds Complex Numbers Examples Open Issues Rejection Copyright Abstract This proposal gives the user optional control over the precision and range of numeric computations so that a c...
PEP 454 -- Add a new tracemalloc module to trace Python memory allocations PEP:454 Title:Add a new tracemalloc module to trace Python memory allocations Author:Victor Stinner <vstinner at python.org> BDFL-Delegate:Charles-François Natali <cf.natali at gmail.com> Status:Final Type:Standards Track Created:03-Sep-2013 Python-Version:3.4 Resolution:https://mail.python.org/pipermail/python-dev/2013-November/130491.html Contents Abstract Rationale Proposal API Functions...
Python Software Foundation: Minutes of Board of Directors Meeting (December 10, 2002) The Python Software Foundation Minutes of Regular Meeting of the Board of Directors December 10, 2002. A regular meeting of the Python Software Foundation (the "PSF") Board of Directors was held over Internet Relay Chat at 13:02 PM PCT. Guido van Rossum, president of the Foundation and chairman of the Board, presided at the meeting. 1. Attendance The following members of the Board of Directors were pr...
Bugs in Python 2.3.5 IDLE now executes code in a separate process. To communicate between the main process and executing processes, IDLE opens a socket to 127.0.0.1 (the local machine). Some firewalls running on Windows machines interfere with this and can cause either silent failures or erroneous popup windows from the firewall. This problem only occurs if you run a firewall on the same machine as IDLE. Build bugs Some platforms require some tinkering to get a clean build of Python. So...