Ian Kelly <[email protected]>:
> An "object" in Javascript is basically just a collection of
> properties. For example:
>
> js> typeof([1, 2, 3])
> "object"
> js> typeof({a: 1, b: 2, c: 3})
> "object"
>
> Here's what happens when you try to access a property on null:
>
> js> null.foo
> typein:18:0 TypeError: null has no properties
That's not all that different from Python, where object() returns a
fresh instance at each invocation. However:
>>> object().x = 3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'object' object has no attribute 'x'
Why are object instances immutable in Python?
Marko
--
https://mail.python.org/mailman/listinfo/python-list