Should a python3 CQ application script be able to .append a cq.Vector to a python3 list ??

6 views
Skip to first unread message

Steve Petrie

unread,
Jan 6, 2026, 4:56:08 PMJan 6
to CadQuery - Mailing List, Steve Petrie

Greetings To CadQuery Mailing List,

Question: Should a python3 CQ application script be able to .append a cq.Vector to a python3 list ??

* * *
* * *

I attach a screenshot: Screenshot from 2026-01-06 16-30-55.png

of a CQ-editor window, showing the Log Viewer output from a test script (attached):

bwy_ 3.2 test append a cq.Vector to a python3 list.py

* * *
* * *

Pasted here is a copy of the CQ-editor Log Viewer output (emphasis added):
...
[15:58:58] INFO: bwy_3.2 test append a cq.Vector to a python3 list.py *** STARTING *** ...

[15:58:58] INFO:

bwy_3.2 test append a cq.Vector to a python3 list.py: *** BEFORE *** test_list = test_list.append(test_vector)

[15:58:58] INFO: bwy_3.2 test append a cq.Vector to a python3 list.py: test_vector.__class__<<class 'cadquery.occ_impl.geom.Vector'>>

[15:58:58] INFO: bwy_3.2 test append a cq.Vector to a python3 list.py: test_list.__class__<<class 'list'>>

[15:58:58] INFO:

bwy_3.2 test append a cq.Vector to a python3 list.py: *** AFTER *** test_list = test_list.append(test_vector)

[15:58:58] INFO: bwy_3.2 test append a cq.Vector to a python3 list.py: test_vector.__class__<<class 'cadquery.occ_impl.geom.Vector'>>

[15:58:58] INFO: bwy_3.2 test append a cq.Vector to a python3 list.py: test_list.__class__<<class 'NoneType'>>

[15:58:58] INFO:

bwy_3.2 test append a cq.Vector to a python3 list.py *** ... FINISHED ***
...

 

*** NOTE *** The *** BEFORE *** test_list.__class__<<class 'list'>> has changed *** AFTER *** to test_list.__class__<<class 'NoneType'>>

 

so test_list is no longer a valid list type and subsequent list operations fail on it.

 

* * *
* * *

 

Am I doing something wrong, to cause this change in the type of test_list ??

 

Steve Petrie

 

Etobicoke (Toronto), Ontario, Canada

 

ape...@aspetrie.net

Screenshot from 2026-01-06 16-30-55.png
bwy_ 3.2 test append a cq.Vector to a python3 list.py

Lorenz

unread,
Jan 6, 2026, 7:20:02 PMJan 6
to CadQuery
> Am I doing something wrong, to cause this change in the type of test_list ?

Yes, change it to:
# do the append.
# test_list = test_list.append(test_vector)  # wrong, test_list is None
test_list.append(test_vector)


It has nothing to do with the CQ vector.

The Python list.append() method modifies the list in-place and has a return value of None.

See the Python docs:
https://docs.python.org/3/tutorial/datastructures.html#more-on-lists

"You might have noticed that methods like insert, remove or sort that only modify the list have no return value printed – they return the default None."
Reply all
Reply to author
Forward
0 new messages