Git Product home page Git Product logo

Comments (1)

jackyzy823 avatar jackyzy823 commented on June 3, 2024

Simpler code:

a = True
b = False
if a and not b:
    print("In if")
else:
    print("In false")

decompile to

# Source Generated with Decompyle++
# File: sample.cpython-312.pyc (Python 3.12)

a = True
b = False
if not a and b:
    print('In if')
    return None
print('In false')

ASM

sample.cpython-312.pyc (Python 3.12)
[Code]
    File Name: ./sample.py
    Object Name: <module>
    Qualified Name: <module>
    Arg Count: 0
    Pos Only Arg Count: 0
    KW Only Arg Count: 0
    Stack Size: 3
    Flags: 0x00000000
    [Names]
        'a'
        'b'
        'print'
    [Locals+Names]
    [Constants]
        True
        False
        'In if'
        'In false'
        None
    [Disassembly]
        0       RESUME                          0
        2       LOAD_CONST                      0: True
        4       STORE_NAME                      0: a
        6       LOAD_CONST                      1: False
        8       STORE_NAME                      1: b
        10      LOAD_NAME                       0: a
        12      POP_JUMP_IF_FALSE               11 (to 36)
        14      LOAD_NAME                       1: b
        16      POP_JUMP_IF_TRUE                9 (to 36)
        18      PUSH_NULL
        20      LOAD_NAME                       2: print
        22      LOAD_CONST                      2: 'In if'
        24      CALL                            1
        32      POP_TOP
        34      RETURN_CONST                    4: None
        36      PUSH_NULL
        38      LOAD_NAME                       2: print
        40      LOAD_CONST                      3: 'In false'
        42      CALL                            1
        50      POP_TOP
        52      RETURN_CONST                    4: None

from pycdc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.