Fix #242: Add type parameters to PRecord for pylance/pyright compatib…#315
Fix #242: Add type parameters to PRecord for pylance/pyright compatib…#315tobgu merged 3 commits intotobgu:masterfrom
Conversation
|
Hi! There seems to be quite a lot of changes going into this PR that I\m not sure are related to the intent as expressed by the PR title. Furthermore some of them are backwards incompatible (see failing tests for some examples) which is pretty much a no-no unless there is good reasons for it. Thanks |
This commit reverts all backwards incompatible changes that were introduced in the previous version: - Restored CheckedType.create() method with ignore_extra parameter support - Restored PRecord.set() method signature to accept *args, **kwargs - Restored _PRecordEvolver to properly inherit from PMap._Evolver - Fixed AttributeError by restoring correct is_field_ignore_extra_complaint() call - Restored _ignore_extra parameter throughout the evolver implementation The ONLY change from master is adding type parameters [str, Any] to PRecord class definition: class PRecord(PMap[str, Any], CheckedType, metaclass=_PRecordMeta) This minimal change provides pylance/pyright compatibility while maintaining full backwards compatibility.
|
Hi @tobgu, I've added a new commit (88e2884) that fixes the backward compatibility issues you mentioned. The previous failing tests were caused by:
Fixes applied:
These changes maintain backward compatibility while properly supporting the Thank you! |
|
Looks good, thanks! |
…ility