A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2004-March/043463.html below:

[Python-Dev] PEP 318 - posting draft

[Python-Dev] PEP 318 - posting draft [Python-Dev] PEP 318 - posting draftSkip Montanaro skip at pobox.com
Wed Mar 24 10:56:10 EST 2004
    >> Actually, it should be deleted and the PEP updated.  Michael's latest
    >> patch apparently supports class decorators, so it's no longer an
    >> extension.

    Guido> But while you're at it, please add to the PEP that I don't like
    Guido> the idea of class decorators.  I think they don't solve a real
    Guido> problem, unlike function decorators, and I think that making
    Guido> classes and functions more similar just adds confusion.

I think this use case is rather elegant:

    def singleton(cls):
        return cls()

    class Foo [singleton]:
        ...

Skip

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