Understanding python import of gevent
Question: This fails for me:

    
    
    import gevent
    gevent.monkey.patch_all()
    

This works:

    
    
    from gevent import monkey
    monkey.patch_all()
    

Is there anything wrong I am trying to do by accessing gevent.monkey

Also, I am confused on this snippet:

    
    
    import gevent as ge
    from gevent import monkey
    ge.monkey.patch_all()
    

what makes ge.monkey accessible now? if I comment from gevent import monkey,
this doesn't work. I have used

    
    
    import datetime
    datetime.datetime.now()
    

which works perfectly fine but monkey doesn't.


Answer: `monkey` is a _module_ inside the `gevent` module.

`datetime` is a _class_ inside the `datetime` module.

When you `import x`, all of `x`'s objects are imported (in the `x` namespace).
_But child modules are not imported_

While your top and bottom examples look identical, the type of object makes
all the difference.

