Closed pylint-bot closed 8 years ago
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore?):
Don't wrap instance's arguments into a Const, instead let the original index object to be used.
This prevents a crash when the original index object is a slice object, which was wrapped inadvertendly in a Const node, leading to a crash later on if the said object was inferred. Closes issue #200.
Originally reported by: Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore?)
Given the following code, astroid crashes with a KeyError. This is happening because Instance.getitem always wraps its arguments in a Const object, while sometimes it gets passed a slice object. It should use objects.Slice instead and probably it shouldn't do the wrapping itself, but the caller should be responsible for this.