New submission from Edoardo Spadolini <keri...@gmail.com>:

If we make ABCMeta.register() return the registered class, like 
atexit.register() does for the registered function, we can then use it as a 
decorator:

Now:

class Foo:
    ...
ABarC.register(Foo)

With this change:

@ABarC.register
class Foo:
    ...

The only problem this would cause is in code that relies on ABCMeta.register() 
to return None; I can't think of a reason anyone would rely on this, but...

----------
components: Library (Lib)
files: abcmeta_register_deco.diff
keywords: patch
messages: 125804
nosy: kerio
priority: normal
severity: normal
status: open
title: ABCMeta.register() should work as a decorator
type: feature request
versions: Python 3.3
Added file: http://bugs.python.org/file20314/abcmeta_register_deco.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10868>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to