jaraco.classes

raw JSON →
3.4.0 verified Tue May 12 auth: no python install: stale quickstart: stale

Utility functions for Python class constructs. Current version: 3.4.0. Maintained with regular updates.

pip install jaraco.classes
error ModuleNotFoundError: No module named 'jaraco.classes'
cause The `jaraco.classes` library is not installed in the current Python environment or the Python interpreter cannot find it in its search path.
fix
Install the library using pip: pip install jaraco.classes
error ImportError: cannot import name 'ClassName' from 'jaraco.classes'
cause The specified class or function (`ClassName`) does not exist at the imported path, has been renamed, or moved to a different submodule in the installed version of `jaraco.classes`.
fix
Check the jaraco.classes documentation or changelog for the correct import path or the updated name of the class/function. For example, if 'ClassName' was moved, adjust your import statement like from jaraco.classes.submodule import ClassName.
error AttributeError: '...' object has no attribute '...'
cause This error occurs when attempting to access an attribute or method on an object that it does not possess, often due to a typo, an incorrect object type, or a feature/method being removed or renamed in a new version of `jaraco.classes`. Specific instances include issues with `classproperty` or removed methods.
fix
Verify the attribute or method name is correct and supported by the object and the jaraco.classes version being used. Consult the library's documentation for the correct API, especially for features like classproperty or other decorators/metaclasses.
error package init file 'jaraco/__init__.py' not found (or not a regular file)
cause This issue historically occurred with `jaraco` namespace packages, particularly when using older Python versions or packaging/freezing tools (like `py2exe` or `cxFreeze`) that struggled with PEP 420 native namespace packages, expecting an explicit `__init__.py` file.
fix
Ensure you are using a modern Python version (3.3+) and up-to-date packaging tools that fully support PEP 420 namespace packages. If using a freezing tool, ensure it's compatible or, as a workaround, manually create an empty __init__.py file in the jaraco directory within your site-packages if the tool cannot handle namespace packages correctly (though this is less common with current tools). Consider upgrading your build/freezing tool.
breaking In version 3.4.0, the method 'old_method' was removed. Use 'new_method' instead.
fix Replace calls to 'old_method' with 'new_method'.
deprecated The 'legacy_function' is deprecated and will be removed in a future release.
fix Update code to use 'new_function'.
gotcha Ensure that 'arg1' and 'arg2' passed to ClassName are of the correct type to avoid runtime errors.
fix Validate input types before instantiating ClassName.
breaking The class 'ClassName' cannot be imported from 'jaraco.classes'. It may have been removed, renamed, or moved to a different submodule.
fix Check the 'jaraco.classes' library's changelog or documentation to determine the current location or alternative for 'ClassName'. Update your import statements accordingly.
breaking ClassName is no longer available in the 'jaraco.classes' module. It might have been moved, renamed, or removed.
fix Check the library's changelog or documentation for 'jaraco.classes' to find out where 'ClassName' has moved or if an alternative should be used. Update import statements accordingly.
python os / libc status wheel install import disk
3.10 alpine (musl) - - - -
3.10 slim (glibc) - - - -
3.11 alpine (musl) - - - -
3.11 slim (glibc) - - - -
3.12 alpine (musl) - - - -
3.12 slim (glibc) - - - -
3.13 alpine (musl) - - - -
3.13 slim (glibc) - - - -
3.9 alpine (musl) - - - -
3.9 slim (glibc) - - - -

A basic example demonstrating the import and usage of ClassName from jaraco.classes.

from jaraco.classes import ClassName

# Initialize ClassName with appropriate arguments
instance = ClassName(arg1, arg2)

# Utilize instance methods
instance.method()