Skip to content

signature for permutations has inconsistent signature compared to its behavior #36198

@jhpalmieri

Description

@jhpalmieri

Steps To Reproduce

sage: s = Permutations(4)[10]
sage: type(s.signature())
<class 'int'>

as compared to

def signature(self) -> Integer:

in combinat/permutation.py

Expected Behavior

I think that signature should return an Integer, not an int. There may be similar issues in this file; for example

    def size(self) -> Integer:
        return len(self)

and a few others that are supposed to return type Integer but actually return len(something).

Actual Behavior

The method returns an int, not an Integer.

Additional Information

See https://stackoverflow.com/questions/77052185/unexpected-error-with-sign-function-in-sagemath/77054009#77054009 for one person running into problems because of this.

Environment

- **OS**: OS X 13.5.1
- **Sage Version**: 10.2.beta1

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions