Python import X or from X import Y? (performance)

前端 未结 4 1379
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-30 03:39

If there is a library from which I\'m going to use at least two methods, is there any difference in performance or memory usage between the following?

from X         


        
4条回答
  •  甜味超标
    2020-11-30 04:30

    I don't believe there's any real difference, and generally worrying about that little amount of memory isn't typically worth it. If you're going to be pressing memory considerations, it will far more likely be in your code.

提交回复
热议问题