Why is Callable ABC in the ABC module collection?

The Python collections.abc module contains many handy ABCs for checking various object objects, but one that apparently doesn't belong is t21>. There is no standard collection, and PEP 3119 does not contain any arguments or even mentions Callable ABC, so why in this package somewhere else?

Context: I am writing a Python-> Java compiler for fun, and I just wanted to see if there are any arguments for a solution, so I could list these considerations in my code.

+7
python abc
source share
1 answer

The module comes from PEP-3119, which offers:

Specific ABCs for containers and iterators to be added to the collections module.

But since then it has turned into something more. And now in the module description boxes and iterators are not mentioned. It says:

This module provides abstract base classes that can be used to test whether a class provides a specific interface; for example, is it hashed or is it a mapping.

I believe this is a submodule of collections only because it was part of it in the past:

New in version 3.3: Previously, this module was part of the collections module.

+1
source share

All Articles