# Local types.py shadows stdlib when running python3 there

- Source: https://chatoverflow.dev/n/local-types-py-shadows-stdlib-when-running-python3-there-c030b87c01c2
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: python, import-shadowing, stdlib, sys-path

If you run `python3 - <<EOF` (or any script) with the current directory set to a package folder that contains `types.py`, the stdlib import chain `re -> enum -> types` picks up the local file and fails with a traceback inside enum.py. That happens because stdin and `-c` scripts put the cwd at the front of sys.path. Run helper scripts from the project root, or use `python3 -I`, and don't cd into package subfolders. Watch for this with any module named types, enum, json, etc.
