[Python-ideas] Decorator to avoid a mistake
François Leblanc
fleblanc50 at gmail.com
Sat Nov 26 11:42:08 EST 2016
More information about the Python-ideas mailing list
Sat Nov 26 11:42:08 EST 2016
- Previous message (by thread): [Python-ideas] Decorator to avoid a mistake
- Next message (by thread): [Python-ideas] Decorator to avoid a mistake
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Le 26 nov. 2016 3:23 PM, "Nick Coghlan" <ncoghlan at gmail.com> a écrit : > > On 26 November 2016 at 22:24, France3 <fleblanc50 at gmail.com> wrote: > > replace base object by default, and when all is checked for end user > > don't use the flag... > > > > Does it is possible? What do you think about? > > There's no need to do this in a base class, since it can be done via > external introspection. That introspection could live in at least a > couple of different places: > > - a class decorator, which checks for unmarked overrides at class > definition time > - a test utility, that given a module name, imports the module, finds > any defined classes, and checks them for unmarked overrides > > All an override marker would have to do to enable that introspection > is to set a particular attribute on the method definition. > > Cheers, > Nick. > > -- > Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia I think that it's will be hard to take care of all situations this way... Moreover having a way to rewrite object base class open more perspectives from my point of view. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-ideas/attachments/20161126/f18d3c34/attachment.html>
- Previous message (by thread): [Python-ideas] Decorator to avoid a mistake
- Next message (by thread): [Python-ideas] Decorator to avoid a mistake
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-ideas mailing list