Answers for "python type hint or"

1

any python type hint

from typing import Any

def my_func(a: Any) -> Any:
	return a
Posted by: Guest on July-22-2021
-6

python type hints

def no_type_hint(arg):
  print(arg) # arg can be anything
  
def with_type_hint(arg: str):
  print(arg) # arg must be a string or a subtype of string
Posted by: Guest on March-21-2021

Python Answers by Framework

Browse Popular Code Answers by Language