import pywikibot
import pywikibot.pagegenerators
from pprint import pprint
enwiki = pywikibot.Site(code="en", fam="wikipedia")
android_pages = pywikibot.pagegenerators.CategorizedPageGenerator(
    pywikibot.Category(enwiki, 'Category:Android (operating system)'), recurse = False)

pprint(list(android_pages))
print(len(android_pages))
[Page('Android (operating system)'),
 Page('.asec'),
 Page('Index of Android OS articles'),
 Page('List of features in Android'),
 Page('9Apps'),
 Page('17 (app)'),
 Page('Android Apps to convert Text To Speech'),
 Page('Android Auto'),
 Page('Android Beam'),
 Page('Android Cupcake'),
 Page('Android Developer Challenge'),
 Page('Android Donut'),
 Page('Android Eclair'),
 Page('Android Froyo'),
 Page('Android Gingerbread'),
 Page('Android Honeycomb'),
 Page('Android Ice Cream Sandwich'),
 Page('Android Jelly Bean'),
 Page('Android KitKat'),
 Page('Android lawn statues'),
 Page('Android Lollipop'),
 Page('Android Marshmallow'),
 Page('Android Nougat'),
 Page('Android One'),
 Page('Android Runtime'),
 Page('Android Tactical Assault Kit'),
 Page('Android TV'),
 Page('Android-x86'),
 Page('Androidland'),
 Page('Android application package'),
 Page('APUS Group'),
 Page('Baidu Yi'),
 Page('Bionic (software)'),
 Page('Irina Blok'),
 Page('BlueStacks'),
 Page('Color OS'),
 Page('CSR Classics'),
 Page('Dalvik (software)'),
 Page('Dalvik Turbo virtual machine'),
 Page('Daydream (Google)'),
 Page('Droid fonts'),
 Page('Matías Duarte'),
 Page('European Union vs. Google'),
 Page('Fire OS'),
 Page('Google Goggles'),
 Page('Google mobile services'),
 Page('Google Nexus'),
 Page('Google Play'),
 Page('Google Play Services'),
 Page('ICade'),
 Page('Intent (Android)'),
 Page('Comparison of Java and Android API'),
 Page('List of Android launchers'),
 Page('NDMC 311'),
 Page('Open Handset Alliance'),
 Page('OPhone'),
 Page('OxygenOS'),
 Page('Project Brillo'),
 Page('Remix OS'),
 Page('RenderScript'),
 Page('Roboto'),
 Page('Rooting (Android OS)'),
 Page('Scripting Layer for Android'),
 Page('Shoutr'),
 Page('Smartisan OS'),
 Page('Android software development'),
 Page('Stagefright (bug)'),
 Page('Todoist'),
 Page('Android version history'),
 Page('Android Wear'),
 Page('XDA Developers'),
 FilePage('File:Stagefright bug logo.png')]
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-6-faedca74f4cd> in <module>()
      7 
      8 pprint(list(android_pages))
----> 9 print(len(android_pages))

TypeError: object of type 'generator' has no len()