[Python-Dev] Re: heapq method names

Martin Sjögren md9ms@mdstud.chalmers.se
25 Aug 2002 16:50:14 +0200


--=-pbEfvDgzSA6SwGcsqAwx
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

s=C3=B6n 2002-08-25 klockan 14.04 skrev Fran=C3=A7ois Pinard:
> As for `push' etc. being too generic, there are used in the context of a
> specialised module, which gives these word there specialised meaning, so
> genericity is not a real argument.  Other modules already qualify simple
> words.  Has it been a problem?  Even, would it be that some people really
> want to write `from MODULE import *' or `from MODULE import SUCH-AND-SUCH=
'
> for a lot of modules at global scope, something which is not to be encour=
aged
> anyway, these users still have `from ... import ... as' to help them.
>=20
> Please consider altering the current `heapq' module so to _not_ invite a
> different importing style.  Make it more similar to the rest of the libra=
ry,
> there is probably no real need for a difference.  Let it be nicer to use!

I agree completely. And as for the names being too generic. Well, gee,
they *are* usually used for putting an element in the data structure,
removing an element from the data structure, et.c. Often regardless of
the data structure/ADT. I've always used push, pop (and peek et.c.) for
heaps, as well as stacks. If anything, I think that the pop method of
lists is confusing :-)


Regards,
Martin

--=-pbEfvDgzSA6SwGcsqAwx
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: Detta =?ISO-8859-1?Q?=E4r?= en digitalt signerad
	meddelandedel

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQA9aO6mGpBPiZwE9FYRAhsgAKCPxqMN8EPfNuHi3EzQF5gtlqD3DACfUyQ1
OlZqQmB6eXAH5801cZrhmyY=
=3ecC
-----END PGP SIGNATURE-----

--=-pbEfvDgzSA6SwGcsqAwx--