If the current node is a map, return the number of child elements, otherwise return 0. Key value pairs can be accessed by entering the map. >>> count = data.get_map() >>> data.enter() >>> for i in range(count/2): ... type =
(self)
| 1135 | return pn_data_get_list(self._data) |
| 1136 | |
| 1137 | def get_map(self) -> int: |
| 1138 | """ |
| 1139 | If the current node is a map, return the number of child elements, |
| 1140 | otherwise return 0. Key value pairs can be accessed by entering |
| 1141 | the map. |
| 1142 | |
| 1143 | >>> count = data.get_map() |
| 1144 | >>> data.enter() |
| 1145 | >>> for i in range(count/2): |
| 1146 | ... type = data.next() |
| 1147 | ... if type == Data.STRING: |
| 1148 | ... print data.get_string() |
| 1149 | ... elif type == ...: |
| 1150 | ... ... |
| 1151 | >>> data.exit() |
| 1152 | |
| 1153 | :return: the number of child elements of a map node |
| 1154 | """ |
| 1155 | return pn_data_get_map(self._data) |
| 1156 | |
| 1157 | def get_array(self) -> Tuple[int, bool, Optional[int]]: |
| 1158 | """ |