All fields

“Modules & Packaging” in Information Technology

26 questions across 1 technology.

Information Technology

26 questions in 1 technology

#QuestionTechnologyTopicLevel
1What does the `if __name__ == '__main__':` idiom accomplish, and why is it important for modules? Python › Modules & PackagingPythonModules & PackagingIntermediate
2How does Python locate modules during import, and what is sys.path's role? Python › Modules & PackagingPythonModules & PackagingAdvanced
3How do entry points in packaging metadata enable a package to register CLI commands or plugins? Python › Modules & PackagingPythonModules & PackagingAdvanced
4What is the difference between a module and a package in Python? Python › Modules & PackagingPythonModules & PackagingBeginner
5What does the __init__.py file do inside a package directory? Python › Modules & PackagingPythonModules & PackagingBeginner
6How does Python's module import system avoid re-executing a module multiple times when imported from different places? Python › Modules & PackagingPythonModules & PackagingIntermediate
7What is the difference between an absolute import and a relative import within a package? Python › Modules & PackagingPythonModules & PackagingIntermediate
8How does pyproject.toml serve as the modern standard for defining a Python package's build configuration and dependencies? Python › Modules & PackagingPythonModules & PackagingIntermediate
9What is __all__ and how does it control `from module import *` behavior? Python › Modules & PackagingPythonModules & PackagingIntermediate
10What is the purpose of a `requirements.txt` file, and how does it differ from dependency declarations in pyproject.toml? Python › Modules & PackagingPythonModules & PackagingIntermediate
11What does 'editable install' (pip install -e .) mean, and why is it useful during development? Python › Modules & PackagingPythonModules & PackagingIntermediate
12What is a namespace package, and how does it differ from a regular package? Python › Modules & PackagingPythonModules & PackagingAdvanced
13How does Python resolve circular imports, and what strategies avoid the resulting ImportError? Python › Modules & PackagingPythonModules & PackagingAdvanced
14How does importlib let you dynamically import a module by name at runtime? Python › Modules & PackagingPythonModules & PackagingAdvanced
15How does the module search and caching system handle submodule imports like `import package.subpackage.module`? Python › Modules & PackagingPythonModules & PackagingAdvanced
16How do you build a plugin-style CLI where subcommands are dynamically discovered and registered from separate modules, rather than hardcoded? Python › Command-Line Interfaces (argparse)PythonCommand-Line Interfaces (argparse)Advanced
17What does logging.basicConfig() do, and what are its common pitfalls? Python › LoggingPythonLoggingBeginner
18How do you use pathlib.Path for modern, object-oriented file path manipulation instead of os.path's string-based functions? Python › File I/O & Context ManagersPythonFile I/O & Context ManagersIntermediate
19Why is it recommended to use logging.getLogger(__name__) instead of the root logger in library and module code? Python › LoggingPythonLoggingIntermediate
20How do you configure logging using a dictionary via logging.config.dictConfig? Python › LoggingPythonLoggingIntermediate
21What's the difference between propagate=True and propagate=False on a logger? Python › LoggingPythonLoggingIntermediate
22How do you group related arguments visually in the generated --help output using argument groups? Python › Command-Line Interfaces (argparse)PythonCommand-Line Interfaces (argparse)Advanced
23How would you build a CLI tool where some arguments can also be set via environment variables, falling back to a default if neither is provided? Python › Command-Line Interfaces (argparse)PythonCommand-Line Interfaces (argparse)Advanced
24How do you customize argparse's automatically-generated usage and help text formatting, like preserving specific line breaks in the description? Python › Command-Line Interfaces (argparse)PythonCommand-Line Interfaces (argparse)Advanced
25How would you build a decorator-based plugin/registration system, similar to how Flask's @app.route() registers view functions? Python › DecoratorsPythonDecoratorsAdvanced
26How does logging.NullHandler help library authors avoid the 'No handlers could be found' warning? Python › LoggingPythonLoggingAdvanced