1
0
Fork 0

made list static

Dieser Commit ist enthalten in:
Sebastian Tobie 2023-04-21 18:00:20 +02:00
Ursprung 437cf72c79
Commit 40f4b11300
1 geänderte Dateien mit 1 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -1,5 +1,4 @@
import pathlib import pathlib
from functools import partial
from typing import Any, Callable, Dict, Optional, Sequence, Tuple, Type, Union from typing import Any, Callable, Dict, Optional, Sequence, Tuple, Type, Union
__all__ = ( __all__ = (
@ -68,7 +67,7 @@ class _Type(type):
if __name in self._virtual: if __name in self._virtual:
return self._vfunc(self, __name) return self._vfunc(self, __name)
if __name in self._individual: if __name in self._individual:
return partial(self._individual[__name], self) return self._individual[__name]
return super().__getattribute__(__name) return super().__getattribute__(__name)
def __dir__(self): def __dir__(self):
@ -82,9 +81,7 @@ class _Type(type):
class Types(metaclass=_Type): class Types(metaclass=_Type):
"""Provides helpers for the ansible types""" """Provides helpers for the ansible types"""
@staticmethod
def list( def list(
self,
elements: Union[Type[object], str], elements: Union[Type[object], str],
required: bool = False, required: bool = False,
help: Optional[str] = None, help: Optional[str] = None,