Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Stub Files

My stub file isn't working!

I wrote my stub file just like Kenneth did and it isn't working. By that I mean it isn't telling me that "Hello" str has been found and it was expecting a Real. Has something changed since the creation of this video with pycharm or stub files in general?

calculator.pyi file:

from numbers import Real


def add(num1: Real, num2: Real) -> Real


def subtract(num1: Real, num2: Real) -> Real


def multiply(num1: Real, num2: Real) -> Real


def divide(num1: Real, num2: Real) -> Real

calculator.py file:

def add(num1, num2):
    return num1 + num2


def subtract(num1, num2):
    return num1 - num2


def multiply(num1, num2):
    return num1 * num2


def divide(num1, num2):
    return num1 / num2


print(add(5, 8.2))
print(multiply("hello", 5))