Skip to content

Commit 27d06fb

Browse files
authored
Update imports.md
1 parent f07e68c commit 27d06fb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/concepts/imports.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The simplest use-case for imports is wanting to call a function that is an `@exp
44

55
__NOTE:__ `from x import y` and starred imports are not supported at this time. Importing a smart contract imports all of the `@export` functions from it and none of the variables.
66

7-
complex_app.py
7+
complex_app.py (Smart Contract)
88
```python
99
@export
1010
def return_1():
@@ -19,7 +19,7 @@ def return_3():
1919
return 3
2020
```
2121

22-
import_example.py
22+
import_example.py (Smart Contract)
2323
```python
2424
import complex_app
2525

@@ -43,7 +43,7 @@ To do this, we have to use the `importlib` in the Contracting standard library.
4343

4444
This function behaves similar to the analogous `importlib` function included in the Python standard library. Calling it will return a module object that has only the `@export` functions available to call and pass arguments to.
4545

46-
token_1.py
46+
token_1.py (Smart Contract)
4747
```python
4848
balances = Hash()
4949
@construct
@@ -58,7 +58,7 @@ def send(amount, to):
5858
balances[to] += amount
5959
```
6060

61-
token_2.py
61+
token_2.py (Smart Contract)
6262
```python
6363
balances = Hash()
6464
@construct
@@ -73,7 +73,7 @@ def send(amount, to):
7373
balances[to] += amount
7474
```
7575

76-
exchange.py
76+
exchange.py (Smart Contract)
7777
```python
7878
@export
7979
def send(token, amount, to):
@@ -87,7 +87,7 @@ Luckily, both contracts have the same interface and have a function called `send
8787

8888
A smart contract can define an interface to enforce contracts against. Enforcement can be on the functions and/or the variables. Enforcement is 'weak' in the sense that a contract can have additional functions or variables and still succeed an interface test.
8989

90-
exchange.py
90+
exchange.py (Smart Contract)
9191
```python
9292
token_interface = [
9393
importlib.Func('send', args=('amount', 'to')),

0 commit comments

Comments
 (0)