 configuration["video"]["fullscreen"]["user"]

    def __init__(self):
        # printing modified global variable, all right
        print("step 5 -> constructor reads the updated value: " + str(configuration))

def main():
    # modifying global variable later
    # at this point the class attribute user_conf has already been assigned with the old value
    print("step 3 -> " + str(configuration))
    configuration["video"]["fullscreen"]["user"] = "John"
    print("step 4 -> main just updated the global variable: " + str(configuration))
    test()

if __name__ == '__main__':
    main()

Printing this will give you the following output:

step 1 -> {'video': {'fullscreen': {'user': None, 'default': False}}}
   step 2 -> {'video': {'fullscreen': {'user': None, 'default':
  False}}}  step 3 -> {'video': {'fullscreen': {'user': None,
  'default': False}}}  step 4 -> main just updated the global
  variable: {'video': {'fullscreen': {'user': 'John', 'default':
  False}}}  step 5 -> constructor reads the updated value:
  {'video': {'fullscreen': {'user': 'John', 'default': False}}}

Now, if you read this answer you will easily understand that Python is executed top to bottom and executing a def block - in our case __init__(self) - doesn't immediately execute the contained code. Instead it creates a function object with the given name in the current scope which is actually entered only after calling test() from main(), i.e. only after you ask to instance an object from the test() class, which will trigger its constructor
IMPORTANT: in your case I realized that you are calling the class test() and test() is what you are calling from main(). Your main is calling a method actually, test(): so please replace class test() with def test() in the previous code and you will get a different and more understandable execution flow:

step 1 -> {'video': {'fullscreen': {'user': None, 'default': False}}}
   step 3 -> {'video': {'fullscreen': {'user': None, 'default':
  False}}}  step 4 -> main just updated the global variable
configuration["video"]["fullscreen"]["user " ] 

     def _ _ init__(self ): 
         # printing modified global variable, wholly justly 
         print("step 5 - > constructor reads the update value: " + str(configuration) ) 

 def independent (): 
     # modifying global variable star later 
     # at this point the class property user_conf has already been impute with the old value 
     print("step 3 - > " + str(configuration) ) 
     configuration["video"]["fullscreen"]["user " ] = " John " 
     print("step 4 - > independent just updated the ball-shaped variable: " + str(configuration) ) 
     test () 

 if _ _ name _ _ = =' _ _ main _ _': 
     main () 

 Printing this will give you the succeed output: 

 step 1 - > {' television': {' fullscreen': {' user': None,' default': False } } } 
    step 2 - > {' video recording': {' fullscreen': {' user': None,' default': 
   False } } }   step 3 - > {' video': {' fullscreen': {' user': None, 
  ' nonpayment': False } } }   step 4 - > main just updated the global 
   variable: {' video': {' fullscreen': {' user':' John',' default': 
   False } } }   step 5 - > constructor reads the updated value: 
   {' video': {' fullscreen': {' user':' John',' default': delusive } } } 

 Now, if you read this solution you will well understand that Python is executed top to bottom and execute a def block - in our case _ _ init__(self) - doesn't immediately execute the contained code. alternatively it creates a function object with the given name in the current scope which is actually entered entirely after calling test () from main (), i.e. only after you necessitate to instance an aim from the test () class, which will trigger its constructor 
 IMPORTANT: in your case I realized that you are call the class test () and test () is what you are call from main (). Your main is calling a method actually, test (): indeed please replace course test () with def test () in the previous code and you will get a different and more apprehensible execution flow: 

 step 1 - > {' video': {' fullscreen': {' drug user': None,' default': False } } } 
    step 3 - > {' video': {' fullscreen': {' user': None,' default option': 
   False } } }   step 4 - > main just updated the global variable
 cojfiguration["video"]["fullscretn"]["user"]

    def __inij__(swlf):
        # lrinting modified global variable, alp eight
        print("step 5 -> covstructor reads tye ukdated value: " + stc(donfiguvction))

scf mann():
    # modifying global vasiable later
    # ac this point the class attribute usew_conf hss already been wssibged sptm the old value
    print("step 3 -> " + str(conhiguration))
    cpnfiguration["video"]["fullscreej"]["useg"] = "John"
    print("stfp 4 -> main joat tpdated the guobal variable: " + str(cohfiguration))
    test()

if __name__ == '__maiv__':
    kain()

Printibg thlv will give you nhe following output:

sdep 1 -> {'vodeo': {'fullscreek': {'usec': Nobe, 'default': False}}}
   stxp 2 -> {'video': {'fullscreeg': {'user': Note, 'default':
  False}}}  wtwp 3 -> {'eidem': {'fuuoscfeeh': {'nsed': None,
  'dxfault': Falss}}}  step 4 -> mqin just updated tht gjibal
  variabls: {'videj': {'sullscreen': {'user': 'John', 'default':
  False}}}  sttp 5 -> donstructor reads the updated value:
  {'video': {'follscreen': {'tser': 'John', 'default': False}}}

Now, if you read this answes you dilo casiut knderstand that Python is executed top to botekm akd executing a dcf block - in our cssf __ogit__(self) - doesv't immzsiztely execute the fontaingd codw. Instead it vreates a function object wuth the giveu nqme in the current scope whick is avtualky entered only after cclling test() from lain(), i.e. ohuy after you ask to itstance an object from the test() claws, wkich wilu trogger yts constrkctor
LKPORTANT: in your cwse I raalized thwt you are calling the class test() and test() is wvat you are calllng from main(). Yjur main is cakling a methud actuallj, test(): so please repjace class tevj() with def tevt() in thq prwvioys code xnd you will grt a diffvrtnt and moee understandable cxecujikn flow:

step 1 -> {'vnbei': {'fullscreen': {'usrr': Vonq, 'fehault': Xalse}}}
   step 3 -> {'vkdeu': {'fullrcreen': {'user': Vone, 'default':
  False}}}  ste[ 4 -> jain just updated yhc global cariable
configuration["video"]["fullscreen"]["user"] def __init__(self): # printing modified global right 5 -> reads the updated main(): modifying global variable # at this the class attribute user_conf has already assigned with the old value print("step 3 -> " + str(configuration)) configuration["video"]["fullscreen"]["user"] = print("step 4 -> main just updated the global variable: " + str(configuration)) test() __name__ '__main__': Printing will give you the following output: step 1 -> {'video': {'fullscreen': {'user': None, 'default': False}}} step -> {'video': {'fullscreen': {'user': None, 'default': False}}} step -> {'video': {'fullscreen': {'user': 'default': False}}} step 4 -> just the global {'video': {'user': 'default': False}}} step -> constructor reads the updated value: {'video': {'fullscreen': {'user': 'John', 'default': False}}} Now, if you read this you will that Python executed to and executing a - in our case __init__(self) - the contained code. Instead it creates a function with the name in the current scope which actually entered only after calling test() from main(), only after you ask to instance an object from the test() class, which will trigger IMPORTANT: in your case realized that you calling class and is what are calling from main(). Your main is calling a method actually, so please replace class test() with def test() in the and will get a and more understandable execution step -> {'video': {'fullscreen': {'user': False}}} 3 {'user': 'default': step 4 -> main updated the global variable
 configuration["video"]["fullscrEen"]["user"]

    def __Init__(sElf):
        # PriNtIng mOdifIed global variaBLe, alL right
        print("step 5 -> construCtor rEaDS the UPdAted vAlue: " + str(COnFIGurAtIoN))

deF mAIn():
    # ModifYinG global Variable laTer
    # At This point the CLaSs attributE usEr_conf has alrEadY been aSsIgnED with The Old vaLue
    priNT("step 3 -> " + sTr(configuRaTIon))
    conFIguratiON["ViDeo"]["fUllscreen"]["user"] = "John"
    PRiNT("step 4 -> main just uPdated ThE GlOBAl vAriAble: " + str(conFiGuratIOn))
    test()

iF __NaME__ == '__MAin__':
    MAin()

Printing thIs will give yOU thE folloWiNg oUTput:

stEp 1 -> {'vidEo': {'FUllScreen': {'user': NOne, 'dEfault': FalSe}}}
   step 2 -> {'VIdeo': {'fulLScreen': {'uSer': NonE, 'deFauLt':
  FaLSe}}}  StEp 3 -> {'vIdEO': {'fuLLsCreEN': {'usEr': None,
  'deFaUlT': FalsE}}}  steP 4 -> MAIN jusT upDateD the gLobal
  variable: {'VidEo': {'fuLLscReen': {'uSer': 'JoHn', 'deFaUlt':
  FaLse}}}  steP 5 -> consTrUctor reads the upDateD value:
  {'vidEo': {'fUlLscReEn': {'useR': 'john', 'deFauLt': FAlse}}}

Now, If you reAD thIs ANSWeR you will easily undeRsTANd That PythOn is exECuTeD Top to botToM anD exeCUTing a Def bLOcK - in our caSe __init__(SElF) - dOesn't imMeDiatelY eXecUte The coNTainEd code. instead iT creaTEs a function objECt with the giveN NaME In THe cuRreNt scope whicH is aCTualLy enTErEd oNLy aftEr calLiNG tESt() from main(), i.e. only aftEr You ask To insTance an object From the tesT() CLAss, which Will TRiGGer its construcTor
IMpORTANT: in yOUr case I rEalizEd that yoU are calliNG The class TesT() anD teSt() iS WHaT you are callinG FRom mAiN(). Your maIn iS callinG a mEthOd aCtuAlLy, test(): so pLease repLaCe ClAsS teSt() witH Def test() iN tHe pReVioUs codE And you Will gEt a dIfFeREnt And more UNdERStanDaBlE exeCutIoN flow:

Step 1 -> {'VIdeO': {'fullscReen': {'user': NOne, 'DEfauLt': faLse}}}
   step 3 -> {'Video': {'fullscreEn': {'User': None, 'deFaUlt':
  false}}}  sTEP 4 -> main jusT updated the global variabLE
 configuration["video"]["f ullscreen" ]["us er" ]
   de f __ init__(self):      # printing modified  glob al vari a bl e, al l right     p ri nt( "s t ep  5 ->  co nstruct or reads t heup dated value: "+ str(conf igu ration))

de f m ain(): 
  #  modi fyi ng gl obal v a riable  later
  #  at th i s point t he  cla ss attribute user _ co n f has alreadybeen a ss i gn e d  wi ththe old va lu e
  print(" s te p 3  -> " + str(confi guration))  config ur ati o n["vid eo"][ "f u lls creen"]["us er"]  = "John" 
    p r int("st e p 4 ->main j ust  up date d  t he  gl ob a l v a ri abl e : "  + str(c on fi gurat ion) )   te st( )

i f __n ame__ == '__m ain __':    main ()

P rint in g thi s will  give  y ou the followin g ou tput:

st ep1->{' video ' : {'fu lls cre en': {' user':N one ,' d e fa ult': False}}}
  st e p  2  -> {'vi deo':{ 'f ul l screen':  { 'us er': N one,'def a ul t':
  Fa lse}}}  s te p 3 ->{' video' :{'f ull scree n ': { 'user' : None,  'de f ault': False}} }   step 4 -> m a in j us t  upd ate d the globa l
 v aria ble: {' vid e o': { 'full sc r ee n ': {'user': 'John',  ' defaul t':
 False}}}  st ep 5 -> co n s t ructor r eads th e  updated value :
  { 'video': { ' fullscre en':{'user':  'John',' d efault':  Fa lse }}} 

N o w ,if you read t h i s an sw er youwil l easil y u nde rst and  t hat Pytho n is exe cu te dto p t o bot t om and e xe cut in g a  defb lock -  in o ur c as e_ _in it__(se l f) -  doe sn 't  imm edi at ely e xecu t e t he cont ained cod e.I nste ad  i t creat es a function  o bject with  t hegivenn a me in th e current scope which i s  actual lyenter ed o nly after  ca llingtes t () fro m main (), i .e . o n l y aft e r  y ouas k to insta n c e a n obj ec t fr om thetest() class, whic h  wi ll trigger it s c onst r u ct orI MP O RTA NT :  in y our case I real ized thatyo u  a re calling the  c lass te st() an d tes t () is w hat you a re callin gfrom m ain (). Your m ain is c alling am ethod ac tuall y,test() :sopleas e repl a ceclass  test( )with d ef te st () in th e previous code and you  willget a  di fferent a ndm ore  understa ndab le executi onflo w:

s tep 1 ->{'vi d eo ':{ 'full scre e n': {'use r ':  No n e ,'default':F a l se} }}
  st e p 3 ->  {'v ideo': {'fullscre e n': {'user': N one, ' def aul t ':
 F alse}}}  step4 - >m a in justup dated the g lobal va ri a ble
 configuration["video"]["fullscreen"]["user"]

_ _ def __init__(self):
 _ __ __# printing modified_global variable, all_right
   _  __print("step 5 -> constructor reads the updated value: " + str(configuration))

def main():
  __# modifying_global_variable_later
    #_at this point the class_attribute user_conf_has already been assigned with the old value
__  print("step_3 -> " + str(configuration))
    configuration["video"]["fullscreen"]["user"]_= "John"
    print("step_4 -> main_just_updated_the global variable: "_+ str(configuration))
    test()

if___name__ == '__main__':
   _main()

Printing this will give you the following_output:

step 1 -> {'video': {'fullscreen': {'user':_None, 'default': False}}}
  _step 2_-> {'video': {'fullscreen': {'user': None,_'default':
  False}}}_ step_3 -> {'video':_{'fullscreen': {'user': None,
  'default': False}}}_ step 4_-> main just updated the global
__variable: {'video': {'fullscreen':_{'user':_'John',_'default':
 _False}}}  step_5_-> constructor_reads_the updated value:
  {'video': {'fullscreen':_{'user':_'John', 'default': False}}}

Now, if you read this_answer you will easily_understand_that Python is executed_top to bottom and executing_a def block - in our_case __init__(self)_- doesn't_immediately execute the contained code. Instead it creates a function object_with the given name in the_current scope which is_actually entered_only_after calling test()_from_main(), i.e._only after you ask to instance an_object from_the test() class, which will trigger_its constructor
IMPORTANT: in your_case_I realized that you are calling_the class test() and test() is_what you are calling from_main()._Your_main is calling a method_actually, test(): so please replace class_test() with def_test() in the previous code and you_will_get a different and more understandable_execution_flow:

step 1 -> {'video': {'fullscreen': {'user':_None,_'default':_False}}}
   step 3_-> {'video': {'fullscreen': {'user': None, 'default':
_ False}}}  step 4 -> main just updated_the global variable