re: Javascript is like Python wrt OO
IIRC, JavaScript (JS) and Python handle inheritance very differently. Python objects can have an explicit "search path" to hunt parent class/objects. But in JS you "clone" the parent to inherit from it, and then override what you want overridden in the copy (child). There is no explicit parent search path list in JS I don't think. It is purely inheritance-by-cloning. (Whether that is good or bad I won't say.)
Correction: It seems later versions of JS added a "prototype" property, which is essentially a search path, a pointer to the "parent" object/class. In dynamic OO languages, objects are often simply dictionary arrays where the slots can hold attributes or code (or code pointer), and with a parent-search-path of some sort for upward hunts of any non-matching keys in the current array.
________________
oop.ismad.com
Edited by
tablizer
Nov. 7, 2002, 02:12:28 PM EST