[Tutor] compare two souce files

Jojo Mwebaze jojo.mwebaze at gmail.com
Thu Oct 28 11:52:44 CEST 2010


Hello Tutor

I would like to compare two souce code files but ignoring doc strings,
comments and space (and perharps in future statement by statement
comparision)

e.g

class Foo
  def foo():
     # prints my name
     return 'my name'

class Boo
   def boo():
      print 'my name'

Want to check if Foo and Boo are the same.  At functional level one can use

boo.func_code.co_code == foo.func_code.co_code

What is the class level equivlant of this?

cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20101028/1a897c57/attachment.html>


More information about the Tutor mailing list