]> arthur.barton.de Git - bup.git/commitdiff
stat_result: specify __slots__
authorRob Browning <rlb@defaultvalue.org>
Sun, 14 Aug 2022 18:29:59 +0000 (13:29 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 14 Aug 2022 19:08:57 +0000 (14:08 -0500)
We're likely to have a lot of these, so might as well save the memory.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/xstat.py

index b334ffdee09ca1600fdf3e44cf62328294b4fe92..a0941294202864931e5e013318845aad1916d391 100644 (file)
@@ -102,6 +102,8 @@ def _fix_cygwin_id(id):
 
 
 class stat_result:
+    __slots__ = ('st_mode', 'st_ino', 'st_dev', 'st_nlink', 'st_uid', 'st_gid',
+                 'st_rdev', 'st_size', 'st_atime', 'st_mtime', 'st_ctime')
     @staticmethod
     def from_xstat_rep(st):
         global _cygwin_sys