Spyder: error using list() in console

Spyder: error using list() in console

pludikar
Collaborator Collaborator
597 Views
2 Replies
Message 1 of 3

Spyder: error using list() in console

pludikar
Collaborator
Collaborator

Hi,

 

When I try to use list(xyz) in the console I get *** Error in argument: '(xyz)'.  

 

Same happens if I attempt to create a list comprehension - any variables used inside the [ ] trow an error. Two separately installed machines behave the same.

 

Is this a Spyder issue or a Spyder Fusion adaption issue?

 

Peter

I'm not an expert, but I know enough to be very, very dangerous.

Life long R&D Engineer (retired after 30+ years in Military Communications, Aerospace Robotics and Transport Automation).
0 Likes
598 Views
2 Replies
Replies (2)
Message 2 of 3

marshaltu
Autodesk
Autodesk

Hello,

 

I cannot reproduce the issue you mentioned in Python console. If you meant "pdb console", I did see the issue. "list" seems to be a command in pdb. You have to give correct argument to invoke the command.

 

(Pdb) xyz = 0
(Pdb) list(xyz)
*** Error in argument: '(xyz)'
(Pdb) l = [xyz]
*** Error in argument: '= [xyz]'
(Pdb) (Pdb) *** Error in argument: '(xyz)'
(Pdb) 0
(Pdb) exit

>>> xyz = 0
>>> l = [xyz]
>>> l
[0]

Thanks,

Marshal



Marshal Tu
Fusion Developer
>
0 Likes
Message 3 of 3

pludikar
Collaborator
Collaborator

@marshaltu

Hi Marshall,

 

D'oh - It didn't dawn on me that list would be a command in the Pdb console.  Thanks - this set me on the path to find out more.

 

I found out that any instruction that can be confused with a pbd command should be preceded by !

 

so !list(map(foo, xyz)) works as expected

 

whereas I was getting the error with 

 

(PDB)>> list(map(foo, xyz))

 

 Anyway many thanks for you help

 

Peter

 

I'm not an expert, but I know enough to be very, very dangerous.

Life long R&D Engineer (retired after 30+ years in Military Communications, Aerospace Robotics and Transport Automation).
0 Likes