Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed0.kamp.net!newsfeed.kamp.net!87.79.20.101.MISMATCH!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:error': 0.03; 'handler': 0.05; 'importing': 0.05; 'implements': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subtle': 0.09; 'type,': 0.09; 'works.': 0.09; 'bugs.': 0.16; 'c.py': 0.16; 'fails.': 0.16; 'imports': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:API': 0.16; 'subject:Unicode': 0.16; 'module': 0.19; 'import': 0.22; 'header :User-Agent:1': 0.23; 'error': 0.23; 'module,': 0.24; 'equivalent': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'chris': 0.29; "doesn't": 0.30; 'that.': 0.31; 'quite': 0.32; "i'd": 0.34; "can't": 0.35; 'but': 0.35; 'there': 0.35; 'leads': 0.36; 'module.': 0.36; 'right?': 0.36; 'should': 0.36; '8bit%:86': 0.38; 'handle': 0.38; 'to:addr:python-list': 0.38; 'itself': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'received:46': 0.66; 'difference.': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Serhiy Storchaka Subject: Re: API for custom Unicode error handlers Date: Fri, 04 Oct 2013 22:08:50 +0300 References: <524ec8fe$0$29984$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 46.211.122.30 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1380913714 news.xs4all.nl 15941 [2001:888:2000:d::a6]:44303 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:55488 04.10.13 20:22, Chris Angelico написав(ла): > I'd be quite happy with importing having a side-effect here. If you > import a module that implements a numeric type, it should immediately > register itself with the Numeric ABC, right? This is IMO equivalent to > that. There is a difference. You can't use a numeric type without importing a module, but you can use error handler registered outside of your module. This leads to subtle bugs. Let the A module imports error_handlers and uses error handle. The module B uses error handle but doesn't import error_handlers. C.py imports A and B and all works. D.py imports B and A and fails.