Subsets of Python implemented in Python

Richard Thomas chardster at gmail.com
Fri Jul 16 19:54:05 EDT 2010


On Jul 17, 12:34 am, candide <cand... at free.invalid> wrote:
> I don't understand why some parts of the Python language (or the Python
> standard library too) are implemented in C while some other parts are
> implemented in the Python language itself. For instance, lists and
> dictionnaries are implemented in C but sets are not.
>
> Wouldn't be better to implement all in C (for efficiency reasons for
> example) ?

CPython's sets are implemented in C. Old versions of Python
implemented sets in the 'set' module which was written in Python but
that has been deprecated and removed. A lot of the standard library is
implemented in Python because it makes it more easily portable to non-
CPython implementations.

Chard.



More information about the Python-list mailing list