itanium-demangler
raw JSON → 1.1 verified Sat May 09 auth: no python
A pure Python library for demangling Itanium C++ ABI symbol names (used by GCC, Clang, and others). Version 1.1 is current; it is stable and rarely updated.
pip install itanium-demangler Common errors
error AttributeError: module 'itanium_demangler' has no attribute 'demangle' ↓
cause Incorrect import: users try to import demangle instead of the correct demangle_symbol.
fix
Replace 'from itanium_demangler import demangle' with 'from itanium_demangler import demangle_symbol'.
error TypeError: demangle_symbol() missing 1 required positional argument: 'mangled_name' ↓
cause Calling demangle_symbol without arguments.
fix
Ensure you pass the mangled symbol string: demangle_symbol('_Z3fooi').
Warnings
gotcha The library only handles Itanium ABI mangling (GCC/Clang). It will not demangle MSVC or Rust symbols; it returns None for unrecognized inputs. ↓
fix Check that the symbol follows the Itanium ABI pattern (starts with _Z). Use different demanglers for other platforms.
gotcha The function returns None if demangling fails, not an exception. Do not assume success without checking the return value. ↓
fix Always check the result: if result is None, handle the error gracefully.
deprecated Version 1.1 is older; the library is in maintenance mode with few updates. There are no known deprecations, but new features should not be expected. ↓
fix No immediate action needed; but for active development consider if alternatives (e.g., libcxx Demangle) are needed.
Imports
- demangle_symbol wrong
from itanium_demangler import demanglecorrectfrom itanium_demangler import demangle_symbol - parse
from itanium_demangler import parse
Quickstart
from itanium_demangler import demangle_symbol
mangled = '_Z3fooi'
result = demangle_symbol(mangled)
print(result) # 'foo(int)'