This document describes all enum types available in the pinq module.
Controls how password input is displayed on screen.
Characters are shown but masked (e.g., as asterisks or dots).
import pinq
# Implicitly used by PasswordPromptPasswordDisplayMode.Hidden
Characters are completely hidden; nothing appears as the user types.
import pinq
# Implicitly used by PasswordPromptPasswordDisplayMode is primarily used internally by PasswordPrompt. Currently, the Python binding uses the default behavior. Future versions may expose configuration of this mode.
PasswordPrompt- Uses password display modes internally
Describes actions available during text input.
No action was triggered; input continues normally.
User submitted the input (pressed Enter).
User canceled input (pressed ESC).
User interrupted input (pressed Ctrl+C).
InputAction is part of inquire's internal action system. It may be exposed in future versions for custom input handling.
TextPrompt- Uses input actions internallyConfirmPrompt- Uses input actions internally
| Rust Enum | Python Enum | Purpose |
|---|---|---|
PasswordDisplayMode |
PasswordDisplayMode |
Password display mode selection |
InputAction |
InputAction |
Text input action types |
The following enums exist in inquire but are not yet exposed in the Python binding:
Action- Prompt-level action typesCustomTypePromptAction- Custom type prompt actionsDateSelectPromptAction- Date select prompt actionsEditorPromptAction- Editor prompt actionsMultiSelectPromptAction- Multi-select prompt actionsPasswordPromptAction- Password prompt actionsSelectPromptAction- Select prompt actionsTextPromptAction- Text prompt actions
These will be exposed in future releases as the binding expands.
All enums support equality comparison:
import pinq
mode1 = pinq.PasswordDisplayMode.Masked
mode2 = pinq.PasswordDisplayMode.Masked
if mode1 == mode2:
print("Same mode")All enums have proper string representation:
import pinq
print(pinq.PasswordDisplayMode.Masked) # PasswordDisplayMode.Masked
print(pinq.InputAction.Submit) # InputAction.SubmitWith Python 3.10+, you can use pattern matching:
import pinq
action = pinq.InputAction.Submit
match action:
case pinq.InputAction.Submit:
print("User submitted")
case pinq.InputAction.Cancel:
print("User canceled")
case _:
print("Other action")When additional enums are exposed, they will follow the same patterns:
-
Direct import from pinq module
from pinq import SomeEnum
-
Module access
import pinq pinq.SomeEnum.Variant
-
Full type hints
def handle_action(action: pinq.SomeAction) -> None: ...
- Classes Reference - All prompt classes
- Overview - Architecture and design