1
1
import ast
2
2
import math
3
+ import re
3
4
import time
4
5
from _typeshed import Incomplete
5
6
from collections .abc import Generator
6
7
from typing import NoReturn
7
8
8
- eval_debug : Incomplete
9
- strTypes : Incomplete
10
- isPy39 : Incomplete
11
- haveNameConstant : Incomplete
9
+ eval_debug : int
10
+ strTypes : tuple [type [bytes ], type [str ]]
11
+ isPy39 : bool
12
+ isPy313 : bool
13
+ haveNameConstant : bool
12
14
13
15
class BadCode (ValueError ): ...
14
16
15
- augOps : Incomplete
16
- __allowed_magic_methods__ : Incomplete
17
- __rl_unsafe__ : Incomplete
18
- __rl_unsafe_re__ : Incomplete
17
+ augOps : dict [ ast . operator , str ]
18
+ __allowed_magic_methods__ : frozenset [ str ]
19
+ __rl_unsafe__ : frozenset [ str ]
20
+ __rl_unsafe_re__ : re . Pattern [ str ]
19
21
20
22
def copy_locations (new_node , old_node ) -> None : ...
21
23
@@ -175,7 +177,12 @@ class __RL_SAFE_ENV__:
175
177
real_bi : Incomplete
176
178
bi_replace : Incomplete
177
179
__rl_builtins__ : Incomplete
178
- def __init__ (self , timeout : Incomplete | None = None , allowed_magic_methods : Incomplete | None = None ) -> None : ...
180
+ def __init__ (
181
+ self ,
182
+ timeout : Incomplete | None = None ,
183
+ allowed_magic_methods : Incomplete | None = None ,
184
+ allowed_magic_names : Incomplete | None = None ,
185
+ ) -> None : ...
179
186
def __rl_type__ (self , * args ): ...
180
187
def __rl_check__ (self ) -> None : ...
181
188
def __rl_sd__ (self , obj ): ...
@@ -194,10 +201,10 @@ class __RL_SAFE_ENV__:
194
201
def __rl_reversed__ (self , seq ): ...
195
202
def __rl_range__ (self , start , * args ): ...
196
203
def __rl_set__ (self , it ): ...
197
- def __rl_frozenset__ (self , it ): ...
204
+ def __rl_frozenset__ (self , it = () ): ...
198
205
def __rl_iter_unpack_sequence__ (self , it , spec , _getiter_ ) -> Generator [Incomplete , None , None ]: ...
199
206
def __rl_unpack_sequence__ (self , it , spec , _getiter_ ): ...
200
- def __rl_is_allowed_name__ (self , name ) -> None : ...
207
+ def __rl_is_allowed_name__ (self , name , crash : bool = True ) -> bool : ...
201
208
def __rl_getattr__ (self , obj , a , * args ): ...
202
209
def __rl_getitem__ (self , obj , a ): ...
203
210
__rl_tmax__ : int
@@ -229,6 +236,7 @@ class __RL_SAFE_ENV__:
229
236
timeout : Incomplete | None = None ,
230
237
allowed_magic_methods : Incomplete | None = None ,
231
238
__frame_depth__ : int = 3 ,
239
+ allowed_magic_names : Incomplete | None = None ,
232
240
): ...
233
241
234
242
class __rl_safe_eval__ :
@@ -242,6 +250,7 @@ class __rl_safe_eval__:
242
250
l : Incomplete | None = None ,
243
251
timeout : Incomplete | None = None ,
244
252
allowed_magic_methods : Incomplete | None = None ,
253
+ allowed_magic_names : Incomplete | None = None ,
245
254
): ...
246
255
247
256
class __rl_safe_exec__ (__rl_safe_eval__ ):
@@ -251,3 +260,6 @@ def rl_extended_literal_eval(expr, safe_callables: Incomplete | None = None, saf
251
260
252
261
rl_safe_exec : __rl_safe_exec__
253
262
rl_safe_eval : __rl_safe_eval__
263
+
264
+ def __fix_set__ (value , default = ...): ...
265
+ def rl_less_safe_eval (expr , NS ): ...
0 commit comments