Error: name 'show' is not defined

The following question have been asked on Telegram:

I have the following error: name 'show' is not defined. How can I fix it?

This error is caused when you try to add the result of an entrypoint call to a scenario.

For example:

import smartpy as sp

def main():
    class MyContract(sp.Contract):
        def __init__(self):

        def ep(self):

if "templates" not in __name__:
    def test():
        sc = sp.test_scenario(main)
        c1 = main.MyContract()
        sc += c1
        sc += c1.ep()

To fix it simply remove sc += before c1.ep().

This syntax was needed in the first versions of SmartPy but it’s not simplified.