Josiah Carlson wrote: > Larry Hastings <[EMAIL PROTECTED]> wrote: > >> Josiah Carlson wrote: >> >>> one thing to note with your method - you can't guarantee the order >>> of the attributes as they are being displayed. >>> >> Actually, my record type *can*; see the hack using the __names__ field. > Actually, it *can't*. The ordering of the dict produced by the **kwargs > arguments is exactly same as a regular dictionary.
Just to set the record.py straight, more for posterity than anything else: Actually, it *does*, because my prototype has explicit support for imposing such an ordering. That's what the "__names__" field is used for--it's an optional array of field names, in the order you want them displayed from __repr__(). Mr. Carlson's posting, while correct on general principles, was just plain wrong about my code; I suspect he hadn't bothered to read it, and instead based his reply on speculation about how it "probably" worked. My "record" prototype has no end of failings, but an inability to "guarantee the order of the attributes as they are being displayed" is simply not one of them. /larry/ _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com