summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
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;