Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #63407
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <jeanpierreda@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.008 |
| X-Spam-Evidence | '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.06; '(b)': 0.07; 'incompatible': 0.07; 'converted': 0.09; 'parameter': 0.09; 'cc:addr:python-list': 0.11; 'def': 0.12; 'jan': 0.12; '__future__': 0.16; 'backwards': 0.16; 'defined,': 0.16; 'directive': 0.16; 'easier.': 0.16; 'other)': 0.16; 'wrote:': 0.18; 'module': 0.19; 'first.': 0.19; 'stack': 0.19; 'cc:addr:python.org': 0.22; '(a)': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'sort': 0.25; 'suggested': 0.26; 'second': 0.26; 'header:In- Reply-To:1': 0.27; 'chris': 0.29; '(c)': 0.29; 'said,': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'getting': 0.31; 'class': 0.32; 'running': 0.33; 'cases': 0.33; 'actual': 0.34; 'skip:_ 10': 0.34; 'maybe': 0.34; 'subject:the': 0.34; 'could': 0.34; 'test': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'are,': 0.36; 'complete.': 0.36; 'instances': 0.36; 'transition': 0.36; 'done': 0.36; 'doing': 0.36; 'skip:o 20': 0.38; 'issue': 0.38; 'fact': 0.38; 'pm,': 0.38; 'little': 0.38; 'does': 0.39; 'is.': 0.60; 'problems.': 0.60; 'conversion': 0.61; 'lower': 0.61; 'address': 0.63; 'kind': 0.63; 'to:addr:gmail.com': 0.65; 'move.': 0.84; 'moves': 0.84; 'wholesale': 0.96 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=OOcnv+2WtRgDWEO6AMGwYBwPmihWeXCgF1DTcKJWKMc=; b=Fxw9f03fMoaudN4CV5GlNrZ7YcSjGVe9oN2ss0EtzJFkntjctOKmw2SbaVS+REhFdc cREl1NKtXdYCqs+4R4hz1hMUfzNgRZNjGjEeYAU4/apYeYiDlqiXHliVHxKmj5jFcpY0 f6ibQyxoP94O5lqcIwgFTiBIcc2g531EIfNYQa1ee6u0lqPmjfvpZb8lMHJrK8eZ5aTg jcQZAJroUXq9veWZZhLpgV13H1BjP5s2Oh/CE1TDafDLQtgRP/wDIATxIJuEBhvTkCjK nYXe7txM+nENRCJqkNuTO3bMg99ngjaRhPO7PQiS3xc1a7GHg9Ia4Uu/C26EAQp7TQoF 5xeQ== |
| X-Received | by 10.49.28.166 with SMTP id c6mr191893997qeh.80.1389064365380; Mon, 06 Jan 2014 19:12:45 -0800 (PST) |
| MIME-Version | 1.0 |
| In-Reply-To | <CAPTjJmoWOpEtAnDEWfyZamsCkHG4gDbJ3_KreMfTiyDo9UpECA@mail.gmail.com> |
| References | <laf00q$10k$1@ger.gmane.org> <CAPTjJmqzc2AQJ6TrBtCFnT+NBp8uYWMxMhtGNpLr+NGyhoxO-g@mail.gmail.com> <CABicbJ+k9Yim879QaDtty_dNvpZMgKA8W-zX6Xcsc5BQcnaCaQ@mail.gmail.com> <CAPTjJmozt8XcWrW2xAX7oeHDQHcDDWkoY7kMK0YXdYU+z+cOfQ@mail.gmail.com> <CABicbJ+YMRLHqQQ3nFLeqqxnvqRLRioZc9X3pZUMfZWzgEbMSw@mail.gmail.com> <CAPTjJmojtgi=fjMrZ2dW-dXpoAMWrwww-yp4BTvUtL8iNdAbBQ@mail.gmail.com> <CABicbJ+dG4Adgeb0RKydXWJrwYNC=HHdsWhd+X=YZ37jm+1t8w@mail.gmail.com> <CAPTjJmoWOpEtAnDEWfyZamsCkHG4gDbJ3_KreMfTiyDo9UpECA@mail.gmail.com> |
| From | Devin Jeanpierre <jeanpierreda@gmail.com> |
| Date | Mon, 6 Jan 2014 19:12:05 -0800 |
| Subject | Re: the Gravity of Python 2 |
| To | Chris Angelico <rosuav@gmail.com> |
| Content-Type | text/plain; charset=UTF-8 |
| Cc | "python-list@python.org" <python-list@python.org> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.5116.1389064367.18130.python-list@python.org> (permalink) |
| Lines | 37 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1389064367 news.xs4all.nl 2872 [2001:888:2000:d::a6]:58169 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:63407 |
Show key headers only | View raw
On Mon, Jan 6, 2014 at 6:28 PM, Chris Angelico <rosuav@gmail.com> wrote:
> class Foo(str):
> def __add__(self, other):
> if isinstance(other, unicode): return self + other.encode("cp500")
> return str.__add__(self, other)
>
> What happens if you have the __future__ directive disabling
> autoencoding on (a) the module in which this class is defined, (b) the
> one in which the it was instantiated, (c) the one that actually uses
> the +?
In both methods I described, all uses of instances of the class are
changed, but only in case A. That's a really good point, I hadn't
considered that the second case could be converted into the first.
> This is why I think it's getting magical.
Yes, it's magical, but to be fair that's stack inspection as it always is.
I am OK with a little ugliness if it makes actual work easier.
> Far better to do this sort
> of change on a per-application basis - maybe with a warning parameter
> that you can enable when running your test suite, as has been
> suggested (and in many cases implemented) for other 2-vs-3 problems.
Doing a flag like that that enables a backwards incompatible change
does in fact address that issue you were worried about originally, so
that's something. And feature-by-feature moves are, like the OP said,
still lower cost than a wholesale move.
In the end a gradual transition can still be done with the polyglot
approach, but I'm not happy that there's no way to enforce/test a
polyglot conversion until it is complete. Any kind of granularity
would have helped. :(
-- Devin
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: the Gravity of Python 2 Devin Jeanpierre <jeanpierreda@gmail.com> - 2014-01-06 19:12 -0800
csiph-web