24 lines
694 B
Markdown
24 lines
694 B
Markdown
## Exercise 1b: Unprotected code
|
|
|
|
#### Goal
|
|
|
|
Investigate what happens when importing from modules with "unprotected" code.
|
|
|
|
#### Preparation
|
|
|
|
(none)
|
|
|
|
#### Tasks
|
|
|
|
0. Create a file in the `src/` folder called `unprotectd_code.py`.
|
|
|
|
1. Add a line in `unprotectd_code.py` that imports the `todays_special` function from `daily_menu.py`.
|
|
|
|
2. **BEFORE YOU EXECUTE THE FILE**. Discuss with your partner what you think will happen when you run `unprotectd_code.py`.
|
|
|
|
3. Run `unprotectd_code.py`. Does your prediction match reality?
|
|
|
|
4. (optional, for those who know) Discuss with your partner:
|
|
* Why did this behaviour occur?
|
|
* Why is it not good?
|
|
* What can you do to "fix" the behaviour?
|