[Python-Dev] quick poll: could int, str, tuple etc. become type objects?

Fred L. Drake, Jr. fdrake@acm.org
Tue, 5 Jun 2001 15:11:58 -0400 (EDT)

Finn Bock writes:
 > >>> from types import DictType as dict
 > >>> dict('a', 97, 'b', 98, 'c', 99)
 > {'b': 98, 'a': 97, 'c': 99}
 > >>>
 > This behaviour isn't documented on the python side so it can be changed.
 > However, it it is necessary to maintain this API on the java side and we
 > have currently no way to prevent the type constructors from being
 > visible and callable from python. 

  This should not be a problem:  If dict() is called with one arg, the
new semantics can be used, but with an odd number of args, your
existing semantics can be used.


Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Digital Creations