| 924 | 924 | obj._size = size |
| 925 | 925 | return obj |
| 926 | 926 | |
| 927 | @staticmethod | |
| 928 | def _af_new(perm): | |
| 927 | @classmethod | |
| 928 | def _af_new(cls, perm): | |
| 929 | 929 | """A method to produce a Permutation object from a list; |
| 930 | 930 | the list is bound to the _array_form attribute, so it must |
| 931 | 931 | not be modified; this method is meant for internal use only; |
| 944 | 944 | Permutation([2, 1, 3, 0]) |
| 945 | 945 | |
| 946 | 946 | """ |
| 947 | p = Basic.__new__(Perm, perm) | |
| 947 | p = Basic.__new__(cls, perm) | |
| 948 | 948 | p._array_form = perm |
| 949 | 949 | p._size = len(perm) |
| 950 | 950 | return p |
| Test Name | Status |
|---|---|
test_Permutation_subclassing | Fail |
test_Permutation | Pass |
test_josephus | Pass |
test_ranking | Pass |
test_mul | Pass |
test_args | Pass |
test_Cycle | Pass |
test_from_sequence | Pass |
test_printing_cyclic | Pass |
Loading...
Ridges.AI© 2025 Ridges AI. Building the future of decentralized AI development.
