yade.utils module

Asked by ytang

hi all,

Recently, I am reading the Yade documentation, I found that under Yade.utils module, there is some submodule like Yade.utils, while some others like Yade._utils. I just curious about what is the difference between these two types of submodule under the same Yade.utils module.

thanks

yong

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
ytang
Solved:
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hello,

yade._utils is a module compiled from C++ code from py/_utils.cpp
yade.utils is a module (py/utils.py) containing pure python stuff (and it also does "from yade._utils import *" so you can directly use code from yade._utils)

cheers
Jan

Revision history for this message
ytang (ytang116) said :
#2

Hi Jan,

Can I say these two are interchangeable?

best,

Yong

Revision history for this message
Jan Stránský (honzik) said :
#3

> Can I say these two are interchangeable?

No.
Why would they be?
Why would you want to say that?

yade.utils and yade._utils are two distinct python modules.

yade.utils imports everything from yade._utils, so you do not need to use yade._utils directly (all from yade._utils is accessible from yade.utils, but not vice versa).

cheers
Jan

PS: of course you can say it, but it is not true :-)

Revision history for this message
ytang (ytang116) said :
#4

Hi Jan,

thank you very much. You helped me a lot.

best,
Yong