Eric Nieuwland wrote: > This is linear. No looping whatsoever. And easily translated to a > simple language construct and a protocol: > > class resource(object): > def __init__(self,...): > # store resource parameters > def __acquire__(self): > # whatever it takes to grab the resource > def __release__(self): > # free the resource I wanted to see what the examples in PEP340 would look like written with standard class's using object inheritance and overriding to define resource managers. If anyone's interested I can post it. My block class is non-looping as I found in most cases looping isn't required, and looping complicates things because you have to pass around a loop expression due to not all loops will want to behave that same way. The solution was to put the loop in the body method and call a repeat_body method (the repeated body section) which is added to the class when needed. Ron_Adam
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