File tree Expand file tree Collapse file tree 1 file changed +0
-32
lines changed Expand file tree Collapse file tree 1 file changed +0
-32
lines changed Original file line number Diff line number Diff line change @@ -330,15 +330,6 @@ def get_field_type(type_: Any) -> FieldType:
330
330
raise TypeError (f"Could not find any field type in { type_ !r} ." )
331
331
332
332
333
- def get_inner (hint : Any , * indexes : int ) -> Any :
334
- """Return an inner type hint by indexes."""
335
- if not indexes :
336
- return hint
337
-
338
- index , indexes = indexes [0 ], indexes [1 :]
339
- return get_inner (get_args (hint )[index ], * indexes )
340
-
341
-
342
333
def get_repr_type (type_ : Any ) -> Any :
343
334
"""Parse a type and return an representative type.
344
335
@@ -361,26 +352,3 @@ class Temporary:
361
352
return get_args (unannotated )[0 ]
362
353
363
354
return unannotated
364
-
365
-
366
- def is_str_literal (hint : Any ) -> bool :
367
- """Check if a type hint is Literal[str]."""
368
- args : Any = get_args (hint )
369
- origin = get_origin (hint )
370
-
371
- if origin is not Literal :
372
- return False
373
-
374
- if not len (args ) == 1 :
375
- return False
376
-
377
- return isinstance (args [0 ], str )
378
-
379
-
380
- def unannotate (hint : Any ) -> Any :
381
- """Recursively remove Annotated type hints."""
382
-
383
- class Temp :
384
- __annotations__ = dict (hint = hint )
385
-
386
- return get_type_hints (Temp )["hint" ]
You can’t perform that action at this time.
0 commit comments