Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #21475
| Path | csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.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.002 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'subject:two': 0.04; 'subject:code': 0.07; 'python': 0.08; 'files:': 0.09; 'subject:files': 0.09; 'am,': 0.12; 'def': 0.13; 'did,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'func():': 0.16; 'subject:contain': 0.16; 'tmp': 0.16; 'wrote:': 0.18; 'received:209.85.210.174': 0.21; 'received:mail- iy0-f174.google.com': 0.21; 'header:In-Reply-To:1': 0.22; '+0100,': 0.23; 'aggressive': 0.23; 'subject:same': 0.23; 'defined': 0.24; 'expect': 0.25; 'sat,': 0.25; 'code.': 0.26; 'code': 0.26; '"the': 0.26; 'message-id:@mail.gmail.com': 0.29; 'compile': 0.29; 'sun,': 0.30; 'quite': 0.31; 'file': 0.34; 'steven': 0.34; 'identical': 0.34; 'to:addr:python-list': 0.35; 'subject:How': 0.35; 'optimization': 0.36; 'two': 0.36; 'but': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'think': 0.38; 'received:209': 0.39; 'to:addr:python.org': 0.40; 'fact,': 0.63; '11,': 0.68; 'subject:know': 0.93 |
| 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:to :content-type:content-transfer-encoding; bh=MQ2EX8kZ+LjGml/jaWSldRkNSUoysmgrXSBguVg4Hxg=; b=mGvlJfBl5reMds5T9DOG11FWCPBR8WeVF6tq4Tt9U/aIBDCs28QpPMyxTWOaCeFBJs IccsxKpElYl+BAE2MjzbgalsmgNSd1YUOSaTf9q+XIFqQBJWefosqVr2xM2pMv48i9CN kSqzocbvKBs4W+7mYAtQ2ZWVFg47d2hia0Wnz3+S7rcaAKKxceidq81BIC3gKwC+DClV dh0rW3AleaEhj8pj1aiJewXX/KLMv3okDvqwJci6rE8Zv/O/b4wkAJ1CdB2q7D9XJAhm Ts3dd97vFSh+gWWy3lz9gxqW1ggxll83R8TIk4Izrrnz9HmQMzltfyZe+/TQmKFQI/TC Fqew== |
| MIME-Version | 1.0 |
| In-Reply-To | <4f5bdb14$0$29891$c3e8da3$5496439d@news.astraweb.com> |
| References | <mailman.544.1331390950.3037.python-list@python.org> <4f5bdb14$0$29891$c3e8da3$5496439d@news.astraweb.com> |
| Date | Sun, 11 Mar 2012 12:15:11 +1100 |
| Subject | Re: How to know that two pyc files contain the same code |
| From | Chris Angelico <rosuav@gmail.com> |
| To | python-list@python.org |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | quoted-printable |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://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 | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.554.1331428520.3037.python-list@python.org> (permalink) |
| Lines | 37 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1331428520 news.xs4all.nl 6921 [2001:888:2000:d::a6]:50979 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:21475 |
Show key headers only | View raw
On Sun, Mar 11, 2012 at 9:52 AM, Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote: > On Sat, 10 Mar 2012 15:48:48 +0100, Gelonida N wrote: > Define "identical" and "the same". > > If I compile these two files: > > > # file ham.py > x = 23 > def func(): > a = 23 > return a + 19 > > > > # file = spam.py > def func(): > return 42 > > tmp = 19 > x = 4 + tmp > del tmp > > > do you expect spam.pyc and ham.pyc to count as "the same"? They do not contain the same code. They may contain code which has the same effect, but it is not the same code. I don't think Python has the level of aggressive optimization that would make these compile to the same bytecode, but if it did, then they would _become identical_ per the OP's description - that they contain identical bytecode. In fact, I think the OP defined it quite clearly. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How to know that two pyc files contain the same code Gelonida N <gelonida@gmail.com> - 2012-03-10 15:48 +0100
Re: How to know that two pyc files contain the same code Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-03-10 22:52 +0000
Re: How to know that two pyc files contain the same code Chris Angelico <rosuav@gmail.com> - 2012-03-11 12:15 +1100
Re: How to know that two pyc files contain the same code Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-03-11 07:06 +0000
Re: How to know that two pyc files contain the same code Rick Johnson <rantingrickjohnson@gmail.com> - 2012-03-11 08:22 -0700
Re: How to know that two pyc files contain the same code Gelonida N <gelonida@gmail.com> - 2012-03-12 00:56 +0100
Re: How to know that two pyc files contain the same code Gelonida N <gelonida@gmail.com> - 2012-03-11 06:30 +0100
csiph-web