473,666 Members | 2,528 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

odict the Ordered Diction 0.2.2

After a break of almost a year there has been an update to `odict the
Ordered Dictionary <http://www.voidspace.o rg.uk/python/odict.html>`_.

The latest version is 0.2.2, with changes implemented by Nicola Larosa.

Despite over 700 downloads since May (plus 1300 as part of `pythonutils
<http://www.voidspace.o rg.uk/python/pythonutils.htm l>`_) there have
been no bug reports, only improvements [#]_. {sm;:-)}

* `Quick Download
<http://www.voidspace.o rg.uk/cgi-bin/voidspace/downman.py?file =odict.py>`_

What is odict?
==========

**odict** is a pure Python implementation of an ordered dictionary. It
keeps keys in insertion order and allows you to change the order.
Methods (including iteration) that would return members in an arbitrary
order are now ordered.

There is also the `SequenceOrdere dDict
<http://www.voidspace.o rg.uk/python/odict.html#sequ enceordereddict >`_
that behaves like a sequence as well as a dictionary. It allows slicing
and the keys, values and items methods are special sequence objects
(which are also callable and so behave as methods too).

What's New ?
==========

Code
-------

Removed the TODO and CHANGELOG sections in the tail docstring (they are
in the docs anyway).

Disabled warnings during tests.

Explicitly disabled tests execution on Python v.2.2 . In addition to
the slicing tests, other ones are failing.

Removed code duplication between the ``__init__`` and the ``update``
methods.

Misc. cleanup.

Also, based on code from `Tim Wegener`_:

- added the ``rename`` method;
- removed a ``has_key`` usage in the ``__setitem__`` method.
Documentation
----------------------

Moved the ISSUES chapter from code's tail docstring to here.

Moved up the `Creating an Ordered Dictionary
<http://www.voidspace.o rg.uk/python/odict.html#crea ting-an-ordered-dictionary>`_
chapter.

Added prompts to the code examples and removed the superfluous print
statements (sometimes they were there, sometimes they were not).

Misc. cleanup.

... [#] So either no-one is using it, or it's really good...

Nov 29 '06 #1
1 1480
Thanks for the post,
Its become a part time job keeping up with
updates.

jim-on-linux

http://www.inqvista.com

On Wednesday 29 November 2006 09:41, Fuzzyman
wrote:
After a break of almost a year there has been
an update to `odict the Ordered Dictionary
<http://www.voidspace.o rg.uk/python/odict.html>
`_.

The latest version is 0.2.2, with changes
implemented by Nicola Larosa.

Despite over 700 downloads since May (plus 1300
as part of `pythonutils
<http://www.voidspace.org.uk/python/pythonutils
.html>`_) there have been no bug reports, only
improvements [#]_. {sm;:-)}

* `Quick Download
<http://www.voidspace.org.uk/cgi-bin/voidspace/
downman.py?fil e=odict.py>`_

What is odict?
==========

**odict** is a pure Python implementation of an
ordered dictionary. It keeps keys in insertion
order and allows you to change the order.
Methods (including iteration) that would return
members in an arbitrary order are now ordered.

There is also the `SequenceOrdere dDict
<http://www.voidspace.org.uk/python/odict.html#
sequenceordere ddict>`_ that behaves like a
sequence as well as a dictionary. It allows
slicing and the keys, values and items methods
are special sequence objects (which are also
callable and so behave as methods too).

What's New ?
==========

Code
-------

Removed the TODO and CHANGELOG sections in the
tail docstring (they are in the docs anyway).

Disabled warnings during tests.

Explicitly disabled tests execution on Python
v.2.2 . In addition to the slicing tests, other
ones are failing.

Removed code duplication between the
``__init__`` and the ``update`` methods.

Misc. cleanup.

Also, based on code from `Tim Wegener`_:

- added the ``rename`` method;
- removed a ``has_key`` usage in the
``__setitem__`` method.
Documentation
----------------------

Moved the ISSUES chapter from code's tail
docstring to here.

Moved up the `Creating an Ordered Dictionary
<http://www.voidspace.org.uk/python/odict.html#
creating-an-ordered-dictionary>`_ chapter.

Added prompts to the code examples and removed
the superfluous print statements (sometimes
they were there, sometimes they were not).

Misc. cleanup.

.. [#] So either no-one is using it, or it's
really good...
Nov 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
3890
by: Jim Cobban | last post by:
I cannot get Netscape 4.79 to properly display the ordered list in the following fragment. <P>Get a specific portion of the date. Depending upon the value of index: <ol start=0> <li>complete value, usually as a <code>String</code>, or if an integral value as an <code>Integer</code>. <li>year as an <code>Integer</code> <li>month number as an <code>Integer</code>
0
931
by: Fuzzyman | last post by:
The response to pythonutils__ was very good. Especially the odict__ module (ordered dictionary) - it's had over one hundred and fifty downloads already. Thanks to some useful user feedback, Nicola Larosa has updated and improved it. More embarassingly we've done a bugfix release of ConfigObj__ - now up to beta 5. This fixes another couple of bugs - we aim to get out of beta someday...... All this is my way of saying that *odict...
1
296
by: JohnA | last post by:
Dear all, I'm trying to compose a query, but I don't know how to express the statement. I have 4 tables: Customers, Orders, Order Details and Products. Each customer has many orders and each order may include many products. Let's say that querying Orders and Order Details, we have the following data: CustomerID ProductID 1 1 1 2 1 3
210
10441
by: Christoph Zwerschke | last post by:
This is probably a FAQ, but I dare to ask it nevertheless since I haven't found a satisfying answer yet: Why isn't there an "ordered dictionary" class at least in the standard list? Time and again I am missing that feature. Maybe there is something wrong with my programming style, but I rather think it is generally useful. I fully agree with the following posting where somebody complains why so very basic and useful things are not part...
22
2356
by: bearophileHUGS | last post by:
>From this interesting blog entry by Lawrence Oluyede: http://www.oluyede.org/blog/2006/07/05/europython-day-2/ and the Py3.0 PEPs, I think the people working on Py3.0 are doing a good job, I am not expert enough (so I don't post this on the Py3.0 mailing list), but I agree with most of the things they are agreeing to. Few notes: - input() vanishes and raw_input() becomes sys.stdin.readline(). I think a child that is learning to program...
0
8440
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8863
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7378
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6189
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5661
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4358
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1763
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.