Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raising a frozen data class as an exception will err #24

Open
anatoly-scherbakov opened this issue Nov 23, 2023 · 2 comments
Open

Raising a frozen data class as an exception will err #24

anatoly-scherbakov opened this issue Nov 23, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@anatoly-scherbakov
Copy link
Owner

│ in __setattr__:4                                                                                 │
│ ╭──────────────────────────────────── locals ─────────────────────────────────────╮              │
│ │                 cls = <class 'todoist_costs.errors.MissingDueTime'>             │              │
│ │ FrozenInstanceError = <class 'dataclasses.FrozenInstanceError'>                 │              │
│ │                name = '__traceback__'                                           │              │
│ │                self = MissingDueTime(                                           │              │
│ │                       │   …
│ │                       )                                                         │              │
│ │               value = <traceback object at 0x7f00779cd280>                      │              │
│ ╰─────────────────────────────────────────────────────────────────────────────────╯              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
FrozenInstanceError: cannot assign to field '__traceback__'

I do not think this can be fixed, it just has to be documented at https://anatoly-scherbakov.github.io/documented/compatibility/dataclasses/ page.

@anatoly-scherbakov anatoly-scherbakov added documentation Improvements or additions to documentation good first issue Good for newcomers labels Nov 23, 2023
@anatoly-scherbakov
Copy link
Owner Author

As an alternative, maybe we should raise such an error when DocumentedError class is created.

@anatoly-scherbakov
Copy link
Owner Author

Or, maybe we should add a linter to check for that, packaged with this library. Choose platform for it (flake8, ruff, or jeeves).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant