Skip to content

Commit eef933f

Browse files
committed
Update list of magic methods
1 parent 9d05fc5 commit eef933f

File tree

1 file changed

+56
-9
lines changed

1 file changed

+56
-9
lines changed

bpython/autocomplete.py

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,35 +48,51 @@
4848
ALL_MODES = (SIMPLE, SUBSTRING, FUZZY)
4949

5050
MAGIC_METHODS = tuple(
51-
"__%s__" % s
51+
f"__{s}__"
5252
for s in (
53+
"new",
5354
"init",
55+
"del",
5456
"repr",
5557
"str",
58+
"bytes",
59+
"format",
5660
"lt",
5761
"le",
5862
"eq",
5963
"ne",
6064
"gt",
6165
"ge",
62-
"cmp",
6366
"hash",
64-
"nonzero",
65-
"unicode",
67+
"bool",
6668
"getattr",
69+
"getattribute",
6770
"setattr",
71+
"delattr",
72+
"dir",
6873
"get",
6974
"set",
75+
"delete",
76+
"set_name",
77+
"init_subclass",
78+
"instancecheck",
79+
"subclasscheck",
80+
"class_getitem",
7081
"call",
7182
"len",
83+
"length_hint",
7284
"getitem",
7385
"setitem",
86+
"delitem",
87+
"missing",
7488
"iter",
7589
"reversed",
7690
"contains",
7791
"add",
7892
"sub",
7993
"mul",
94+
"matmul",
95+
"truediv",
8096
"floordiv",
8197
"mod",
8298
"divmod",
@@ -86,21 +102,52 @@
86102
"and",
87103
"xor",
88104
"or",
89-
"div",
90-
"truediv",
105+
"radd",
106+
"rsub",
107+
"rmul",
108+
"rmatmul",
109+
"rtruediv",
110+
"rfloordiv",
111+
"rmod",
112+
"rdivmod",
113+
"rpow",
114+
"rlshift",
115+
"rrshift",
116+
"rand",
117+
"rxor",
118+
"ror",
119+
"iadd",
120+
"isub",
121+
"imul",
122+
"imatmul",
123+
"itruediv",
124+
"ifloordiv",
125+
"imod",
126+
"ipow",
127+
"ilshift",
128+
"irshift",
129+
"iand",
130+
"ixor",
131+
"ixor",
91132
"neg",
92133
"pos",
93134
"abs",
94135
"invert",
95136
"complex",
96137
"int",
97138
"float",
98-
"oct",
99-
"hex",
100139
"index",
101-
"coerce",
140+
"round",
141+
"trunc",
142+
"floor",
143+
"ceil",
102144
"enter",
103145
"exit",
146+
"await",
147+
"aiter",
148+
"anext",
149+
"aenter",
150+
"aexit",
104151
)
105152
)
106153

0 commit comments

Comments
 (0)