-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathtest.py
More file actions
72 lines (46 loc) · 2.37 KB
/
Copy pathtest.py
File metadata and controls
72 lines (46 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
def my_func():
print ("lol")
from unidecode import unidecode
import yaml
loaded_dict = yaml.load(open("../urdupython/languages/ur/ur_native.lang.yaml"))
print (loaded_dict)
print ("unidecode('1000') ->", unidecode("1000"))
print ("unidecode('abcd') ->", unidecode("abcd"))
print ("type(my_func) ->", type(my_func))
print ("callable(my_func) ->", callable(my_func))
print ("type(print) -> ", type(print))
print ("callable(print) -> ", callable(print))
# open = my_func
print ("type(open) -> ", type(open))
import types
print ("types.FunctionType -> ", types.FunctionType)
print ("isinstance(print, types.FunctionType) -> ", isinstance(print, types.FunctionType))
print ("isinstance(print, (types.FunctionType, types.BuiltinFunctionType)) -> ", isinstance(print, (types.FunctionType, types.BuiltinFunctionType)))
import functools
print ("isinstance(print, (types.FunctionType, types.BuiltinFunctionType, functools.partial)) -> ", isinstance(print, (types.FunctionType, types.BuiltinFunctionType, functools.partial)))
from inspect import isfunction, isbuiltin, getmodule
import sys
print("isfunction(print) -> ", isfunction(print))
print("isbuiltin(print) -> ", isbuiltin(print))
from numpy import random, array
print ("random.random -> ", random.random)
print ("type(random.random) -> ", type(random.random))
print ("random.random.__name__ -> ", random.random.__name__)
print ("getmodule(random.random) -> ", getmodule(random.random))
# print ("getmodule(random.random).__name__ -> ", getmodule(random.random).__name__)
# print ("random.random.__module__ -> ", random.random.__module__)
# print ("getmodule(random.random) -> ", sys.modules[random.random.__module__])
print ("open -> ", open)
print ("type(open) -> ", type(open))
print ("open.__name__ -> ", open.__name__)
print ("getmodule(open) -> ", getmodule(open))
print ("getmodule(open).__name__ -> ", getmodule(open).__name__)
print ("open.__module__ -> ", open.__module__)
print ("getmodule(open) -> ", sys.modules[open.__module__])
# print ("replaceme -> ", replaceme)
# print ("type(replaceme) -> ", type(replaceme))
# print ("replaceme.__name__ -> ", replaceme.__name__)
# print ("getmodule(replaceme) -> ", getmodule(replaceme))
# print ("getmodule(replaceme).__name__ -> ", getmodule(replaceme).__name__)
# print ("replaceme.__module__ -> ", replaceme.__module__)
# print ("getmodule(replaceme) -> ", sys.modules[replaceme.__module__])