[Python-3000] Types related to Syntax (original) (raw)
Ron Adam rrr at ronadam.com
Fri Dec 8 05:38:37 CET 2006
- Previous message: [Python-3000] Implementations: A syntax for extending method dispatching beyond type/class inheritance
- Next message: [Python-3000] Types related to Syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I don't normally start threads, but I wasn't sure who to post this as a reply to. This thought or direction of discussion, seems like it may be a useful viewpoint in the type/interface topics.
Python's syntax interacts strongly with a number of basic types. For example (and in general) a for loop requires something that can iterated. The * and ** require or produce lists and dictionaries when used in a function def or call signature. The math operators need numerical types, or a sequence in the case of '+'. The [:] notation indicates a slice object is used. The "", [], (), and {} return or consume specific types of objects. And of course there is the common basic "object".
I'm wonder how many places in pythons syntax requires or produces specific types. And if listing and organizing these commonly used "syntactically necessary" types would be useful to determine the minimum list of ABC's. (More can always be added later.)
One approach to a class tree is to list all the basic parts of possibly commonly used various objects and organize them in a tree such as how java has done. It seems like that's not what we want from the discussion so far.
The approach suggested above, takes a much narrower view and would start by what is only currently necessary by the language's current syntax. These are places where you may possibly need to test for type-ness.
I also wonder if there should be a distinction between a "language type" object, and a "data type" object. A language type object would express something needed by the language itself, where a data type object would be something used to express or interact with information.
Cheers, Ron
- Previous message: [Python-3000] Implementations: A syntax for extending method dispatching beyond type/class inheritance
- Next message: [Python-3000] Types related to Syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]