Mentions légales du service

Skip to content

Make the Environment to impelement the dict interface

Ronan-Alexandre Cherrueau requested to merge env-is-dict into 5.x

Make the Environment object a subclass of UserDict so all methods of dict.* (get, pop, copy, ...) could by used.

The old self.__store is now available under self.data.

If necessary, some methods, e.g., __del__ could be forbidden with the following idiom:

class Environment(UserDict):

    # ...

    def __del__(self):
        raise RuntimeError("Deletion not allowed")

What do you think?

Edited by Ronan-Alexandre Cherrueau

Merge request reports

Loading