Python added syntax for \ something called Variable Annotation in version 3.6. Variable Annotation is basically an enhancement of type hinting, which was introduced in Python 3.5. The full explanation behind Variable Annotation is explained in PEP 526. In this article, we give have a quick refresher on type hinting and then introduce the new Variable Annotation syntax. What's Type Hinting? Type hinting in Python is basically declaring that the parameters in your functions and methods have a certain type. Python does not enforce the type "hints," but you can use tools like mypy to enforce the type hints in much the same way that C++ enforces type declarations at runtime. Let's look at a normal function with no type hints added:
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.
Stay tuned to my blog, twitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.
tutorial,python,big data,python tutorial,variable annotations
Stay tuned to my blog, twitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.
This article is related to
tutorial,python,big data,python tutorial,variable annotations
0 Comments