yade.utils module

Asked by procrastinator on 2019-08-15

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:
procrastinator
Solved:
2019-08-15
Last query:
2019-08-15
Last reply:
2019-08-15
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

Hi Jan,

Can I say these two are interchangeable?

best,

Yong

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 :-)

Hi Jan,

thank you very much. You helped me a lot.

best,
Yong