caterinaurban / Typpete

34 stars 6 forks source link

Allow circular imports #37

Closed mostafa-abdullah closed 6 years ago

mostafa-abdullah commented 6 years ago

Added support for circular imports.

Changes:

Behavior:

Works like it does in Python. When a circular import occurs, only parts of the module that appear before the import statements are considered. For example the following will raise an error:

A.py

import B

def f():...

B.py

import A

A.f()

# Error: A has no attribute f

However, the following is supported:

A.py

def f():...

import B

B.py

import A

A.f()