Update collections.py

Issue #3887