At 11:15 AM 3/14/2007 -0700, Guido van Rossum wrote:
>I think this rebuttal isn't strong enough; I'm sure there *will* be
>use cases where a custom prepare method can solve a problem that a
>standard ordered dict couldn't.

For example, a custom prepare could provide access to special method names 
to do things in the body, ala Ruby on Rails' ActiveRecord DSL.  e.g.:

    class SomeRecord(Record, table_name="foo")
        x = many(OtherRecord)

Where 'many' is actually an object returned by the special dictionary's 
__getitem__.  In addition, it might be the case that "OtherRecord" is a 
class that doesn't exist yet, and the special dictionary returns a 
placeholder object that will serve until a record type with that name is 
defined.

This use case doesn't even *need* ordering, but it does need __prepare__.

_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to