icalendar.compatibility module#
This module contains compatibility code for different Python versions.
All compatibility checks and imports should go here. This way, we can centralize the handling of different Python versions.
Do NOT import this module directly if you use icalendar. Members will be added and removed without deprecation warnings.
- icalendar.compatibility.deprecate_for_version_8(func)[source]#
Return a deprecated public alias for func.
Wraps func so that every call emits a
DeprecationWarningand then delegates to the original implementation. The public name used in the warning message is derived fromfunc.__name__by stripping a leading underscore.Use like this:
def _q_join(...): """docstring...""" ... q_join = deprecate_for_version_8(_q_join)
- Parameters:
func – The private implementation to wrap.
- Returns:
A wrapper with the same signature and docstring as func that emits a
DeprecationWarningon every call.