Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
367 views
in Technique[技术] by (71.8m points)

python - How to use the Async def expression correctly?

I make an asynchronous web application (using aiohttp, aiodocker and so on). Should I use async def expression to define function that just format strings, date, do calculations (like 6 + 6), parse data from json, etc.

    async def format_string_2_datetime(date_string: str) -> datetime:
        return datetime.fromisoformat(date_string)

or

    def format_string_2_datetime(date_string: str) -> datetime:
        return datetime.fromisoformat(date_string)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...