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


Groups > comp.lang.python > #55488

Re: API for custom Unicode error handlers

From Serhiy Storchaka <storchaka@gmail.com>
Subject Re: API for custom Unicode error handlers
Date 2013-10-04 22:08 +0300
References <524ec8fe$0$29984$c3e8da3$5496439d@news.astraweb.com> <CAPTjJmp5JSqwOoE-zC40u7HS28i9O43FSS+-hprqvHCpiK1iOQ@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.729.1380913714.18130.python-list@python.org> (permalink)

Show all headers | View raw


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.

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


Thread

API for custom Unicode error handlers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-04 13:56 +0000
  Re: API for custom Unicode error handlers Chris Angelico <rosuav@gmail.com> - 2013-10-05 03:22 +1000
  Re: API for custom Unicode error handlers Ethan Furman <ethan@stoneleaf.us> - 2013-10-04 11:05 -0700
  Re: API for custom Unicode error handlers Serhiy Storchaka <storchaka@gmail.com> - 2013-10-04 22:08 +0300
  Re: API for custom Unicode error handlers Serhiy Storchaka <storchaka@gmail.com> - 2013-10-04 22:35 +0300
  Re: API for custom Unicode error handlers Terry Reedy <tjreedy@udel.edu> - 2013-10-04 18:44 -0400

csiph-web