Static typing (was Re: Java guy interested in Python)

Tim Peters at
Mon Mar 12 05:35:31 CET 2001

[Rainer Deyke]
> When I type 'int i;' in C++, what I really mean is "'i' behaves like an
> integer variable.".

> Since that's all "int i;" *can* mean in C++, seems tautological <wink>.

[Alex Martelli]
> Surely you're joking, Mister Peters?
>     class int {
>         public:
>             int(const char*=0);
>             ~int();
>             const char* data() const;
>     };
>     int i;
> Isn't this perfectly legal C++, meaning something very different from
> "i behaves like an integer variable"...?  int is no "reserved word",
> after all.

As in the "Einstein's Riddle" thread, I was doing Rainer the favor of
assuming he was trying to say something <ahem>.  If I don't extend you the
same favor, then before I can answer your question I have to be assured of a
great many things, such as that e.g. this fragment isn't in the scope of

#define char const


#define const (

or etc <wink>.

     y'rs  - tim

More information about the Python-list mailing list