gah! I hate the new string syntax

Johann Hibschman johann at physics.berkeley.edu
Thu Mar 15 13:13:32 EST 2001


((I think I accidentally emailed this the first time around, so here
goes nothing.))

Fredrik Lundh writes:

> Quinn Dunkan wrote:
>> Note that in ruby, any time you write
>> 
>> class Foo
>> ...
>> end
>> 
>> you are adding to, not overriding, 'Foo'.  Thus,

> does all classes live in the same namespace?

No, you can define a 'module', which is simply a namespace, for your
own classes and variables.  The system classes, such as String, etc.,
do live in one namespace, however.

I actually like this behavior; it makes interactive development
easier.  If I make a change in a source file, I can simply load it in,
and all of the objects in the running system are effectively updated
to reflect those changes.  This is also how Common Lisp behaves, and
CL has similar advantages for interactive development.

But that's going far astray.  I like features like this because I do
very exploratory programming, and have been bitten before by problems
having all the modules and classes update correctly when I make a
change.

Cheers,

--J

-- 
Johann Hibschman                           johann at physics.berkeley.edu



More information about the Python-list mailing list