Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Specialize collections.namedtuple #174

Closed
lostmsu opened this issue Sep 30, 2018 · 4 comments
Closed

Specialize collections.namedtuple #174

lostmsu opened this issue Sep 30, 2018 · 4 comments
Assignees

Comments

@lostmsu
Copy link
Contributor

lostmsu commented Sep 30, 2018

I noticed PLS has a specialization for typing.NamedTuple, which is, essentially, collections.namedtuple under the hood. Should not be hard to add handling for the later.

I'd be interested on adding a specialization for collections.namedtuple, but I'd like to understand how to add new specializations. Initially, I though it will be as hard as creating a custom CollectionsModuleInfo: BuiltinModule similar to TypingModuleInfo, but then I found also TypingTypeInfo and its Finalize and TypingTypeInfoFinalizer, and a seemingly simple tasks seems convoluted now.

I'd also gladly work on making this exact task simpler in the future.

BTW, here's a commit, that adds a test case for the desired behavior: losttech@0899a19

@MikhailArkhipov
Copy link

Yes #15.

@lostmsu
Copy link
Contributor Author

lostmsu commented Oct 1, 2018

Sorry, obviously a duplicate then.
Still interested in how to work with it.

@MikhailArkhipov
Copy link

It actually does not need specialization. It needs proper understanding of typeshed definitions through Type[T] generic. See #339

@MikhailArkhipov MikhailArkhipov self-assigned this Feb 6, 2019
@MikhailArkhipov
Copy link

Most probably no longer applies after #425

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants