Exemple #1
0
sys.path.insert(
    0,
    os.path.normpath(
        os.path.join(
            os.path.dirname(os.path.abspath(__file__)),
            "..",
            ".."
        )
    )
)
from nuitka.tools.testing.Common import (
    executeReferenceChecked,
    checkDebugPython
)

checkDebugPython()


x = 17

# Python2.7 or higher syntax things are here.
def simpleFunction1():
    return {i:x for i in range(x)}

def simpleFunction2():
    try:
        return {y:i for i in range(x)}  # @UndefinedVariable
    except NameError:
        pass

def simpleFunction3():
Exemple #2
0
"""

import os
import sys

# Find nuitka package relative to us.
sys.path.insert(
    0,
    os.path.normpath(
        os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..")),
)
from nuitka.tools.testing.Common import executeReferenceChecked, checkDebugPython

# isort:start

checkDebugPython()

x = 17


# Just a function return a constant. Functions don't become any smaller. Let's
# get that right.
def simpleFunction1():
    return 1


# Do a bit of math with a local variable, assigning to its value and then doing
# an overwrite of that, trying that math again. This should cover local access
# a bit.
def simpleFunction2():
    y = 3 * x