Type checking and dot notation

7 views
Skip to first unread message

E

unread,
Dec 23, 2022, 1:53:50 PM12/23/22
to cloudtools-dev
Howdy,

We have quite a bit of code like so:

user_pool_config.EmailConfiguration.ReplyToEmailAddress = user_pool[
"email_reply_to"
]

Resulting in Pyright a type checking error of:
error: Cannot assign member "ReplyToEmailAddress" for type "dict[Unknown, Unknown]"
(type checking level of Basic)

I can rewrite these statements with setattr() which satisfies the type checker.  But it looks ungainly.

Do you have any tips on how I could inform the type checker that these attributes do exist/can be set via dot notation?

Thank you for the excellent work on Troposphere!
Reply all
Reply to author
Forward
0 new messages