importmagic
importmagic copied to clipboard
from datetime import datetime is never given for datetime
I narrowed it down to the fixup method but no real succes in fixing it, except from not calling the method when the symbol is in the path https://github.com/alecthomas/importmagic/compare/master...paradoxxxzero:master but this seems hackish and would not work for module in module in module all with the same name...
Any thoughts?
Can you check your index to see if that symbol is available?
Yes it is, all works fine until the fixup method removes the variable
because it's the same as the module, which is what we want for
datetime.datetime
but not for datetime
.
In both of these cases, the fixup method is called twice, once with
datetime
, None and once with datetime
, datetime
. However it always
returns datetime
, None which is wrong for the latter case.
I hope I'm being clear enough :)
Btw Thanks for this awesome project, that I now use daily in http://github.com/Kozea/wdb and Atom https://github.com/paradoxxxzero/atom-python-import-magic
Le sam. 17 sept. 2016 à 09:24, Alec Thomas [email protected] a écrit :
Can you check your index to see if that symbol is available?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alecthomas/importmagic/issues/41#issuecomment-247754928, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQjKEcsd_7zq23B1YoJWDJsVO0KBgb8ks5qq5WkgaJpZM4J_Gyf .
Ran into the same issue today with pprint.pprint
, which I normally import as
from pprint import pprint
Possibly related: For sin
, the completing from numpy.ma.core import sin
is offered, but not the more sensible from numpy import sin
.