Advertisement
Fhernd

clase_abstracta.py

Jan 6th, 2019
1,021
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. from abc import ABCMeta, abstractmethod
  2.  
  3.  
  4. class IStream(metaclass=ABCMeta):
  5.     @abstractmethod
  6.     def leer(self, bytes_maximos=-1):
  7.         pass
  8.  
  9.     @abstractmethod
  10.     def escribir(self, datos):
  11.         pass
  12.  
  13.  
  14. class SocketStream(IStream):
  15.     def leer(self, bytes_maximos=-1):
  16.         # Operaciones de lectura
  17.         pass
  18.  
  19.     def escribir(self, datos):
  20.         # Operaciones de escritura
  21.         pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement