8000 update TileGrid docstrings to include Shape by FoamyGuy · Pull Request #5280 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

update TileGrid docstrings to include Shape #5280

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

Merged
merged 1 commit into from
Sep 1, 2021

Conversation

FoamyGuy
Copy link
Collaborator
@FoamyGuy FoamyGuy commented Sep 1, 2021

In order to use displayio.Shape you must pass it to a TileGrid as the first parameter. This updates the docstrings to include Shape as one of the valid types for that parameter so that usages will not generate a warning from the IDE when you have circuitpython-stubs installed.

Copy link
@jepler jepler left a comment

Choose a reason for hiding this comment

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

Makes sense, but if there are any more places where this is the case then we may want to put a shortcut for this Union[] in _types.pyi.

@FoamyGuy
Copy link
Collaborator Author
FoamyGuy commented Sep 1, 2021

I am not aware of any other places where both Bitmap and Shape are valid argument types. I'm glad you mentioned this though, I didn't know that file existed.

@microdev1 microdev1 merged commit 9797665 into adafruit:main Sep 1, 2021
@lesamouraipourpre
Copy link

Late to the party on this one, should the Union also include OnDiskBitmap ?

@FoamyGuy
Copy link
Collaborator Author
FoamyGuy commented Sep 1, 2021

@lesamouraipourpre good catch, yes it should include OnDiskBitmap as well, that currently yields a similar warning in the IDE from stubs.

You want to make a PR for that one? If not I can work on that later on tonight.

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.

4 participants
0