Skip to Content
Hands-On Software Engineering with Python
book

Hands-On Software Engineering with Python

by Nimesh Verma, Brian Allbee
October 2018
Beginner to intermediate
736 pages
17h 39m
English
Packt Publishing
Content preview from Hands-On Software Engineering with Python

Function and method annotation (hinting)

If you've worked with Python functions and methods before, you may have noticed and wondered about some unexpected syntax in some of the methods in the template files earlier, specifically the items in bold here:

def _get_property_name(self) -> str:

def _set_property_name(self, value:str) -> None:

def _del_property_name(self) -> None:

def instance_method(self, arg:str, *args, **kwargs):

These are examples of type hints that are supported in Python 3. One of the standards that hms_sys code will also adhere to is that all methods and functions should be type hinted. The resulting annotations may eventually be used to enforce type checking of arguments using a decorator, and even later on may be useful ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Software Architecture with Python

Software Architecture with Python

Anand Balachandran Pillai
Data Structures and Algorithms in Python

Data Structures and Algorithms in Python

Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser

Publisher Resources

ISBN: 9781788622011Supplemental Content