()
| 148 | |
| 149 | |
| 150 | def gen_methods(): |
| 151 | types = [ |
| 152 | bool, |
| 153 | bytearray, |
| 154 | bytes, |
| 155 | complex, |
| 156 | dict, |
| 157 | enumerate, |
| 158 | filter, |
| 159 | float, |
| 160 | frozenset, |
| 161 | int, |
| 162 | list, |
| 163 | map, |
| 164 | memoryview, |
| 165 | range, |
| 166 | set, |
| 167 | slice, |
| 168 | str, |
| 169 | super, |
| 170 | tuple, |
| 171 | object, |
| 172 | zip, |
| 173 | classmethod, |
| 174 | staticmethod, |
| 175 | property, |
| 176 | Exception, |
| 177 | BaseException, |
| 178 | ] |
| 179 | objects = [t.__name__ for t in types] |
| 180 | objects.append("type(None)") |
| 181 | |
| 182 | iters = [ |
| 183 | "type(bytearray().__iter__())", |
| 184 | "type(bytes().__iter__())", |
| 185 | "type(dict().__iter__())", |
| 186 | "type(dict().values().__iter__())", |
| 187 | "type(dict().items().__iter__())", |
| 188 | "type(dict().values())", |
| 189 | "type(dict().items())", |
| 190 | "type(set().__iter__())", |
| 191 | "type(list().__iter__())", |
| 192 | "type(range(0).__iter__())", |
| 193 | "type(str().__iter__())", |
| 194 | "type(tuple().__iter__())", |
| 195 | "type(memoryview(bytearray(b'0')).__iter__())", |
| 196 | ] |
| 197 | |
| 198 | methods = {} |
| 199 | for typ_code in objects + iters: |
| 200 | typ = eval(typ_code) |
| 201 | attrs = [] |
| 202 | for attr in dir(typ): |
| 203 | # Skip attributes in dir() but not actually accessible (e.g., descriptor that raises) |
| 204 | if not hasattr(typ, attr): |
| 205 | continue |
| 206 | if attr_is_not_inherited(typ, attr): |
| 207 | attrs.append((attr, extra_info(getattr(typ, attr)))) |
no test coverage detected