Skip to content

Conversation

@user202729
Copy link
Contributor

@user202729 user202729 commented Nov 16, 2025

Otherwise, you try to print out a Set(GF(998244353)) and it eats all your computer's memory

compare with

sage: repr(matrix.zero(100))
'100 x 100 dense matrix over Integer Ring'
sage: str(matrix.zero(100))[:50]
'[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'
sage: repr(matrix.zero(3))
'[0 0 0]\n[0 0 0]\n[0 0 0]'
sage: str(matrix.zero(3))
'[0 0 0]\n[0 0 0]\n[0 0 0]'

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

Comment on lines +906 to +907
o = self.object()
if o is self:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how can o is self happen?

Copy link
Contributor Author

@user202729 user202729 Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set_object_binary does Set_object.__init__(self, self, category=category)

many of them override this method, but better safe than sorry.

(seriously it's probably better to not make Set_object_binary inherit from Set_object at all... but I consider that out of scope)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants