liveBook · Manning

Import alias

An import alias is an alternate name bound to an imported module, namespace, or other imported program element for use in source code.

How 3 Manning books explain it

Python Workout: 50 ten-minute exercises

A module alias is an alternate name bound to an imported module by an import statement using as.

How it is used
Shortens module references when names are long or used repeatedly.
How deep it goes
Defines alias syntax and namespace behavior, but stops short of deeper import machinery.
Examples
Uses mymod as mm and numpy as np as concrete alias forms.
What you can do after
Apply module aliases through Python import statements and use the bound name in subsequent references.

Read how Python Workout: 50 ten-minute exercises explains import alias →

Elixir in Action, Third Edition

An alias is an Elixir directive that binds an alternate name to a module for use in references.

How it is used
Reduces qualified-module naming noise when repeatedly calling modules in deep application hierarchies.
How deep it goes
Defines explicit and inferred names, then connects aliases to atom-based module resolution and BEAM loading.
Examples
Uses Geometry.Rectangle, IO as MyIO, Rectangle.area, and MyIO.puts to demonstrate shortened references.
What you can do after
Apply it via Elixir syntax to shorten repeated module references while preserving the resolved module identity.

Read how Elixir in Action, Third Edition explains import alias →

Refactoring to Rust

An import alias is an alternate local name assigned to an imported Rust item or path.

How it is used
Simplifies repeated imports and shapes a library’s public API by exposing stable, shorter paths.
How deep it goes
Explains local imports, `pub use`, re-exports, module hierarchy, and visibility, but stops short of broader aliasing forms.
Examples
Uses a greeter application’s `DayKind` imports and a forest crate’s deeply nested `enter` function.
What you can do after
Apply it via Rust `use` and `pub use` to shorten imports and present controlled crate-root names.

Read how Refactoring to Rust explains import alias →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.