From 723ceed92de80d59221ccf8054718e6a11a5cbb9 Mon Sep 17 00:00:00 2001 From: Nyakku Shigure Date: Wed, 4 Jan 2023 11:55:21 +0800 Subject: [PATCH] [CodeStyle][UP019] update deprecated type annotation in `python/paddle/jit/api.py` (#49506) * [CodeStyle][isort][UP019] sort imports and update deprecated type annotation in paddle/jit/api.py * Revert "[CodeStyle][isort][UP019] sort imports and update deprecated type annotation in paddle/jit/api.py" This reverts commit 0ca4d52c900199126e6433057d1514dbf9d4ee07. * update deprecated typing --- python/paddle/jit/api.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/python/paddle/jit/api.py b/python/paddle/jit/api.py index 199667d3cb..f55aeb5c1b 100644 --- a/python/paddle/jit/api.py +++ b/python/paddle/jit/api.py @@ -16,13 +16,15 @@ # Temporary disable isort to avoid circular import # This can be removed after the circular import is resolved # isort: skip_file +from __future__ import annotations + import os import pickle import warnings from collections import OrderedDict import inspect import threading -from typing import Text, Tuple, Any, List +from typing import Any import paddle from paddle.fluid import core, dygraph @@ -705,12 +707,12 @@ def _run_save_pre_hooks(func): return wrapper -def _save_property(filename: Text, property_vals: List[Tuple[Any, Text]]): +def _save_property(filename: str, property_vals: list[tuple[Any, str]]): """class property serialization. Args: - filename (Text): *.meta - property_vals (List[Tuple): class property. + filename (str): *.meta + property_vals (list[tuple[Any, str]]): class property. """ def set_property(meta, key, val): -- GitLab