Add missing examples/__init__.py #3

Merged
adsharma merged 1 commit from examples_module into main 2021-04-05 16:21:45 +00:00
adsharma commented 2021-03-31 18:58:50 +00:00 (Migrated from github.com)

Required for:

python3 -m examples.case_study
Required for: ``` python3 -m examples.case_study ```
mwhittaker commented 2021-03-31 19:24:53 +00:00 (Migrated from github.com)

What happens when you run python3 -m examples.case_study? For me, it runs fine without needing an __init__.py file in in the examples/ directory.

What happens when you run `python3 -m examples.case_study`? For me, it runs fine without needing an `__init__.py` file in in the `examples/` directory.
adsharma commented 2021-03-31 19:26:43 +00:00 (Migrated from github.com)
$ python3 -m examples.case_study
/usr/bin/python3: No module named examples.case_study
$ touch examples/__init__.py
$ python3 -m examples.case_study
0-resilient Capacities
2291.6023550039754
3666.5637680063605
4200.2161213962345
4124.884156509473

0-resilient Searched
``` $ python3 -m examples.case_study /usr/bin/python3: No module named examples.case_study $ touch examples/__init__.py $ python3 -m examples.case_study 0-resilient Capacities 2291.6023550039754 3666.5637680063605 4200.2161213962345 4124.884156509473 0-resilient Searched ```
adsharma commented 2021-03-31 19:27:16 +00:00 (Migrated from github.com)

Guessing you have examples module accessible from somewhere else in your sys.path.

Guessing you have examples module accessible from somewhere else in your sys.path.
mwhittaker commented 2021-04-05 16:22:12 +00:00 (Migrated from github.com)

Interesting! Yeah, I can't say I fully understand how Python goes looking for stuff. Thanks for the PR!

Interesting! Yeah, I can't say I fully understand how Python goes looking for stuff. Thanks for the PR!
adsharma commented 2021-04-05 16:29:59 +00:00 (Migrated from github.com)

More discussion on the topic:

https://github.com/python/mypy/issues/2773

without the init.py it's possible that mypy will ignore the directory
and not type check an entire module. But things got complicated with
certain limited module types that can be added without a init.py in
python3.

On Mon, Apr 5, 2021 at 9:22 AM Michael Whittaker @.***>
wrote:

Interesting! Yeah, I can't say I fully understand how Python goes looking
for stuff. Thanks for the PR!


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/mwhittaker/quoracle/pull/3#issuecomment-813483290,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAFA2A7IROQ5EHC4FNLK3Y3THHPUFANCNFSM42FKBK4Q
.

More discussion on the topic: https://github.com/python/mypy/issues/2773 without the __init__.py it's possible that mypy will ignore the directory and not type check an entire module. But things got complicated with certain limited module types that can be added without a __init__.py in python3. On Mon, Apr 5, 2021 at 9:22 AM Michael Whittaker ***@***.***> wrote: > Interesting! Yeah, I can't say I fully understand how Python goes looking > for stuff. Thanks for the PR! > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/mwhittaker/quoracle/pull/3#issuecomment-813483290>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AAFA2A7IROQ5EHC4FNLK3Y3THHPUFANCNFSM42FKBK4Q> > . >
Sign in to join this conversation.
No description provided.