[Tutor] Is the use of -> usual in Python?

Phil phillor9 at gmail.com
Wed Feb 3 19:25:12 EST 2021


|The following is a snippet from a class that I came across yesterday. 
I'm not familiar with the use of "->" in Python code. Is it usual 
practice? Nothing showed up during an Internet search. |
||def receive(self) -> str: line = 
self.serial.read_until(self.TERMINATOR) return 
line.decode('UTF8').strip() def send(self, text: str) -> bool: line = 
'%s\r\f' % text self.serial.write(line.encode('|UTF8'))|# the line 
should be echoed. # If it isn't, something is wrong. return text == 
self.receive() | |-- 
Regards,
Phil



More information about the Tutor mailing list