[Python-3000] Types related to Syntax

Ron Adam rrr at ronadam.com
Fri Dec 8 05:38:37 CET 2006

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.


More information about the Python-3000 mailing list