Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting an unexpected NameError in pycassaShell when invoking one function from another

I'm playing with pycassaShell (as part of the Cassandra and the Twissandra tutorial). When trying to add two functions inside the shell, and call one from the other I get an error that the Name is not recognized.

This is probably something very simple, but I did not find how to do this.

The pycassaShell looks like:

In [3]: def aaa(): print 5
In [4]: aaa()
5

In [5]: def bbb(): aaa()

In [6]: bbb()
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
...
NameError: global name 'aaa' is not defined
like image 916
eran Avatar asked Jul 19 '12 11:07

eran


1 Answers

This is an issue with the way Pycassa is embedding IPython. This is the same problem @Benjamin White references regarding Django's IPython use. Django fixed the bug by accepting a pull request from an IPython core dev.

I took the liberty to file an issue with Pycassa. Hopefully they'll be able to investigate why a similar fix won't work for them.

like image 152
Don Spaulding Avatar answered Sep 28 '22 03:09

Don Spaulding