Cannot cast set as list (beginner! Python!)

Cannot cast set as list (beginner! Python!)

kttender
Enthusiast Enthusiast
512 Views
2 Replies
Message 1 of 3

Cannot cast set as list (beginner! Python!)

kttender
Enthusiast
Enthusiast

I am very new to programming w/ Maya Python commands, but have been programming in Python for a little while.

I want to remove doubles from a list by doing the good ol' list(set(list_with_doubles)), but Maya's Script Editor keeps returning the following error:

Error: TypeError: file <maya console> line 3: 'NoneType' object is not callable

The code could not be simpler. The error occurs on line 3:

l = [1, 2, 2]
s = set(l)
newList = list(s)

This works with other Python interpreters? What am I missing? 

0 Likes
Accepted solutions (1)
513 Views
2 Replies
Replies (2)
Message 2 of 3

g2m.agent
Collaborator
Collaborator
Accepted solution

works fine here.

Windows 10, Maya 2020.4, 2022

maya_9GGiJ7njee.jpg

0 Likes
Message 3 of 3

kttender
Enthusiast
Enthusiast
Wow, I reopened Maya today and it works fine for me too. Bizarre. Thanks. Maybe I accidentally named a variable "list" or something in my previous session.
0 Likes