RFC: addCleanup should take *args and **kwargs?

Aaron Bentley aaron.bentley at utoronto.ca
Fri Apr 13 14:05:01 BST 2007


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

Vincent Ladeuil wrote:
>>>>>> "robert" == Robert Collins <robertc at robertcollins.net> writes:
> 
>     robert> On Fri, 2007-04-13 at 08:03 +0200, Vincent Ladeuil wrote:
>     >> 
>     >> +1, as long as we take care of checking the presence of the
>     >> callable *and* its (*args, **kwargs) 
> 
>     robert> What do you mean by this?
>  
> addCleanup checks that callable is not already in the cleanup
> list, if we use the same callable for different parameters, it
> should still be added, not rejected as a dupe.
> 
> Nit-picking, better safe than sorry, etc :)

I don't think you can predict that

1. If a programmer mistakently adds a cleanup twice, that this fix will
catch it
2. If a programmer adds a cleanup twice, it is a mistake.

So I don't think this is a good idea.  If double-adding a cleanup causes
an error, the programmer will see this and fix it.  If it is not an
error, it should not be forbidden.

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

iD8DBQFGH3/90F+nu1YWqI0RAvcUAJ96JXQWCChatP8znizHEHr24gxJwgCggmFC
6FDBYSAVhBJ+ou8em687uZ0=
=NvKH
-----END PGP SIGNATURE-----



More information about the bazaar mailing list