News for hackers. Stuff that matters.
Re:Recharging the Python standard library by viraptor on Friday October 11, 2013 @11:43AM (#6533828)
Yeah, not the best example I think. This code is not bad at all:

    filepath = os.path.join('.', 'test_dirs)
    os.makedirs(filepath)
    with open(os.path.join(filepath, 'test.txt'), 'w') as f:
        f.write('hello world')
And it's actually obvious what happens with the file handle after write. I'm not sure if it's still open or not at the end of his example really. I wouldn't be surprised by his example in ruby code (overloading with magic functionality), but in python that just looks weird...

There are no comments on this comment yet.