Skip to content

Extended the snapshot function to handle type instances#1301

Open
shirleyyzhang wants to merge 4 commits intopyta-uoft:masterfrom
shirleyyzhang:snapshot-json
Open

Extended the snapshot function to handle type instances#1301
shirleyyzhang wants to merge 4 commits intopyta-uoft:masterfrom
shirleyyzhang:snapshot-json

Conversation

@shirleyyzhang
Copy link
Contributor

@shirleyyzhang shirleyyzhang commented Feb 14, 2026

Proposed Changes

Screenshots of your changes (if applicable)

Type of Change

(Write an X or a brief description next to the type or types that best describe your changes.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
New feature (non-breaking change that adds functionality)
🐛 Bug fix (non-breaking change that fixes an issue)
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests)
📚 Documentation update (change that only updates documentation)
📦 Dependency update (change that updates a dependency)
🔧 Internal (change that only affects developers or continuous integration) X

Checklist

(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the [ ] into a [x] in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)

Before opening your pull request:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.
    • This is required for new features.
  • I have updated the project Changelog (this is required for all changes).
  • If this is my first contribution, I have added myself to the list of contributors.

After opening your pull request:

  • I have verified that the pre-commit.ci checks have passed.
  • I have verified that the CI tests have passed.
  • I have reviewed the test coverage changes reported by Coveralls.
  • I have requested a review from a project maintainer.

Questions and Comments

(Include any questions or comments you have regarding your changes.)

@coveralls
Copy link
Collaborator

coveralls commented Feb 14, 2026

Pull Request Test Coverage Report for Build 22084725112

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 89.85%

Totals Coverage Status
Change from base Build 21888778658: 0.0%
Covered Lines: 3417
Relevant Lines: 3803

💛 - Coveralls

- Added tests for `infinite_loop_checker.py` to improve coverage for the `_name_holds_generator` function and the generator portion of the `_check_constant_loop_cond` function.
- Refactored `test_main.py` calls to use click's testing helpers.
- The `Z3Visitor`, `Z3Parser`, and `Z3ParseException` classes have been extracted into a _new Python package_, `python-ta-z3`.
- Extended `snapshot_to_json` behaviour to handle `type` instances and display the `repr` of the type.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is an enhancement, not an internal change

elif isinstance(val, type):
value_entry = {
"type": ".class",
"name": type(val).__name__,
Copy link
Contributor

Choose a reason for hiding this comment

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

use the hard-coded name "class" here instead, which is a bit more consistent with Python terminology

- Extended `AccumulationTable` class to support multiple loops in sequence within the same context manager
- Added a solution to prevent possible large snippets created by the `render_generic` function
- Support Python 3.14
- Extended `snapshot_to_json` behaviour to handle `type` instances and display the `repr` of the type.
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be added to the "unreleased" section

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modify snapshot function representation of classes

3 participants