A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-February/042802.html below:

[Python-Dev] Re: new syntax for wrapping (PEP 318)

[Python-Dev] Re: new syntax for wrapping (PEP 318) [Python-Dev] Re: new syntax for wrapping (PEP 318)Barry Warsaw barry at python.org
Thu Feb 26 20:58:43 EST 2004
On Thu, 2004-02-26 at 18:43, Delaney, Timothy C (Timothy) wrote:

> This isn't too bad. Probably better with a wrapper around sys.atexit -
> something like:
> 
>     def atexit (func):
>         sys.atexit(func)
>         return func
> 
>     def cleanup() [atexit]:
> 
> otherwise it's not obvious that cleanup gets bound to None. Perhaps it
> should be a requirement of decorators that they return something other
> than None, and an exception is thrown if this contract is broken?

Would it be better if it returned 1? <wink>

Just what /is/ the contract for a decorator function?  Maybe that it
takes a function/method object and must return a descriptor?  I do think
this needs some clarification in the PEP.

-Barry



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4