def ifnone (a: Any, b: Any)->Any: return b if a is None else a
I don't understand this function well. Is Any like Auto in c ++? Also, what does the (a, b)->Any->Any part mean?
Answer # 1
Any is something like Auto in c ++
typing --- Type hint support-Any
(a, b)->Any part->What does the part of Any mean?
(a: Any, b: Any)->Any
Answer # 2
Any after a means that a can be any type of variable.
->Any means that the return value of the function can be any type.
Detailed in the article below. You can refer this if you like.
- python 3x - about functions used in python for statement
- python - about the optimum angle of rotation matrix
- python - about x-axis adjustment in matplotlib
- python - about "" "of" "" select === = "" "
- python, about the fire spread step of forest fire simulation
- python - about hamiltonian neural networks
- python - about write loop to csv
- about python argument and data definition
- python 3x - about downloading anaconda
- i have a question about basic python problems
- python 3x - please teach about the exchange of information with qthead
- about processing to exclude the character string group specified from list in python
- python - what i don't understand about yolo9000 (v2)
- about batch change of file name using python
- about the python speedtest code
- about the implementation of combinations in python
- please tell me about the role of python tag = "mychr"
- about python def issues
- python - about downloading youtube videos by youtube-dl
- about image output of python