Code generator and visitor pattern
Christian Heimes
lists at cheimes.de
Thu Jul 15 14:46:13 EDT 2010
> Since Python isn't stringly typed, single-dispatch isn't available per
> se. So is the "double-dispatch" Visitor pattern, which is usually used
> in OO systems to implement code generators. So, what is the de facto
> method in Python to handle source code generation?
Do you mean strongly typed langauge?
You are wrong, Python is a strongly typed language. Perhaps you are
confusing strong/weak with dynamic/static? These attributes are
orthogonal to each other. Python is a strongly and dynamicly typed language.
The visitor pattern is required for double dispatching in *some* OO
language like C++, to work around issues with inheritance and function
overloading. Python's OO works differently.
Christian
More information about the Python-list
mailing list