collections-extended icon indicating copy to clipboard operation
collections-extended copied to clipboard

Python 3.11 compatibility

Open merkys opened this issue 1 year ago • 1 comments

There seem to be Python 3.11 compatibility issues: some of the tests fail, most noticeably tests/test_setlists.py::test_shuffle:

tests/test_setlists.py:183: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = setlist((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,...0, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99))
random = None

    def shuffle(self, random=None):
    	"""Shuffle all of the elements in self in place.
    
    	Args:
    		random: A function returning a random float in [0.0, 1.0). If none
    			is passed, the default from `random.shuffle` will be used.
    	"""
>   	random_.shuffle(self._list, random=random)
E    TypeError: Random.shuffle() got an unexpected keyword argument 'random'

Is there a plan to extend the Python compatibility to support 3.11?

merkys avatar Jan 23 '23 08:01 merkys

The random parameter was removed because "no one ever uses" it "nor would they have a valid reason to do so". Also, Raymond has "long been annoyed" by it.

https://github.com/python/cpython/issues/84645

exarkun avatar Feb 13 '23 12:02 exarkun