mesa icon indicating copy to clipboard operation
mesa copied to clipboard

Issue1341

Open Aryan1Mahahjan opened this issue 1 year ago • 9 comments

solving the issue of replacing Union[a, b] with a | b and Optional[a] with a | None in type annotations:

Replacing Union[a, b] with a | b:

Improves readability and clarity of type hints. Makes it easier to understand what types are allowed for a variable or function parameter. Provides better type checking by the static type checker. Replacing Optional[a] with a | None:

Similar benefits to replacing Union[a, b] with a | b. More concise and idiomatic way to represent optional types in Python 3.8+

Aryan1Mahajahn

Aryan1Mahahjan avatar Jan 23 '24 18:01 Aryan1Mahahjan

Thanks for your contribution! If you have any questions about why the CI test are failing or how to resolve it, let me know.

EwoutH avatar Jan 23 '24 19:01 EwoutH

If you want an easy trick for resolving the pre-commit error, you can do this trick.

EwoutH avatar Jan 24 '24 06:01 EwoutH

I have addressed the import issue manually and am encountering difficulties with the pre-commit.ci autofix mechanism.

@Aryan1Mahahjan here you go: pre-commit.ci autofix

EwoutH avatar Jan 24 '24 12:01 EwoutH

pre-commit.ci autofix

EwoutH avatar Jan 24 '24 12:01 EwoutH

Makes me wonder if GitHub may support auto-complete for some keyword commands (that possibly start with /), like in IRC or Slack. Someone might have already raised this at https://github.com/orgs/community/discussions.

rht avatar Jan 24 '24 12:01 rht

@Aryan1Mahahjan You created a code conflict, you can see it if you press the "Resolve conflicts" button below. Once you resolve that pre-commit will work again.

EwoutH avatar Jan 24 '24 12:01 EwoutH

pre-commit.ci autofix

EwoutH avatar Jan 25 '24 08:01 EwoutH

May I kindly request permission to create a new pull request? Regrettably, there was a mistake in merging with the incorrect branch, and I would like to rectify the situation promptly. Your approval for this corrective action would be greatly appreciated.

Aryan1Mahahjan avatar Jan 25 '24 09:01 Aryan1Mahahjan

Yes of course.

And no need to be so formal :)

EwoutH avatar Jan 25 '24 09:01 EwoutH

If I understand it correctly, this PR is superseded by #2003. So this PR can be closed?

quaquel avatar Feb 24 '24 15:02 quaquel

Yes indeed. Hope we can merge #2003 soon after the release.

rht avatar Feb 24 '24 17:02 rht