RepugNaNt [entries|reading|network|archive]
simont

[ userinfo | dreamwidth userinfo ]
[ archive | journal archive ]

Wed 2011-12-07 15:45
RepugNaNt
LinkReply
[identity profile] ptc24.livejournal.comWed 2011-12-07 16:39
http://www.python.org/dev/peps/pep-3106/ (http://www.python.org/dev/peps/pep-3106/) has "pseudo-code to define the semantics":

class d_items:

    def __init__(self, d):
        self.__d = d

    def __len__(self):
        return len(self.__d)

    def __contains__(self, (key, value)):
        return key in self.__d and self.__d[key] == value

    (etc.)


which suggests that that sort of optimisation (if you can really call it that) is what is in mind.
Link Reply to this | Parent
navigation
[ go | Previous Entry | Next Entry ]
[ add | to Memories ]