##// END OF EJS Templates
Apply pyupgrade to IPython/extensions/autoreload.py...
Spas Kalaydzhisyki -
Show More
@@ -384,11 +384,23 b' class StrongRef:'
384 384 return self.obj
385 385
386 386
387 mod_attrs = [
388 "__name__",
389 "__doc__",
390 "__package__",
391 "__loader__",
392 "__spec__",
393 "__file__",
394 "__cached__",
395 "__builtins__"
396 ]
397
398
387 399 def append_obj(module, d, name, obj, autoload=False):
388 400 not_in_mod = not hasattr(obj, "__module__") or obj.__module__ != module.__name__
389 401 if autoload:
390 # check needed for module global built-ins (int, str, dict,..)
391 if name.startswith("__") and not_in_mod:
402 # check needed for module global built-ins
403 if not_in_mod and name in mod_attrs:
392 404 return False
393 405 else:
394 406 if not_in_mod:
General Comments 0
You need to be logged in to leave comments. Login now