Can owlready's range() interfere with python's in range()

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Can owlready's range() interfere with python's in range()

Jos Lehmann 2
This post was updated on .
==
This is solved. Message left here for documentation purposes. Code A below should have been with rrange(ind). The disambiguation of variable range previously peformed, had already solved the problem. But code A was not correctly applying this solution.
==

= Original Message =

Hi there

Premise:

I have code that creates and individual using the owlready construct range(), say:

e = range(ind)         in code (A)

(A) works.

Now I have been trying to embed (A) in a loop: for i in range(n).

python throws an error, complaining ind is a string rather than an integer, as if interpreting range(ind) as range(n)...


Question and comment:

Is that a possibility, that python gets confused?

Actually, I know it is -- it already happened, with a variable named "range", which I renamed "rrange" to disambiguate.
Now it's about an owlready construct... I tried owlready2.range(ind) in A, but it did not work.


KR, Jos

= End of Original Message =