summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1993-11-05 10:18:44 (GMT)
committerGuido van Rossum <guido@python.org>1993-11-05 10:18:44 (GMT)
commit4199facacd002fdaa2aa9c00d3bc81f9b8569862 (patch)
tree59b9e00b2773130a636f683a6c00c09a82110bf0 /Objects
parent32be3a7a88fd2aae37cdd250f547c0687312c152 (diff)
downloadcpython-4199facacd002fdaa2aa9c00d3bc81f9b8569862.zip
cpython-4199facacd002fdaa2aa9c00d3bc81f9b8569862.tar.gz
cpython-4199facacd002fdaa2aa9c00d3bc81f9b8569862.tar.bz2
Added getmappingsize(). (Needed by previous checkin of posixmodule.c)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/dictobject.c11
-rw-r--r--Objects/mappingobject.c11
2 files changed, 22 insertions, 0 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 2a51d51..b89b7b2 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -566,6 +566,17 @@ mapping_items(mp, args)
return v;
}
+int
+getmappingsize(mp)
+ object *mp;
+{
+ if (mp == NULL || !is_mappingobject(mp)) {
+ err_badcall();
+ return NULL;
+ }
+ return ((mappingobject *)mp)->ma_used;
+}
+
object *
getmappingkeys(mp)
object *mp;
diff --git a/Objects/mappingobject.c b/Objects/mappingobject.c
index 2a51d51..b89b7b2 100644
--- a/Objects/mappingobject.c
+++ b/Objects/mappingobject.c
@@ -566,6 +566,17 @@ mapping_items(mp, args)
return v;
}
+int
+getmappingsize(mp)
+ object *mp;
+{
+ if (mp == NULL || !is_mappingobject(mp)) {
+ err_badcall();
+ return NULL;
+ }
+ return ((mappingobject *)mp)->ma_used;
+}
+
object *
getmappingkeys(mp)
object *mp;