Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add _GenericVector to math typestubs, fixes#3150

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ankith26 merged 8 commits intomainfromankith26-math-typing
Aug 16, 2022

Conversation

@ankith26
Copy link
Contributor

A followup PR for#3088, after this PR typecheckers should handle return types of some methods of vector subclasses correctly.

While working on this I realised there was a lot of code repetition in theVectorN stubs, so I added a_GenericVector private superclass forVectorN that implements the common methods of both vector objects.

Another idea of mine was to addGenericVector to C code itself, user code should continue to useVectorN but thisGenericVector could exist only to make the C implementation easier and exist as an ABC for vectors maybe? This would be new API and needs more discussion so is something for the future, this PR only affects the typestubs for now

andrewhong04 and gresm reacted with hooray emoji
Copy link
Contributor

@MyreMylarMyreMylar left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Less duplication

Copy link
Contributor

@Starbuck5Starbuck5 left a comment

Choose a reason for hiding this comment

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

Typing is far too 🧠 for me right now, but this looks good as far as I can tell.

Thanks for working on this stuff Ankith!

@ankith26
Copy link
ContributorAuthor

ankith26 commentedAug 10, 2022
edited
Loading

Fixed merge conflicts in here.

Was giving a final scroll and I noticed a few more typing issues

Copy link
Member

@illumeillume left a comment
edited
Loading

Choose a reason for hiding this comment

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

Another idea of mine was to add GenericVector to C code itself

Yes, this would be nice.

There is also the Vec4 and Matrix to consider, and a VectorN would be useful (maybe just called Vector). What I'm getting at is perhaps we should plan where these are going. Personally I have need for matrix and larger vectors. Also there is the immutable discussion. We have the immutable discussion here:#2312 and I started an issue for Matrix and Vector4 here:#3412

With regard to type changes... I think we still have some work to do to make them more usable. Especially with testing changes are usable by humans. How do I type my pygame using function to take a ColorLike for example? How do we know type changes aren't breaking user programs? Can we automate more testing of types? Added an issue for this:#3411

@illumeillume added the bug labelAug 20, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@illumeillumeillume left review comments

+3 more reviewers

@andrewhong04andrewhong04andrewhong04 requested changes

@MyreMylarMyreMylarMyreMylar approved these changes

@Starbuck5Starbuck5Starbuck5 approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

bugmathpygame.mathtypesType hint checking related tasks

Projects

None yet

Milestone

2.1.3

Development

Successfully merging this pull request may close these issues.

Use the Self type

6 participants

@ankith26@illume@MyreMylar@andrewhong04@Starbuck5

[8]ページ先頭

©2009-2025 Movatter.jp