+ 3

HELP plz , python class & function

I saw this example but I don't know how the function would work!! my problem is in this line : def send(self, data: bytes) -> bytes: could somebody explain what happens in this function??(spatially in this part: "data: bytes) -> bytes:") class CommunicationChannel(object): def __init__(self, args): self.args = args def send(self, data: bytes) -> bytes: raise NotImplementedError()

31st Aug 2017, 6:42 AM
hossein hayati
hossein hayati - avatar
2 Respostas
+ 3
okay I got it object is a parent for all of the python classes and ":" is to define input type and "->" is to define the output type
31st Aug 2017, 7:01 AM
hossein hayati
hossein hayati - avatar
+ 5
Yes
31st Aug 2017, 7:03 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar