mirror of https://github.com/ansible/ansible.git
Add typing to module_utils.compat. (#77197)
parent
5a1b891917
commit
e314f4e666
@ -0,0 +1,2 @@
|
||||
minor_changes:
|
||||
- Added ``module_utils.compat.typing`` to facilitate type-hinting on all supported Python versions.
|
@ -0,0 +1,15 @@
|
||||
"""Compatibility layer for the `typing` module, providing all Python versions access to the newest type-hinting features."""
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
# pylint: disable=wildcard-import,unused-wildcard-import
|
||||
|
||||
try:
|
||||
from typing_extensions import *
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
try:
|
||||
from typing import * # type: ignore[misc]
|
||||
except ImportError:
|
||||
pass
|
Loading…
Reference in New Issue