Why not 3.__class__ ?

Kirby Urner urner at alumni.princeton.edu
Mon Sep 17 03:39:42 EDT 2001


Since I can invoke string methods using string.method() notation,
or go 
  
  >>> 'a'.__class__
  <type 'str'>

why is it that 3.__class__ or 3.__add__(4) are syntax errors.
It looks ugly maybe, but no one says you have to use it.
Why not include for consistency?

Probably good reasons why not.  I'm here to learn.

Kirby




More information about the Python-list mailing list