From: "Oren Tirosh" <oren-py-d@hishome.net> > > 2) Without the ability to define a scope at will, RAiI becomes less useful. > > local f=open('sdaskdfjhaslk') > ... > del l > > Deleting this kind of variable (whether we call it local or something > else) means you want its __del__ executed now. It is also an assertion > that its reference count is supposed to be 1 at this point. This not only > gives you the ability to define a scope at will, it lets you create > scopes dynamically. It's probably useful for more than just RAiI. Perhaps > too useful. it is not about variables, it is about objects, too much fragile magic local f=open('sdaskdfjhaslk') w = f.write w(...) del f # ???
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4