Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #78858
| Path | csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.021 |
| X-Spam-Evidence | '*H*': 0.96; '*S*': 0.00; 'operator': 0.03; 'python3': 0.07; 'subject:module': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '2.7': 0.14; '2.7.3': 0.16; '3.3,': 0.16; 'exist.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'throw': 0.16; 'wrote:': 0.18; 'thu,': 0.19; '>>>': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'chris': 0.29; 'am,': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'skip:( 20': 0.30; 'code': 0.31; '>>>>': 0.31; 'names.': 0.31; 'linux': 0.33; 'something': 0.35; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'false': 0.36; 'behind': 0.37; 'fact': 0.38; 'is.': 0.60; 'new': 0.61; 'back': 0.62; 'more': 0.64; 'different': 0.65; 'mar': 0.68; '2014,': 0.84; 'presumably': 0.84; 'proves': 0.84; 'day!': 0.85; 'to:none': 0.92 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=MihlWwXcQjezGZ+Gq3xDntULsrmazn2wnJIhvcVNfeg=; b=rLT/ViUUxHEDWR4H3UxqY2JWqxjvO1FlXGMcPgBopx2IP/xA9PZI6XJzhpGwUORROk Jmx9fJZgh8I21UFXr3C1tBMX3VyszQTOJEFgOFgjAGzA71IgxsqKRwtQo0VI/BmS6Ils S/97RntAeJV2JXDOzIMsqUWUNOmMHDyuufV57P7aBG5er6r6M4PnePnTqPdye+iCtUzH q8rxWs01F2DfBPuV+Nx2ZUlJIPL+N22nkYaXMAAsxVzOjZXuDmlVP3x2xx+Nht16RK+U j9zJ9NhJgQrLzkQ+AMvKfthvGJ/LQNdIJavBKBtn3F2LSEdmJxg/Xkc4N5IOdA+/V6aJ 9jKQ== |
| MIME-Version | 1.0 |
| X-Received | by 10.43.108.212 with SMTP id ed20mr869408icc.12.1412807431103; Wed, 08 Oct 2014 15:30:31 -0700 (PDT) |
| In-Reply-To | <c9lp4mFl997U1@mid.individual.net> |
| References | <54349662$0$12987$c3e8da3$5496439d@news.astraweb.com> <facda5ec-ecd9-43d0-99b3-b98f945a9a2d@googlegroups.com> <mailman.14675.1412760741.18130.python-list@python.org> <c9lp4mFl997U1@mid.individual.net> |
| Date | Thu, 9 Oct 2014 09:30:31 +1100 |
| Subject | Re: operator module functions |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | "python-list@python.org" <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| 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.14695.1412807434.18130.python-list@python.org> (permalink) |
| Lines | 41 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1412807434 news.xs4all.nl 2938 [2001:888:2000:d::a6]:42495 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:78858 |
Show key headers only | View raw
On Thu, Oct 9, 2014 at 8:37 AM, Gregory Ewing <greg.ewing@canterbury.ac.nz> wrote: > Chris Angelico wrote: > >>>>> operator.add is operator.__add__ >> >> True > > > That doesn't always seem to have been the case, however. > In Python 2.7 and 3.3, I get > >>>> operator.add is operator.__add__ > False Huh. So it is. rosuav@sikorsky:~$ python3 Python 3.5.0a0 (default:301b9a58021c, Oct 2 2014, 09:20:24) [GCC 4.7.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import operator >>> operator.add, operator.__add__ (<built-in function add>, <built-in function add>) >>> rosuav@sikorsky:~$ python Python 2.7.3 (default, Mar 13 2014, 11:03:55) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import operator >>> operator.add, operator.__add__ (<built-in function add>, <built-in function __add__>) >>> Presumably they have the same code behind them, just different function names. But anyway, the fact that it doesn't throw back an AttributeError proves that both functions do at least exist. Learn something new every day! ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
operator module functions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-10-08 12:41 +1100
Re: operator module functions Terry Reedy <tjreedy@udel.edu> - 2014-10-08 02:28 -0400
Re: operator module functions marco.nawijn@colosso.nl - 2014-10-08 01:46 -0700
Re: operator module functions Chris Angelico <rosuav@gmail.com> - 2014-10-08 20:32 +1100
Re: operator module functions Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-10-09 10:37 +1300
Re: operator module functions Chris Angelico <rosuav@gmail.com> - 2014-10-09 09:30 +1100
Re: operator module functions Chris Kaynor <ckaynor@zindagigames.com> - 2014-10-08 15:40 -0700
Re: operator module functions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-10-08 21:57 +1100
Re: operator module functions Terry Reedy <tjreedy@udel.edu> - 2014-10-08 15:09 -0400
Re: operator module functions Ethan Furman <ethan@stoneleaf.us> - 2014-10-08 12:38 -0700
Re: operator module functions random832@fastmail.us - 2014-10-08 15:49 -0400
Re: operator module functions Gelonida N <gelonida@gmail.com> - 2014-10-08 23:05 +0200
Re: operator module functions Ian Kelly <ian.g.kelly@gmail.com> - 2014-10-08 15:23 -0600
Re: operator module functions Ethan Furman <ethan@stoneleaf.us> - 2014-10-08 14:49 -0700
Re: operator module functions Chris Kaynor <ckaynor@zindagigames.com> - 2014-10-08 14:21 -0700
Re: operator module functions Ben Finney <ben+python@benfinney.id.au> - 2014-10-09 08:57 +1100
Re: operator module functions Terry Reedy <tjreedy@udel.edu> - 2014-10-08 18:46 -0400
Re: operator module functions Ethan Furman <ethan@stoneleaf.us> - 2014-10-08 16:35 -0700
Re: operator module functions Ned Batchelder <ned@nedbatchelder.com> - 2014-10-08 21:41 -0400
csiph-web