Re: help with the Python 3 version of the decorator module

2010-05-24 Thread Michele Simionato
On May 22, 10:49 am, Michele Simionato wrote: > I have finally decided to port the decorator module to Python 3. > Changing the module was zero effort (2to3 worked) but changing the > documentation was quite an effort, since I had to wait for docutils/ > pygements to support Pyt

help with the Python 3 version of the decorator module

2010-05-22 Thread Michele Simionato
I have finally decided to port the decorator module to Python 3. Changing the module was zero effort (2to3 worked) but changing the documentation was quite an effort, since I had to wait for docutils/ pygements to support Python 3 and to change all my custom build process. Also, I am relying on

Re: decorator module in stdlib?

2009-04-06 Thread Michele Simionato
On Apr 7, 7:57 am, Daniel Fetchinson wrote: > > have always seen the decorator module > > as a temporary hack waiting for a proper solution > > at the language level. I wanted the possibility to modify the > > signature of a function. Everybody more or less agreed > >

Re: decorator module in stdlib?

2009-04-06 Thread Daniel Fetchinson
_wrapper() and functools.wraps() > are NOT equivalent to the decorator module. Exactly, that's why I think the decorator module would be a useful addition to functools. > My original > plan when I wrote the decorator module was to make aware > people that the corrent support for decor

Re: decorator module in stdlib?

2009-04-06 Thread Michele Simionato
nfortunately functools.update_wrapper() and functools.wraps() are NOT equivalent to the decorator module. My original plan when I wrote the decorator module was to make aware people that the corrent support for decorators in the language is insufficient. I have always seen the decorator module as a temporary hack w

Re: decorator module in stdlib?

2009-04-06 Thread Chris Rebert
On Mon, Apr 6, 2009 at 5:41 PM, Daniel Fetchinson wrote: > The decorator module [1] written by Michele Simionato is a very useful > tool for maintaining function signatures while applying a decorator. > Many different projects implement their own versions of the same > functionality,

decorator module in stdlib?

2009-04-06 Thread Daniel Fetchinson
The decorator module [1] written by Michele Simionato is a very useful tool for maintaining function signatures while applying a decorator. Many different projects implement their own versions of the same functionality, for example turbogears has its own utility for this, I guess others do

Re: What about a decorator module version 3.0?

2008-12-01 Thread Michele Simionato
On Dec 1, 9:18 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > > Release a final 2.x version with whatever internal changes but with > external api unchanged or at least backward compatible.  Mark items to > be deleted as deprecated.  Keep that available indefinately. > > Then release a 3.0 version wi

Re: What about a decorator module version 3.0?

2008-12-01 Thread Terry Reedy
Michele Simionato wrote: What do you people think? I am not a user yet, but my opinion anyway... Release a final 2.x version with whatever internal changes but with external api unchanged or at least backward compatible. Mark items to be deleted as deprecated. Keep that available indefin

Re: What about a decorator module version 3.0?

2008-12-01 Thread Eduardo O. Padoan
On Mon, Dec 1, 2008 at 9:16 AM, Michele Simionato <[EMAIL PROTECTED]> wrote: > I am thinking about releasing a new version of the decorator module, > [...] Just FYI, the module being discussed here is http://www.phyast.pitt.edu/~micheles/python/documentation.html I dont use it mysel

What about a decorator module version 3.0?

2008-12-01 Thread Michele Simionato
I am thinking about releasing a new version of the decorator module, completely rewritten from scratch. The new implementation takes half the lines of the original one and it is much more general, so I like it more. However, there is an issue of compatibility with the past and I am asking here for

Re: self-promotion of the decorator module

2005-05-19 Thread Michele Simionato
Yep, I was wondering about irrelevant things, there is no problem in this case, actually. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: self-promotion of the decorator module

2005-05-19 Thread Duncan Booth
Michele Simionato wrote: > Duncan Booth: >> Fortunately you have a list of >> argument names readily available so it shouldn't be too >> hard to generate unique names to use in their place. > > It does not look too simple either. Whereas I can easily > build valid Python identifiers which are ext

Re: self-promotion of the decorator module

2005-05-19 Thread Michele Simionato
I have uploaded version 0.5 that should fix all the subtle bugs you pointed out, but there could be others (I would not be surprised in that case ;). I will add a test suite for various corner cases tomorrow. BTW, I cannot decide if exotic function signatures are a feature or an accident ...

Re: self-promotion of the decorator module

2005-05-19 Thread Michele Simionato
Duncan Booth: > Fortunately you have a list of > argument names readily available so it shouldn't be too > hard to generate unique names to use in their place. It does not look too simple either. Whereas I can easily build valid Python identifiers which are extremely unlikely to clash with any ide

Re: self-promotion of the decorator module

2005-05-19 Thread Michele Simionato
Notice that the decorator module is at version 0.4 and I still consider it as experimental. The reason why I posted the link here is to get feedback and it seems I got it ;) I will upgrade to version 0.5 shortly, fixing the easily fixable bugs and documenting what cannot be easily fixed. Thanks

Re: self-promotion of the decorator module

2005-05-19 Thread Duncan Booth
Michele Simionato wrote: > with the following advantages: > > 1. one-level of nesting is saved ("flat is better than nested") > 2. name, docstring and dictionary of the original function are > preserved; > 3. the signature of the original function is preserved (this one is > nontrivial). >

self-promotion of the decorator module (Was: How to learn OO of python?)

2005-05-18 Thread Michele Simionato
; return new_f > return check_accepts > > After I saw all the examples, I concluded that every decorator must > define an inner function which takes only one argument, the > function to decorate. Is this right? > Yes, but you may want to look at my decorator modul

decorator module

2005-05-16 Thread Michele Simionato
I have written a decorator module to make easier to write good decorators (i.e. decorators preserving the signature of the functions they decorate). The documentations contains a (hopefully) nice collections of use cases (which are also test cases, sice I take doctest very seriously ;). You can