[Python-ideas] Deprecate "slice" on built-ins, move it to "types"?

Joao S. O. Bueno jsbueno at python.org.br
Thu Dec 28 15:09:32 EST 2017


This is probably too little  to justify the compatibility breakage, but is
there a motive for the "slice" type to be on built-ins ?
(besides people forgot it there at PEP-3000 time?)

It is normally used in super-specialized cases, mostly when one is
implementing a Sequence type, and even there just for type-checking,
not to create new slice objects.

It seems to me it should lie on the "types" module (or some other
place), rather than
eat built-in namespace (which can confuse newcomers anyway).

As I said, the benefits of moving it to a less prominent place may be
to little, and
incompatibilities would ensue since all modules using it don't expect to have
to import it anyway. But maybe thsi should be a thing to keep an eye on for
some future Python release?

    js
  -><-


More information about the Python-ideas mailing list