[Python-3000] Types related to Syntax

Ron Adam rrr at ronadam.com
Sat Dec 9 04:01:07 CET 2006

Bill Janssen wrote:
> Ron,
>> 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.)
> I think a lot of the syntactic niceties have been developed to support
> various usage patterns, but not every usage pattern has been
> special-cased with syntax, because some are already supported by the
> basic language structures.  But I agree that looking at the types
> which define special methods which are mapped to "operators" is a good
> idea.  I just don't see any assurance that it would produce the complete
> set.

What kind of basic language structures are you thinking of?  An example would be 

It's not just about types having special methods, which address's most 
situations where you may need to test an argument.  There are also those 
syntax's that produce types (objects) with no arguments, and places that are 
implemented directly as byte codes so that no python level methods are involved.

It wouldn't be a complete set. What would that be anyway?

This would be the necessary subset needed to catch and handle error situations 
that may arise because of basic language constraints.  It would be/contain all 
built in types and be relatively small.

It would not rule out one or more importable class trees suited to general or 
even very specific data usage patterns.

>> 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.
> To support operators.  But there are other reasons to test for type-ness.

I should have said...  possibly need to test for type-ness due to syntax 


More information about the Python-3000 mailing list