Server IP : 195.201.23.43 / Your IP : 3.141.24.158 Web Server : Apache System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 User : kdecoratie ( 1041) PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.8/test/ |
Upload File : |
""" The module for testing variable annotations. Empty lines above are for good reason (testing for correct line numbers) """ from typing import Optional from functools import wraps __annotations__[1] = 2 class C: x = 5; y: Optional['C'] = None from typing import Tuple x: int = 5; y: str = x; f: Tuple[int, int] class M(type): __annotations__['123'] = 123 o: type = object (pars): bool = True class D(C): j: str = 'hi'; k: str= 'bye' from types import new_class h_class = new_class('H', (C,)) j_class = new_class('J') class F(): z: int = 5 def __init__(self, x): pass class Y(F): def __init__(self): super(F, self).__init__(123) class Meta(type): def __new__(meta, name, bases, namespace): return super().__new__(meta, name, bases, namespace) class S(metaclass = Meta): x: str = 'something' y: str = 'something else' def foo(x: int = 10): def bar(y: List[str]): x: str = 'yes' bar() def dec(func): @wraps(func) def wrapper(*args, **kwargs): return func(*args, **kwargs) return wrapperPrivate