This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2014年03月31日 14:30 by ZealotuS, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg215241 - (view) | Author: Lotus Qin (ZealotuS) | Date: 2014年03月31日 14:30 | |
function in urllib.request.build_opener() def isclass(obj): return isinstance(obj, type) or hasattr(obj, "__bases__") should it be `obj` or `obj.__class__`? cause in the man of 3.4, there is only `class.__bases__`, but the code there may function like `instance.__bases__`. ======= # my code behave like this: cookie = http.cookiejar.CookieJar() cookie_handler = urllib.request.HTTPCookieProcessor(cookie) opener = urllib.request.build_opener(cookie_handler) # the variable `skip` in `build_opener` will be empty cause `isclass(obj)` always return false. cookie_handler.__bases__ AttributeError: 'HTTPCookieProcessor' object has no attribute '__bases__' cookie_handler.__class__.__bases__ (<class 'urllib.request.BaseHandler'>,) |
|||
| msg215304 - (view) | Author: Lotus Qin (ZealotuS) | Date: 2014年04月01日 10:06 | |
get the __doc__ in a wrong way, it works now. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:01 | admin | set | github: 65312 |
| 2014年04月01日 10:06:41 | ZealotuS | set | status: open -> closed resolution: not a bug messages: + msg215304 |
| 2014年03月31日 14:31:33 | ZealotuS | set | title: Error usage of class.__bases__() -> Error usage of class.__bases__ |
| 2014年03月31日 14:30:34 | ZealotuS | create | |