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

typing related issues to custom record class. #1258

Unanswered
iyad-f asked this question in Q&A
Discussion options

so i just type hinted a user record like

class User(asyncpg.Record):
 if TYPE_CHECKING:
 id: int
 username: str
 password: str
 def __getattr__(self, name: str) -> Any:
 return self[name]

but i get the following error from pyright
image

so do i need to do some additional stuff for this?

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /