PythonScript icon indicating copy to clipboard operation
PythonScript copied to clipboard

[2.0]TypeError: 'tuple' object is not callable when using range

Open byzod opened this issue 3 years ago • 3 comments
trafficstars

I'm using Emmet, it's working but not updated for a long time and broken with Pythonscript 3.0.13-alpha so I have to using 2.0

But I got problem with 2.0 version, every code with range throw an error so emmet is working with Python 2.0 but my user script is broken

Any help?

a=range(3)

Traceback (most recent call last):
  File "<console>", line 1, in <module>
TypeError: 'tuple' object is not callable
for i in range(3):
    print(i);

TypeError: 'tuple' object is not callable

p.s. notepad++ 8.3.3 x64

byzod avatar Apr 20 '22 08:04 byzod

This is a valid code and PS 2.0 can use it without any problems.

image

So either emmet is doing something here, or your code is messing up the built-in range function.

Ekopalypse avatar Apr 21 '22 09:04 Ekopalypse

This is a valid code and PS 2.0 can use it without any problems.

https://user-images.githubusercontent.com/47723516/164424469-d56e3bf0-9492-4a8e-b355-cb04063469ed.png

So either emmet is doing something here, or your code is messing up the built-in range function.

Lol thanks you're right, I found that my other ancient code snippet wrote something like range = editor.getUserCharSelection()

byzod avatar Apr 22 '22 07:04 byzod

@byzod - would you mind closing this issue or is there something left to discuss/fix?

Ekopalypse avatar Apr 29 '22 13:04 Ekopalypse