OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
python311
/
lib
/
python3.11
/
site-packages
/
typish
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
09/05/2025 09:34:01 AM
rwxr-xr-x
📄
__init__.py
1.45 KB
05/08/2024 06:42:59 PM
rw-r--r--
📁
__pycache__
-
05/08/2024 06:42:59 PM
rwxr-xr-x
📄
_classes.py
11.35 KB
05/08/2024 06:42:59 PM
rw-r--r--
📄
_decorators.py
734 bytes
05/08/2024 06:42:59 PM
rw-r--r--
📄
_functions.py
15.25 KB
05/08/2024 06:42:59 PM
rw-r--r--
📄
_meta.py
245 bytes
05/08/2024 06:42:59 PM
rw-r--r--
📄
_state.py
1.27 KB
05/08/2024 06:42:59 PM
rw-r--r--
📄
_types.py
446 bytes
05/08/2024 06:42:59 PM
rw-r--r--
📁
classes
-
05/08/2024 06:42:59 PM
rwxr-xr-x
📁
decorators
-
05/08/2024 06:42:59 PM
rwxr-xr-x
📄
effe.py
841 bytes
05/08/2024 06:42:59 PM
rw-r--r--
📁
functions
-
05/08/2024 06:42:59 PM
rwxr-xr-x
Editing: _decorators.py
Close
""" PRIVATE MODULE: do not import (from) it directly. This module contains decorators. """ import inspect from typish._functions import _map_empty, instance_of def typechecked(decorated): sig = inspect.signature(decorated) param_names = list(sig.parameters) def _wrapper(*args, **kwargs): for i, arg in enumerate(args): param = sig.parameters[param_names[i]] param_type = _map_empty(param.annotation) if not instance_of(arg, param_type): raise TypeError('Value {} for \'{}\' is not of type \'{}\'' .format(arg, param.name, param_type)) return decorated(*args, **kwargs) return _wrapper