Lines Matching refs:inspect
6 import inspect
86 predicates = set([inspect.isbuiltin, inspect.isclass, inspect.iscode,
87 inspect.isframe, inspect.isfunction, inspect.ismethod,
88 inspect.ismodule, inspect.istraceback,
89 inspect.isgenerator, inspect.isgeneratorfunction,
90 inspect.iscoroutine, inspect.iscoroutinefunction,
91 inspect.isasyncgen, inspect.isasyncgenfunction])
98 if (predicate == inspect.isgeneratorfunction or \
99 predicate == inspect.isasyncgenfunction or \
100 predicate == inspect.iscoroutinefunction) and \
101 other == inspect.isfunction:
129 self.istest(inspect.isbuiltin, 'sys.exit')
130 self.istest(inspect.isbuiltin, '[].append')
131 self.istest(inspect.iscode, 'mod.spam.__code__')
136 self.istest(inspect.isframe, 'tb.tb_frame')
137 self.istest(inspect.istraceback, 'tb')
139 self.istest(inspect.isgetsetdescriptor,
142 self.assertFalse(inspect.isgetsetdescriptor(type(tb.tb_frame).f_locals))
146 self.istest(inspect.isfunction, 'mod.spam')
147 self.istest(inspect.isfunction, 'mod.StupidGit.abuse')
148 self.istest(inspect.ismethod, 'git.argue')
149 self.istest(inspect.ismodule, 'mod')
150 self.istest(inspect.isdatadescriptor, 'collections.defaultdict.default_factory')
151 self.istest(inspect.isgenerator, '(x for x in range(2))')
152 self.istest(inspect.isgeneratorfunction, 'generator_function_example')
153 self.istest(inspect.isasyncgen,
155 self.istest(inspect.isasyncgenfunction,
160 self.istest(inspect.iscoroutine, 'coroutine_function_example(1)')
161 self.istest(inspect.iscoroutinefunction, 'coroutine_function_example')
164 self.istest(inspect.ismemberdescriptor, 'datetime.timedelta.days')
166 self.assertFalse(inspect.ismemberdescriptor(datetime.timedelta.days))
173 inspect.iscoroutinefunction(gen_coroutine_function_example))
174 self.assertFalse(inspect.iscoroutine(gen_coro))
177 inspect.isgeneratorfunction(gen_coroutine_function_example))
178 self.assertTrue(inspect.isgenerator(gen_coro))
181 inspect.iscoroutinefunction(coroutine_function_example))
182 self.assertTrue(inspect.iscoroutine(coro))
185 inspect.isgeneratorfunction(coroutine_function_example))
186 self.assertFalse(inspect.isgenerator(coro))
192 self.assertFalse(inspect.isawaitable(gen()))
197 self.assertTrue(inspect.isawaitable(coro))
198 self.assertTrue(inspect.isawaitable(gen_coro))
203 self.assertTrue(inspect.isawaitable(Future()))
204 self.assertFalse(inspect.isawaitable(Future))
209 self.assertFalse(inspect.isawaitable(not_fut))
214 self.assertTrue(inspect.isroutine(mod.spam))
215 self.assertTrue(inspect.isroutine([].count))
218 self.istest(inspect.isclass, 'mod.StupidGit')
219 self.assertTrue(inspect.isclass(list))
224 self.assertFalse(inspect.isclass(CustomGetattr()))
231 members = dict(inspect.getmembers(x))
251 self.assertTrue(inspect.isabstract(AbstractClassExample))
252 self.assertFalse(inspect.isabstract(ClassExample))
253 self.assertFalse(inspect.isabstract(a))
254 self.assertFalse(inspect.isabstract(int))
255 self.assertFalse(inspect.isabstract(5))
262 isabstract_checks.append(inspect.isabstract(cls))
289 self.istest(inspect.istraceback, 'git.ex[2]')
290 self.istest(inspect.isframe, 'mod.fr')
321 args, varargs, varkw, locals = inspect.getargvalues(mod.fr)
326 self.assertEqual(inspect.formatargvalues(args, varargs, varkw, locals),
330 args, varargs, varkw, locals = inspect.getargvalues(mod.fr.f_back)
334 self.assertEqual(inspect.formatargvalues(args, varargs, varkw, locals),
342 with open(inspect.getsourcefile(self.fodderModule)) as fp:
350 self.assertEqual(inspect.getsource(obj),
357 classes = inspect.getmembers(mod, inspect.isclass)
365 tree = inspect.getclasstree([cls[1] for cls in classes])
380 tree = inspect.getclasstree([cls[1] for cls in classes], True)
394 functions = inspect.getmembers(mod, inspect.isfunction)
402 self.assertEqual(inspect.getdoc(mod), 'A module docstring.')
403 self.assertEqual(inspect.getdoc(mod.StupidGit),
405 self.assertEqual(inspect.getdoc(git.abuse),
411 self.assertEqual(inspect.getdoc(mod.FesteringGob),
413 self.assertEqual(inspect.getdoc(mod.FesteringGob.abuse),
415 self.assertEqual(inspect.getdoc(mod.FesteringGob().abuse),
417 self.assertEqual(inspect.getdoc(mod.FesteringGob.contradiction),
422 finddoc = inspect._finddoc
430 self.assertEqual(inspect.cleandoc('An\n indented\n docstring.'),
434 self.assertEqual(inspect.getcomments(mod), '# line 1\n')
435 self.assertEqual(inspect.getcomments(mod.StupidGit), '# line 20\n')
438 self.assertIsNone(inspect.getcomments(co))
440 self.assertIsNone(inspect.getcomments(list))
444 self.assertEqual(inspect.getmodule(mod), mod)
446 self.assertEqual(inspect.getmodule(mod.StupidGit), mod)
448 self.assertEqual(inspect.getmodule(mod.StupidGit.abuse), mod)
450 self.assertEqual(inspect.getmodule(mod.StupidGit.abuse), mod)
452 self.assertEqual(inspect.getmodule(str), sys.modules["builtins"])
454 self.assertEqual(inspect.getmodule(None, modfile), mod)
457 frame_info = inspect.getframeinfo(self.fodderModule.fr, 50)
467 self.assertEqual(normcase(inspect.getsourcefile(mod.spam)), modfile)
468 self.assertEqual(normcase(inspect.getsourcefile(git.abuse)), modfile)
471 self.assertEqual(inspect.getsourcefile(co), None)
474 self.assertEqual(normcase(inspect.getsourcefile(co)), fn)
479 self.assertEqual(inspect.getfile(mod.StupidGit), mod.__file__)
489 inspect.getfile(C)
497 inspect.getfile(er)
506 self.assertEqual(inspect.getsourcefile(m.x.__code__), '<string>')
508 inspect.getmodule(compile('a=10','','single'))
523 inspect.getsource(ns["x"])
627 self.assertRaises(OSError, inspect.getsource, unicodedata)
628 self.assertRaises(OSError, inspect.findsource, unicodedata)
633 self.assertRaises(OSError, inspect.findsource, co)
634 self.assertRaises(OSError, inspect.getsource, co)
637 self.assertEqual(inspect.findsource(co), (lines,0))
638 self.assertEqual(inspect.getsource(co), lines[0])
645 self.assertRaises(IOError, inspect.findsource, co)
646 self.assertRaises(IOError, inspect.getsource, co)
701 return [t[:3] for t in inspect.classify_class_attrs(cls)]
713 got = inspect.getmro(D)
719 args, varargs, varkw, defaults = inspect.getargspec(routine)
726 self.assertEqual(inspect.formatargspec(args, varargs, varkw, defaults),
734 inspect.getfullargspec(routine)
744 self.assertEqual(inspect.formatargspec(args, varargs, varkw, defaults,
821 spam_param = inspect.Parameter('spam', inspect.Parameter.POSITIONAL_ONLY)
822 test.__signature__ = inspect.Signature(parameters=(spam_param,))
828 spec = inspect.getfullargspec(test)
832 spec = inspect.getfullargspec(test)
857 spec = inspect.getfullargspec(builtin)
867 inspect.getfullargspec(builtin)
871 signature = inspect.getfullargspec(fn)
876 signature = inspect.getfullargspec(unsorted_keyword_only_parameters_fn)
973 inspect.classify_class_attrs(builtin)
997 should_find_dca = inspect.Attribute('ham', 'data', VA, VA.__dict__['ham'])
998 self.assertIn(should_find_dca, inspect.classify_class_attrs(VA))
999 should_find_ga = inspect.Attribute('ham', 'data', Meta, 'spam')
1000 self.assertIn(should_find_ga, inspect.classify_class_attrs(VA))
1014 should_find_attr = inspect.Attribute('dd', 'data', HasNB, HasNB.dd)
1015 self.assertIn(should_find_attr, inspect.classify_class_attrs(HasNB))
1024 should_find = inspect.Attribute('fish', 'data', Meta, 'slap')
1025 self.assertIn(should_find, inspect.classify_class_attrs(Class))
1037 should_find = inspect.Attribute('BOOM', 'data', Meta, 42)
1038 self.assertIn(should_find, inspect.classify_class_attrs(Class))
1068 should_find1 = inspect.Attribute('one', 'data', Meta1, 1)
1069 should_find2 = inspect.Attribute('two', 'data', Meta2, 2)
1070 should_find3 = inspect.Attribute('three', 'data', Meta3, 3)
1071 cca = inspect.classify_class_attrs(Class2)
1081 attrs = [a[0] for a in inspect.classify_class_attrs(C)]
1100 ismethoddescriptor = pred_wrapper(inspect.ismethoddescriptor)
1101 isdatadescriptor = pred_wrapper(inspect.isdatadescriptor)
1103 self.assertEqual(inspect.getmembers(A, ismethoddescriptor),
1105 self.assertEqual(inspect.getmembers(A, isdatadescriptor),
1111 self.assertEqual(inspect.getmembers(B, ismethoddescriptor),
1113 self.assertEqual(inspect.getmembers(B, isdatadescriptor),
1121 self.assertIn(('f', B.f), inspect.getmembers(B))
1122 self.assertNotIn(('f', B.f), inspect.getmembers(B, inspect.ismethod))
1124 self.assertIn(('f', b.f), inspect.getmembers(b))
1125 self.assertIn(('f', b.f), inspect.getmembers(b, inspect.ismethod))
1137 self.assertIn(('eggs', 'scrambled'), inspect.getmembers(A))
1138 self.assertIn(('eggs', 'spam'), inspect.getmembers(A()))
1146 attrs = [a[0] for a in inspect.getmembers(C)]
1164 expected = inspect.ClosureVars(nonlocal_vars, global_vars,
1166 self.assertEqual(inspect.getclosurevars(f(_arg)), expected)
1179 expected = inspect.ClosureVars(nonlocal_vars, global_vars,
1181 self.assertEqual(inspect.getclosurevars(f(_arg)), expected)
1194 expected = inspect.ClosureVars(nonlocal_vars, global_vars,
1196 self.assertEqual(inspect.getclosurevars(C().f(_arg)), expected)
1201 return inspect.getclosurevars(f).nonlocals
1238 _empty = inspect.ClosureVars({}, {}, {}, set())
1239 self.assertEqual(inspect.getclosurevars(lambda: True), _empty)
1240 self.assertEqual(inspect.getclosurevars(foo), _empty)
1244 self.assertRaises(TypeError, inspect.getclosurevars, 1)
1245 self.assertRaises(TypeError, inspect.getclosurevars, list)
1246 self.assertRaises(TypeError, inspect.getclosurevars, {})
1257 expected = inspect.ClosureVars({}, {}, {"print":print}, {"path"})
1258 self.assertEqual(inspect.getclosurevars(f), expected)
1263 expected = inspect.ClosureVars({}, {}, {"path":1}, {"print"})
1264 self.assertEqual(inspect.getclosurevars(f), expected)
1269 expected = inspect.ClosureVars({}, {}, {"path":os.path}, {"print"})
1270 self.assertEqual(inspect.getclosurevars(f), expected)
1450 inspect.getcallargs(f5)
1457 inspect.getcallargs(f6)
1463 inspect.Parameter("foo", kind=inspect.Parameter.VAR_KEYWORD,
1467 inspect.Parameter("bar", kind=5, default=42)
1471 inspect.Parameter(123, kind=4)
1514 self.assertEqual(inspect.getattr_static(thing, 'x'), Thing.x)
1515 self.assertEqual(inspect.getattr_static(thing, 'x', None), Thing.x)
1517 inspect.getattr_static(thing, 'y')
1519 self.assertEqual(inspect.getattr_static(thing, 'y', 3), 3)
1528 self.assertEqual(inspect.getattr_static(something, 'x'), Thing.x)
1536 self.assertEqual(inspect.getattr_static(thing, 'x'), 3)
1538 self.assertEqual(inspect.getattr_static(thing, 'x'), 2)
1546 self.assertEqual(inspect.getattr_static(thing, 'x'), Thing.x)
1556 self.assertEqual(inspect.getattr_static(thing, 'x'), desc)
1562 self.assertEqual(inspect.getattr_static(Thing, 'x'), Thing.x)
1571 self.assertEqual(inspect.getattr_static(Thing, 'x'), Thing.__dict__['x'])
1579 self.assertEqual(inspect.getattr_static(OtherThing, 'x'), Thing.x)
1588 self.assertEqual(inspect.getattr_static(thing, 'x'), Thing.x)
1589 self.assertEqual(inspect.getattr_static(thing, 'y'), 'bar')
1592 self.assertEqual(inspect.getattr_static(thing, 'x'), Thing.x)
1599 self.assertEqual(inspect.getattr_static(Thing, 'attr'), 'foo')
1605 self.assertEqual(inspect.getattr_static(OtherThing, 'attr'), 'foo')
1610 self.assertEqual(inspect.getattr_static(OtherOtherThing, 'x'), 3)
1613 self.assertEqual(inspect.getattr_static(1, 'foo', None), None)
1614 self.assertNotEqual(inspect.getattr_static('foo', 'lower'), None)
1619 self.assertEqual(inspect.getattr_static(handle, 'name'), type(handle).name)
1632 self.assertEqual(inspect.getattr_static(OtherThing(), 'x'), Thing.x)
1645 self.assertEqual(inspect.getattr_static(foo, 'd'), 1)
1650 self.assertEqual(inspect.getattr_static(foo, 'd'), Foo.__dict__['d'])
1661 self.assertEqual(inspect.getattr_static(Thing, 'd'), meta.__dict__['d'])
1676 self.assertEqual(inspect.getattr_static(instance, 'foo'), 3)
1678 self.assertEqual(inspect.getattr_static(Something, 'foo'), 3)
1692 self.assertEqual(inspect.getattr_static(Something(), 'foo'), 3)
1693 self.assertEqual(inspect.getattr_static(Something, 'foo'), 3)
1708 self.assertEqual(inspect.getattr_static(foo, 'a'), 3)
1724 self.assertEqual(inspect.getattr_static(foo, 'a'), 3)
1740 self.assertEqual(inspect.getattr_static(instance, "spam"), 42)
1745 self.assertIsNot(inspect.getattr_static(sys, "version", sentinel),
1762 inspect.getattr_static(Thing, "spam")
1774 return inspect.getgeneratorstate(self.generator)
1777 self.assertEqual(self._generatorstate(), inspect.GEN_CREATED)
1781 self.assertEqual(self._generatorstate(), inspect.GEN_SUSPENDED)
1786 self.assertEqual(self._generatorstate(), inspect.GEN_CLOSED)
1791 self.assertEqual(self._generatorstate(), inspect.GEN_CLOSED)
1800 self.assertEqual(self._generatorstate(), inspect.GEN_RUNNING)
1802 self.assertEqual(self._generatorstate(), inspect.GEN_RUNNING)
1813 state = getattr(inspect, name)
1826 self.assertEqual(inspect.getgeneratorlocals(numbers),
1829 self.assertEqual(inspect.getgeneratorlocals(numbers),
1833 self.assertEqual(inspect.getgeneratorlocals(numbers),
1837 self.assertEqual(inspect.getgeneratorlocals(numbers),
1844 self.assertEqual(inspect.getgeneratorlocals(numbers), {})
1850 self.assertEqual(inspect.getgeneratorlocals(one), {})
1855 self.assertEqual(inspect.getgeneratorlocals(one), {})
1858 self.assertRaises(TypeError, inspect.getgeneratorlocals, 1)
1859 self.assertRaises(TypeError, inspect.getgeneratorlocals, lambda x: True)
1860 self.assertRaises(TypeError, inspect.getgeneratorlocals, set)
1861 self.assertRaises(TypeError, inspect.getgeneratorlocals, (2,3))
1879 return inspect.getcoroutinestate(self.coroutine)
1882 self.assertEqual(self._coroutinestate(), inspect.CORO_CREATED)
1886 self.assertEqual(self._coroutinestate(), inspect.CORO_SUSPENDED)
1895 self.assertEqual(self._coroutinestate(), inspect.CORO_CLOSED)
1900 self.assertEqual(self._coroutinestate(), inspect.CORO_CLOSED)
1906 state = getattr(inspect, name)
1921 self.assertEqual(inspect.getcoroutinelocals(coro),
1924 self.assertEqual(inspect.getcoroutinelocals(coro),
1928 class MySignature(inspect.Signature):
1933 class MyParameter(inspect.Parameter):
1943 sig = inspect.signature(func, **kw)
1954 S = inspect.Signature
1955 P = inspect.Parameter
1961 sig = inspect.signature(test)
2004 sig = inspect.signature(foo_partial)
2012 sig = inspect.signature(foo)
2013 myparam = MyParameter(name='z', kind=inspect.Parameter.POSITIONAL_ONLY)
2031 sig = inspect.signature(test)
2115 signature = inspect.signature(o)
2116 self.assertTrue(isinstance(signature, inspect.Signature))
2122 signature = inspect.signature(o)
2123 self.assertTrue(isinstance(signature, inspect.Signature))
2195 self.assertEqual(inspect.signature(func),
2196 inspect.signature(decorated_func))
2199 self.assertEqual(inspect.signature(decorated_func,
2201 inspect.signature(wrapper_like))
2208 inspect.signature(_testcapi.docstring_no_signature)
2212 inspect.signature(str)
2216 inspect.signature(42)
2238 sig_func = inspect.Signature.from_callable(func)
2240 sig_funclike = inspect.Signature.from_callable(funclike(func))
2243 sig_funclike = inspect.signature(funclike(func))
2257 _orig_isdesc = inspect.ismethoddescriptor
2266 self.assertFalse(inspect.ismethoddescriptor(builtin_func))
2268 self.assertTrue(inspect.ismethoddescriptor(builtin_func))
2269 self.assertEqual(inspect.signature(builtin_func), sig_func)
2288 self.assertEqual(str(inspect.signature(funclike)), '(marker)')
2369 Parameter = inspect.Parameter
2377 inspect.signature(partial(test, 1))
2380 inspect.signature(partial(test, a=1))
2474 sig = test.__signature__ = inspect.signature(test)
2485 psig = inspect.signature(partial(partial(test, 1), 2))
2517 ba = inspect.signature(_foo).bind(a=200, b=11)
2524 ba = inspect.signature(_foo).bind(a=11)
2527 ba = inspect.signature(_foo).bind(11, 12)
2530 ba = inspect.signature(_foo).bind(11, b=12)
2533 ba = inspect.signature(_foo).bind(b=12)
2537 ba = inspect.signature(_foo).bind(12)
2543 sig = inspect.signature(foo)
2547 foo.__signature__ = inspect.Signature(params.values())
2548 sig = inspect.signature(foo)
2591 inspect.signature(Spam.ham)
2622 self.assertEqual(str(inspect.signature(foo)), '(a)')
2661 sig = inspect.signature(func)
2777 self.assertEqual(str(inspect.signature(C)), '()')
2779 self.assertEqual(str(inspect.signature(D)), '()')
2785 self.assertEqual(inspect.signature(C), None)
2787 self.assertEqual(inspect.signature(D), None)
2792 self.assertEqual(str(inspect.signature(_pickle.Pickler)),
2798 self.assertEqual(str(inspect.signature(P)),
2800 self.assertEqual(str(inspect.signature(P2)),
2806 self.assertEqual(str(inspect.signature(P3)), '(spam)')
2813 self.assertEqual(str(inspect.signature(P4)), '(foo, bar)')
2827 inspect.signature(Spam())
2854 self.assertFalse(inspect.signature(foo) == 42)
2855 self.assertTrue(inspect.signature(foo) != 42)
2856 self.assertTrue(inspect.signature(foo) == EqualsToAll())
2857 self.assertFalse(inspect.signature(foo) != EqualsToAll())
2860 self.assertTrue(inspect.signature(foo) == inspect.signature(bar))
2861 self.assertFalse(inspect.signature(foo) != inspect.signature(bar))
2863 hash(inspect.signature(foo)), hash(inspect.signature(bar)))
2866 self.assertFalse(inspect.signature(foo) == inspect.signature(bar))
2867 self.assertTrue(inspect.signature(foo) != inspect.signature(bar))
2869 hash(inspect.signature(foo)), hash(inspect.signature(bar)))
2872 self.assertFalse(inspect.signature(foo) == inspect.signature(bar))
2873 self.assertTrue(inspect.signature(foo) != inspect.signature(bar))
2875 hash(inspect.signature(foo)), hash(inspect.signature(bar)))
2878 self.assertFalse(inspect.signature(foo) == inspect.signature(bar))
2879 self.assertTrue(inspect.signature(foo) != inspect.signature(bar))
2881 hash(inspect.signature(foo)), hash(inspect.signature(bar)))
2884 self.assertFalse(inspect.signature(foo) == inspect.signature(bar))
2885 self.assertTrue(inspect.signature(foo) != inspect.signature(bar))
2887 hash(inspect.signature(foo)), hash(inspect.signature(bar)))
2890 self.assertFalse(inspect.signature(foo) == inspect.signature(bar))
2891 self.assertTrue(inspect.signature(foo) != inspect.signature(bar))
2893 hash(inspect.signature(foo)), hash(inspect.signature(bar)))
2895 self.assertFalse(inspect.signature(spam) == inspect.signature(bar))
2896 self.assertTrue(inspect.signature(spam) != inspect.signature(bar))
2898 hash(inspect.signature(spam)), hash(inspect.signature(bar)))
2902 self.assertTrue(inspect.signature(foo) == inspect.signature(bar))
2903 self.assertFalse(inspect.signature(foo) != inspect.signature(bar))
2905 hash(inspect.signature(foo)), hash(inspect.signature(bar)))
2909 self.assertTrue(inspect.signature(foo) == inspect.signature(bar))
2910 self.assertFalse(inspect.signature(foo) != inspect.signature(bar))
2912 hash(inspect.signature(foo)), hash(inspect.signature(bar)))
2916 self.assertTrue(inspect.signature(foo) == inspect.signature(bar))
2917 self.assertFalse(inspect.signature(foo) != inspect.signature(bar))
2919 hash(inspect.signature(foo)), hash(inspect.signature(bar)))
2923 self.assertFalse(inspect.signature(foo) == inspect.signature(bar))
2924 self.assertTrue(inspect.signature(foo) != inspect.signature(bar))
2926 hash(inspect.signature(foo)), hash(inspect.signature(bar)))
2930 self.assertTrue(inspect.signature(foo) == inspect.signature(bar))
2931 self.assertFalse(inspect.signature(foo) != inspect.signature(bar))
2933 hash(inspect.signature(foo)), hash(inspect.signature(bar)))
2936 S = inspect.Signature
2937 P = inspect.Parameter
2940 foo_sig = inspect.signature(foo)
2949 self.assertNotEqual(hash(foo_sig), hash(inspect.signature(bar)))
2953 hash(inspect.signature(foo))
2957 hash(inspect.signature(foo))
2962 self.assertEqual(str(inspect.signature(foo)),
2967 self.assertEqual(str(inspect.signature(foo)),
2972 self.assertEqual(str(inspect.signature(foo)), '()')
2975 P = inspect.Parameter
2976 S = inspect.Signature
2981 sig = inspect.signature(test)
2986 self.assertEqual(str(inspect.signature(test)),
3006 sig = inspect.signature(test)
3013 self.assertEqual(sig, inspect.signature(test))
3032 class MySignature(inspect.Signature): pass
3040 class MySignature(inspect.Signature): pass
3046 signature = inspect.signature(fn)
3051 signature = inspect.signature(unsorted_keyword_only_parameters_fn)
3058 P = inspect.Parameter
3066 p = inspect.Parameter('foo', default=10,
3067 kind=inspect.Parameter.POSITIONAL_ONLY)
3071 self.assertEqual(p.kind, inspect.Parameter.POSITIONAL_ONLY)
3075 inspect.Parameter('foo', default=10, kind='123')
3078 inspect.Parameter('1', kind=inspect.Parameter.VAR_KEYWORD)
3081 inspect.Parameter(None, kind=inspect.Parameter.VAR_KEYWORD)
3085 inspect.Parameter('$', kind=inspect.Parameter.VAR_KEYWORD)
3089 inspect.Parameter('.a', kind=inspect.Parameter.VAR_KEYWORD)
3092 inspect.Parameter('a', default=42,
3093 kind=inspect.Parameter.VAR_KEYWORD)
3096 inspect.Parameter('a', default=42,
3097 kind=inspect.Parameter.VAR_POSITIONAL)
3099 p = inspect.Parameter('a', default=42,
3100 kind=inspect.Parameter.POSITIONAL_OR_KEYWORD)
3102 p.replace(kind=inspect.Parameter.VAR_POSITIONAL)
3108 P = inspect.Parameter
3117 P = inspect.Parameter
3118 p = P('foo', default=42, kind=inspect.Parameter.KEYWORD_ONLY)
3128 kind=inspect.Parameter.KEYWORD_ONLY))
3130 kind=inspect.Parameter.KEYWORD_ONLY))
3133 p = inspect.Parameter('foo', default=42,
3134 kind=inspect.Parameter.KEYWORD_ONLY)
3174 inspect.Parameter(None, kind=inspect.Parameter.POSITIONAL_ONLY)
3182 inspect.Parameter('.0', kind=inspect.Parameter.POSITIONAL_ONLY)
3184 param = inspect.Parameter(
3185 '.0', kind=inspect.Parameter.POSITIONAL_OR_KEYWORD)
3186 self.assertEqual(param.kind, inspect.Parameter.POSITIONAL_ONLY)
3190 p = inspect.Parameter('spam', kind=inspect.Parameter.KEYWORD_ONLY)
3202 sig = inspect.signature(func)
3367 sig = inspect.signature(test)
3379 P = inspect.Parameter
3384 sig = inspect.signature(test)
3413 sig = inspect.signature(test)
3422 sig = inspect.signature(test)
3433 sig = inspect.signature(test)
3452 ba = inspect.signature(foo).bind(1)
3459 ba = inspect.signature(foo).bind(1)
3465 ba2 = inspect.signature(foo).bind(1)
3469 ba3 = inspect.signature(foo).bind(2)
3477 ba4 = inspect.signature(bar).bind(1)
3482 sig = inspect.signature(foo)
3490 sig = inspect.signature(foo)
3500 sig = inspect.signature(foo)
3506 sig = inspect.signature(foo)
3525 sig = inspect.signature(foo)
3534 sig = inspect.signature(foo)
3541 sig = inspect.signature(foo)
3549 getter = inspect._signature_get_bound_param
3560 inspect._signature_strip_non_python_syntax(input)
3657 self.assertIsNotNone(inspect.signature(obj))
3686 self.assertIs(inspect.unwrap(wrapper), func)
3697 self.assertIs(inspect.unwrap(wrapper), func)
3709 unwrapped = inspect.unwrap(wrapper,
3717 inspect.unwrap(func1)
3723 inspect.unwrap(func1)
3725 inspect.unwrap(func2)
3733 self.assertIsNone(inspect.unwrap(C()))
3738 inspect.unwrap(obj)
3747 self.assertEqual(lines[:-1], inspect.getsource(module).splitlines())
3755 inspect.signature(foo)
3765 inspect.getsource(ThreadPoolExecutor).splitlines())
3801 inspected_src = inspect.getsource(source)