Skip to main content

Diffs two Python files at the bytecode level.

Project description

Build status

pydiff diffs Python code at the bytecode level. This is useful for checking for changes to the actual code structure while ignoring formatting changes.

Installation

From pip:

$ pip install --upgrade pydiff

Example

foo.py:

import os, sys
def main():

   x = len(sys.argv) + 100

   y            = x+77
   print(y)

bar.py:

import os
import sys


def main():
   x = len(sys.argv) + 101
   y = x + 77
   print(y)

$ pydiff foo.py bar.py:

---
+++
@@ -4,7 +4,7 @@
                None,
                {'co_argcount': 0,
                 'co_cellvars': (),
-                'co_consts': [None, 100, 77],
+                'co_consts': [None, 101, 77],
                 'co_flags': 67,
                 'co_freevars': (),
                 'co_kwonlyargcount': 0,

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydiff-0.1.3.tar.gz (4.2 kB view details)

Uploaded Source

File details

Details for the file pydiff-0.1.3.tar.gz.

File metadata

  • Download URL: pydiff-0.1.3.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pydiff-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b8d0204c7b289e7364e04fcfbda87102b6949094dfcd7da5e8ff56e0667cfa64
MD5 2b415a507bf56332778daa114b66c0e8
BLAKE2b-256 825c49fed4633c6db1861fdc69de1de0156177a9bcb42fb32737b0b3b616b2e7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page