Inefficiency of __getattr__
Kragen Sitaker
kragen at dnaco.net
Wed Oct 4 01:41:01 EDT 2000
More information about the Python-list mailing list
Wed Oct 4 01:41:01 EDT 2000
- Previous message (by thread): Inefficiency of __getattr__
- Next message (by thread): Inefficiency of __getattr__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In article <mailman.970553407.740.python-list at python.org>, <jay.krell at cornell.edu> wrote: >>Every time I've argued static versus dynamic typing with a >>static-typing fan, they've ended up concluding that what they really >>hate is not dynamic typing but silent coercions. > >You haven't argued with me. :) >C++ allows silent coercions in a few places that make sense -- cast to base >class, call of user defined "operator T()" and call of user defined >constructor, besides the "usual" numeric conversions and conversion of 0 to >any pointer type (this can actually be a problem, like where stuff is >defined to operate on integers and pointers, the language would be much >better off with magic like >#define NULL __null >than #define NULL 0 where "_null" is compiler magic for the null pointer of >any type and 0 favors being an integer before being a pointer.. >std::vector<int>'s constructor runs into this problem). > >To keep things from a exploding combinatorially in the compiler, the >language only allows one level of silent conversion. OK, so you agree that silent coercions cause problems in some cases in C++, some of which cases are built into the language. So what's the advantage of static typing over dynamic typing? Does it help you catch bugs, and if so, which ones? -- <kragen at pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/> Perilous to all of us are the devices of an art deeper than we ourselves possess. -- Gandalf the Grey [J.R.R. Tolkien, "Lord of the Rings"]
- Previous message (by thread): Inefficiency of __getattr__
- Next message (by thread): Inefficiency of __getattr__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list