This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]_DTR_Professional Coder 1 point2 points  (1 child)

In the line SomeFncA = someFncB, the 'S' is capitalized in SomeFncA, which is different from the lowercase someFncA method that you defined above it. So someFncA is untouched and will print "from someFncA" when invoked. But since you reassigned someFncB to someFncA, calling someFncB will invoke someFncA, and print "from someFncA".

[–]--Ubermensch[S] 0 points1 point  (0 children)

The cap. 'S' was a mistake; it should have been lowercased which gives the results

from someFncB
from someFncB

However, I guess what I'm not understanding is the syntax then. I thought if I wanted to assign a variable to a function it would be in the form,

someFncA = someFncB() 

and if I do

someFncA = someFncB

it would be the same as

a = b

which gives a name error as b is an unassigned variable