Deprecate "slice" on built-ins, move it to "types"?

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 -><-

On Thu, Dec 28, 2017 at 06:09:32PM -0200, Joao S. O. Bueno wrote:
This is probably too little to justify the compatibility breakage,
Indeed. [...]
Have you actually come across newcomers who are confused by slice being a built-in? I've been on the tutor mailing list, and comp.lang.python, for many years now and I don't recall anyone even asking about slice let alone being confused by it. -- Steve

On Dec 28, 2017 12:10, "Joao S. O. Bueno" <jsbueno@python.org.br> wrote: 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 does get called sometimes in numerical code to construct complex indexing operations. -n

On Thu, Dec 28, 2017 at 06:09:32PM -0200, Joao S. O. Bueno wrote:
This is probably too little to justify the compatibility breakage,
Indeed. [...]
Have you actually come across newcomers who are confused by slice being a built-in? I've been on the tutor mailing list, and comp.lang.python, for many years now and I don't recall anyone even asking about slice let alone being confused by it. -- Steve

On Dec 28, 2017 12:10, "Joao S. O. Bueno" <jsbueno@python.org.br> wrote: 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 does get called sometimes in numerical code to construct complex indexing operations. -n
participants (3)
-
Joao S. O. Bueno
-
Nathaniel Smith
-
Steven D'Aprano