Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Ferenczi Viktor
> > Properties are very useful, since ordinary attribute access can be > > transparently replaced with properties if the developer needs to > > add code when it's set or needs to calculate it's value whenever > > it is read. > > I totally agree. I like to use properties. However, Python already >

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Ferenczi Viktor
> > AFAIK there is no such a thing as "intentionally ugly" in the Python > > language. I've never read this sentence before in manuals, tutorials, > > etc. > > Perhaps not, but ... > > http://mail.python.org/pipermail/python-dev/2005-September/056846.html > WOW, thats true! :-D (AFAIK these cre

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Ferenczi Viktor
Hello, > > from property_support import hasProperties, Property > > > > @hasProperties > > class Sphere(object): > >     def setRadius(self, value): > >         ... some setter implementation ... > >     radius=Property(default=1.0, set=setRadius, type=(int, float)) > >     color=Property(default=

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Ferenczi Viktor
Hello, > > from property_support import hasProperties, Property > > > > @hasProperties > > class Sphere(object): > > def setRadius(self, value): > > ... some setter implementation ... > > radius=Property(default=1.0, set=setRadius, type=(int, float)) > > color=Property(default=

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Ferenczi Viktor
Hi! > The reading I've done so far on Python 3 (alpha announcement, meta-PEP, > some other PEPs) is generally encouraging, but there doesn't seem to be > much on cleaning up the syntax, which has become uglier over time as > features have been added on to an original syntax that wasn't designed >

Re: doctest and decorators

2007-09-04 Thread Ferenczi Viktor
> > @functools.wraps(f) > > Pass the function to be wrapped by the decorator to the wraps function. > Ooops, right. That doesn't change the fact that decorated functions get > hidden from doctest though. Run my test script (one file) with the -v (verbose) option. Without the -v option it does not

Re: doctest and decorators

2007-09-04 Thread Ferenczi Viktor
> @functools.wraps Correctly: @functools.wraps(f) Pass the function to be wrapped by the decorator to the wraps function. Regards, Viktor -- http://mail.python.org/mailman/listinfo/python-list

Re: doctest and decorators

2007-09-04 Thread Ferenczi Viktor
> I assume this is a FAQ, but I couldn't find much helpful information > googling. I'm having trouble with doctest skipping my functions, if I'm > using decorators (that are defined in a separate module). If I'm > understanding what is happening correctly, it's because doctest checks if > the funct

Py3K: Ensuring future compatibility between function annotation based tools

2007-09-04 Thread Ferenczi Viktor
There could be future compatibility issues between libraries using the new function annotation scheme: PEP 3107 -- Function Annotations See also: http://www.python.org/dev/peps/pep-3107/ Let's assume two hypotetic libraries: mashaller: provides JSON marshalling support typechecker: provides runti