Apr-14-2019, 03:06 AM
when i do:
but if i do:
i am curious what is going on here. the reference manual (for 3.5) does not say what is going on although it does show a couple examples with attribute names on import statements, without explaining it.
how can i make my module do the same thing? why would i (or anyone) want to? or why should i not do this?
is there a way to get botocore.session if only botocore was imported, since the list of attributes does not have session in the latter case?
import botocore.session my_session = botocore.session.get_session()it works OK.
but if i do:
import botocore my_session = botocore.session.get_session()then it fails, saying that botocore has no attribute named session.
i am curious what is going on here. the reference manual (for 3.5) does not say what is going on although it does show a couple examples with attribute names on import statements, without explaining it.
how can i make my module do the same thing? why would i (or anyone) want to? or why should i not do this?
is there a way to get botocore.session if only botocore was imported, since the list of attributes does not have session in the latter case?
Output:lt2a/forums /home/forums 1> py3
Python 3.5.2 (default, Nov 12 2018, 13:43:14)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import botocore.session
>>> 'session' in dir(botocore)
True
>>>
lt2a/forums /home/forums 2> py3
Python 3.5.2 (default, Nov 12 2018, 13:43:14)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import botocore
>>> 'session' in dir(botocore)
False
>>>
lt2a/forums /home/forums 3>
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.