Re: How to know that two pyc files contain the same code

2012-03-11 Thread Gelonida N
On 03/11/2012 08:06 AM, Steven D'Aprano wrote: > What if one merely changed the order of definition? Instead of: > > def foo(): pass > def bar(): pass > > one had this? > > def bar(): pass > def foo(): pass > > It depends on why the OP cares if they are "identical". I can imagine use- > cases w

Re: How to know that two pyc files contain the same code

2012-03-10 Thread Steven D'Aprano
On Sun, 11 Mar 2012 12:15:11 +1100, Chris Angelico wrote: > On Sun, Mar 11, 2012 at 9:52 AM, Steven D'Aprano > 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():

Re: How to know that two pyc files contain the same code

2012-03-10 Thread Gelonida N
Hi Steven, On 03/10/2012 11:52 PM, Steven D'Aprano wrote: > > On Sat, 10 Mar 2012 15:48:48 +0100, Gelonida N wrote: > > >> >> Hi, >> >> >> >> I want to know whether two .pyc files are identical. >> >> >> >> With identical I mean whether they contain the same byte code. > > > > Define "identical" a

Re: How to know that two pyc files contain the same code

2012-03-10 Thread Chris Angelico
On Sun, Mar 11, 2012 at 9:52 AM, Steven D'Aprano 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(): >

Re: How to know that two pyc files contain the same code

2012-03-10 Thread Steven D'Aprano
On Sat, 10 Mar 2012 15:48:48 +0100, Gelonida N wrote: > Hi, > > I want to know whether two .pyc files are identical. > > With identical I mean whether they contain the same byte code. Define "identical" and "the same". If I compile these two files: # file ham.py x = 23 def func(): a = 23

Re: How to know that two pyc files contain the same code

2012-03-10 Thread Peter Otten
Gelonida N wrote: > I want to know whether two .pyc files are identical. > > With identical I mean whether they contain the same byte code. > > Unfortunately it seems, that .pyc files contain also something like the > time stamp of the related source file. > > So though two pyc files contain th

Re: How to know that two pyc files contain the same code

2012-03-10 Thread Bl0ckeduser
Gelonida N wrote: Hi, I want to know whether two .pyc files are identical. With identical I mean whether they contain the same byte code. Unfortunately it seems, that .pyc files contain also something like the time stamp of the related source file. So though two pyc files contain the same byt

How to know that two pyc files contain the same code

2012-03-10 Thread Gelonida N
Hi, I want to know whether two .pyc files are identical. With identical I mean whether they contain the same byte code. Unfortunately it seems, that .pyc files contain also something like the time stamp of the related source file. So though two pyc files contain the same byte code, they will no

How to know that two pyc files contain the same code

2012-03-10 Thread Gelonida N
Hi, I want to know whether two .pyc files are identical. With identical I mean whether they contain the same byte code. Unfortunately it seems, that .pyc files contain also something like the time stamp of the related source file. So though two pyc files contain the same byte code, they will no