On Wed, 30 Mar 2016 10:21 pm, Jussi Piitulainen wrote:

> Ok, safer to say that some many-to-one mappings are not surjective.

Can you give an example of a Python dict which is not surjective?

Or an example of something which obeys the Mapping ABC which is not
surjective?

Artificial and contrived examples such as this do not count:

class MyDict(dict):
    def values(self):
        for value in super().values():
            yield value
        yield object()  # It's a value without a key!




-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to