# utils.py
__all__ =["format_price","validate_email"]defformat_price(amount:float)->str:return f"${amount:,.2f}"defvalidate_email(email:str)->bool:return"@"in email
def_internal_helper():# not exportedpass
Note __all__ defines what 'from module import *' exports. It does not prevent direct imports of unlisted names. Prefix internal helpers with underscore by convention.
Frequently asked questions
How do you import star?
This task is covered in 2 stacks on this page: JavaScript, Python. The "Namespace Import" snippet in JavaScript uses `import * as name from "./module.js";`.
Which code does the JavaScript example use?
The "Namespace Import" snippet uses `import * as name from "./module.js";`, from the Modules section of the JavaScript cheat sheet.
Which stacks cover "import star" on this page?
JavaScript, Python. Together they hold 2 copy-ready snippets for this task.
Is there anything to watch out for?
Yes. For "Namespace Import": Imports all named exports as a single object. The object is frozen (read-only). Useful when a module has many exports you want to use together.