← Back to team overview

launchpad-dev team mailing list archive

Re: The with statement

 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bjorn Tillenius wrote:
> As I see it, the with statement is
> mainly useful wehre you have a well-known behaviour, where it's easy to
> find out what's going on (for example from the name), or when the
> clean-up step isn't important.

Why do you say "when the clean-up step isn't important"?

> This doesn't mean that we should avoid
> writing our own context managers at all cost, just that we should
> evaluate the benefit.

I agree, but a with statement that eliminates boilerplate code will
usually have sufficient benefit to me.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkty82cACgkQ0F+nu1YWqI2d9gCeMqGrS7luHeVZV8wPg6+mWSxH
aTYAni9olQHvQrqZMG0nHu0gms/xof20
=AvSw
-----END PGP SIGNATURE-----



References