Staging
v0.8.1
https://github.com/python/cpython
Revision 25786c0851da8665bdbba948ddb16b23a040bbb2 authored by Tim Peters on 02 September 2001, 08:22:48 UTC, committed by Tim Peters on 02 September 2001, 08:22:48 UTC
mapping object", in the same sense dict.update(x) requires of x (that x
has a keys() method and a getitem).
Questionable:  The other type constructors accept a keyword argument, so I
did that here too (e.g., dictionary(mapping={1:2}) works).  But type_call
doesn't pass the keyword args to the tp_new slot (it passes NULL), it only
passes them to the tp_init slot, so getting at them required adding a
tp_init slot to dicts.  Looks like that makes the normal case (i.e., no
args at all) a little slower (the time it takes to call dict.tp_init and
have it figure out there's nothing to do).
1 parent 1b8ca0d
History
Tip revision: 25786c0851da8665bdbba948ddb16b23a040bbb2 authored by Tim Peters on 02 September 2001, 08:22:48 UTC
Make dictionary() a real constructor. Accepts at most one argument, "a
Tip revision: 25786c0
File Mode Size
Demo
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
Parser
Python
RISCOS
Tools
.cvsignore -rw-r--r-- 109 bytes
.hgtags -rw-r--r-- 2.1 KB
LICENSE -rw-r--r-- 12.0 KB
Makefile.pre.in -rw-r--r-- 25.4 KB
PLAN.txt -rw-r--r-- 12.2 KB
README -rw-r--r-- 38.1 KB
acconfig.h -rw-r--r-- 6.8 KB
configure -rwxr-xr-x 198.1 KB
configure.in -rw-r--r-- 47.0 KB
install-sh -rwxr-xr-x 5.5 KB
pyconfig.h.in -rw-r--r-- 18.3 KB
setup.py -rw-r--r-- 29.6 KB

README

back to top