def is_device(self): mode = os.lstat(self._name).st_mode return stat.S_ISCHR(mode) or stat.S_ISBLK(mode)