2019-05-20 | Paul Boddie | raw annotate files changeset graph | Experiment with a temporary attribute on objects. This attribute must be cleared when assignments occur, but it should also be cleared when objects escape from functions (which is not yet done). Since the motivation for marking objects as temporary is their re-use in certain operations, the objective is to avoid objects being used in multiple places and still being marked as temporary and potentially undergoing re-use/mutation. Perhaps the only way of guaranteeing exclusive access to an object is if it is provided as a function result and is immediately passed to a function or operation, with this function either mutating the object or ensuring its direct propagation to another such function. | temporary-object-experiment |
1 #!/usr/bin/env python 2 3 def access(path, mode): pass 4 def chdir(path): pass 5 def chmod(path, mode): pass 6 def chown(path, uid, gid): pass 7 def lchown(path, uid, gid): pass 8 def link(src, dst): pass 9 def listdir(path): pass 10 def lstat(path): pass 11 def major(device): pass 12 def makedev(major, minor): pass 13 def minor(device): pass 14 def mkdir(path, mode=0777): pass 15 def mkfifo(filename, mode=0666): pass 16 def mknod(filename, mode=0600, device=None): pass 17 def readlink(path): pass 18 def remove(path): pass 19 def rename(old, new): pass 20 def rmdir(path): pass 21 def symlink(src, dst): pass 22 def unlink(path): pass 23 def utime(path, (atime, mtime)): pass 24 25 F_OK = 0 26 R_OK = 4 27 W_OK = 2 28 X_OK = 1 29 30 # vim: tabstop=4 expandtab shiftwidth=4