Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #29927

metaclass question

Date 2012-09-24 18:43 +0100
From Chris Withers <chris@simplistix.co.uk>
Subject metaclass question
Newsgroups comp.lang.python
Message-ID <mailman.1209.1348519361.27098.python-list@python.org> (permalink)

Show all headers | View raw


Hi All,

Is there a metaclass-y way I could cause the following:

class TheParser(Parser):
     def handle_ARecord(self):
         pass
     def handle_ARecord(self):
         pass

...to raise an exception as a result of the 'handle_ARecord' name being 
reused?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
             - http://www.simplistix.co.uk

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

metaclass question Chris Withers <chris@simplistix.co.uk> - 2012-09-24 18:43 +0100

csiph-web