Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

NameError when using PVector in a separate module #13

Closed
jarav opened this Issue Nov 2, 2010 · 5 comments

Comments

Projects
None yet
3 participants

jarav commented Nov 2, 2010

This is just my follow-up comment on the previous issue, in case you hadn't looked at it. If I use PVector in a separate module( which I import in the main module) I get a NameError. This is why I had to resort to "import processing.core.PVector as PVector".

Owner

jdf commented Feb 12, 2011

Ahh! Now I see the problem. OK, this is a serious bug, and I'll see what i can do about it.

jeisenma commented Jun 6, 2013

I'm encountering the same problem. Any progress on this bug?

Even when I import PVector into the separate module (as described by jarav), a strange thing happens... This sequence of PVector operations:

a = PVector()
b = PVector(1,0)
x = PVector.sub( a, b )
x.mult(5)

...yields this error for x:

AttributeError: 'NoneType' object has no attribute 'mult'

I suspect that the PVector. methods aren't returning a PVector object. However this works fine in the main file.

@jdf jdf closed this in 8f86b03 Jun 7, 2013

Owner

jdf commented Jun 7, 2013

Hooray!

Owner

jdf commented Jun 7, 2013

For those interested, you should no longer import PVector yourself. I don't even know what will happen if you try.

PVector is now a builtin name, as far as Jython is concerned, in the context of your sketch. It's magical.

jeisenma commented Jun 7, 2013

It IS magical. Thanks very much!

ralfbiedert added a commit to ralfbiedert/processing.py that referenced this issue Jun 26, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment