From the docs:
  Each occurrence of a name in the program text refers to the binding of
  that name established in the innermost function block containing the
  use.
It means that unless you declare it global or nonlocal (nested functions) then myvar is a local variable or a free variable (if myvar is not defined in the function).
The book is incorrect. Within the same block the name represents the same variable (local variable myvar in your example, you can't use it until you define it even if there is a global variable with the same name). Also you can change values outside a function i.e., the text at the end of page 65 is also incorrect. The following works:
def funky(): # local
    myvar = 20 
    print(myvar) # -> 20
myvar = 10 # global and/or local (outside funky())
funky()
print(myvar) # -> 10 (note: the same)
 
def funky(): # global
    global myvar
    print(myvar) # -> 10
    myvar = 20
myvar = 10
funky() 
print(myvar) # -> 20 (note: changed)
 
def funky(): # free (global if funky is not nested inside an outer function)
    print(myvar) # -> 10
myvar = 10
funky() 
 
def outer():
    def funky():  # nonlocal
        nonlocal myvar
        print(myvar) # -> 5
        myvar = 20
    myvar = 5 # local
    funky()
    print(myvar) # -> 20 (note: changed)
outer()
     
    
global myvarat the start of the function if you want to treat it as a global variable. If you ever assign tomyvarin the function (as you do in the linemyvar = 20), Python assumes it is a local variable and thinks you are referring to it before it is defined.globalnew in Python 3.3 since that book didn't mention it?globalhas been around for a while. Are you sure that the book wasn't giving this as an example of code that didn't work?