python improvements (Was: Re: New Language)

Fred Gansevles gansevle at cs.utwente.nl
Tue May 16 08:02:19 EDT 2000


In article <4.3.1.2.20000512165909.01e0bf08 at phear.dementian.com>,
  "Steven D. Arnold" <stevena at permanent.cc> wrote:
>
> 1. I'd like an equivalent to perl's "use strict" pragma.  It's
annoying to
> have to be so paranoid about making a typo in a variable name.  I'd
like
> the compiler to be able to catch those errors for me.
>
> 2. I'd like the ability to specify that a certain parameter or
variable is
> of a given type.  This can help prevent a class of runtime errors
(though
> of course we could use introspection and try/except blocks, but that
adds
> code that, with a type declaration, could be avoided).

Recentely I posted my DCI module (Dynamic Class Injection and friends)
that contains the 'attr' module.
With that you can (among others) do the following with your
instance-attributes (not module-attributes):

+ declare (catches mis-spelled attributes)
+ typed
+ readonly
+ persistent (can not be deleted)
+ call (enables get/set methods)

The package can be downloaded from
    http://www.cs.utwente.nl/~gansevle/python/Dci-0.1.0.tar.gz
There is also a browsable version at
    http://www.cs.utwente.nl/~gansevle/python/Dci-0.1.0/

> Nuff said.  Python kicks ass.  I'm a convert!
Hear, hear!
>
> --
> Steven D. Arnold          Que quiero sera
stevena at permanent.cc
> "We choose to go to the moon in this decade and do the other things,
not
> because they are easy, but because they are hard."    -- John F.
Kennedy
>
>

--
-----------------------------------------------------------------------
----          Linux/Windows-NT/IntraNetware Administrator          ----
-- Whenever it sounds simple, I've probably missed something! ... Me --
-----------------------------------------------------------------------


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list