فهرست منبع

add closed property

zhzhenqin 9 سال پیش
والد
کامیت
12f53e6a32
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      python/IntHeaderProtobufFile.py

+ 3 - 1
python/IntHeaderProtobufFile.py

@@ -62,10 +62,12 @@ class Writer(object):
 
     def close(self):
         self.f.close()
-       
+    
     def isclosed(self):
         return self.f.closed
 
+    closed = property(isclosed)
+
     def __exit__(self, exc_type, exc_val, exc_tb):
         self.close()