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

Tim Peters tim.one at home.com
Sun Mar 11 23:35:31 EST 2001


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

[Tim]
> 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

or

#define const (

or etc <wink>.

there's-more-than-meets-the-eye-when-there's-more-than-meets-the-eye-ly
     y'rs  - tim





More information about the Python-list mailing list