Skip to content

Add compliant and noncompliant examples of python/[email protected] #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

# {fact [email protected] defects=1}
# Noncompliant: execution order of cells is not linear. When executing
# cells in linear order, variables `x` and `y` are undefined before use.
# —— Code Cell 1, Execution Count 2 —— #
sum = x + y
product = x * y
exp = x ** y
# —— Code Cell 2, Execution Count 1 —— #
x = 12
y = 13
# —— Code Cell 3, Execution Count 3 —— #
print(sum, product, exp)
# {/fact}


# {fact [email protected] defects=0}
# Compliant: execution order of cells is linear.
# —— Code Cell 1, Execution Count 1 —— #
x = 12
y = 13
# —— Code Cell 2, Execution Count 2 —— #
sum = x + y
product = x * y
exp = x ** y
# —— Code Cell 3, Execution Count 3 —— #
print(sum, product, exp)
# {/fact}