What is optional str in Python?

As mentioned in the above comments, Optional[str] is a type-hint to be used by IDEs and other static analysis tools, not a default argument . If you want to make a default argument such that you can call the function with a() , then you do need to add = None as you proposed.

Sizin İçin Seçtik  Is 700 megahertz good?

Leave a Reply

Your email address will not be published. Required fields are marked *

What is optional str in Python?

As mentioned in the above comments, Optional[str] is a type-hint to be used by IDEs and other static analysis tools, not a default argument . If you want to make a default argument such that you can call the function with a() , then you do need to add = None as you proposed.

Sizin İçin Seçtik  Can we have optional parameter in Java?

Leave a Reply

Your email address will not be published. Required fields are marked *