The following code only prints "good". Why the generator function is not executed?
I noticed with pdb that after executing 'handlers1' the script reaches the line with f1's definition but then does not get inside the function. Conversely, it's returned 'GeneratorExit: None'.

class foo:

   def f0(self, s):
      print s

   def f1(self, s):
      print "not " + s
      yield 1

   def run(self):
      handlers={0 : self.f0, 1 : self.f1}
      handlers[0]('good')
      handlers[1]('good')

bar = foo()
bar.run()


Why this happens? Is it possible to call generator functions in a similar dynamic way?


Question: Visual Studio profiler not finding symbols when I run it in Azure
Answer: Sorry I didn't see this earlier. Basically the issue is that when your app is profiled, many of the binaries are ngened. Because of this, the system cannot interpret the function addresses without the correct pdb hence you see Hex. You will need to generate the ngen pdb on the same machine where the ngenbinary exist (see http://blogs.msdn.com/b/visualstudioalm/archive/2012/12/10/creating-ngen-pdbs-for-profiling-reports.aspx ). That should take care of most of the binaries listed as *.ni.dll . As for your own application, setting the Symbol location in Visual Studio should be sufficient to locate the symbols for your own application. Hope this helps