Skip to content

Conversation

@hippo91
Copy link
Contributor

@hippo91 hippo91 commented Dec 27, 2019

Steps

  • [ * ] For new features or bug fixes, add a ChangeLog entry describing what your PR does.
  • [ * ] Write a good description on what the PR does.

Description

This PR solves the issue #666.
The problem was that astroid could not infer the result of a call to append function because this function, itself, calls the concatenate function.
This last function is inferred thanks to the brain_numpy_core_multiarray module but only when the corresponding node is an astroid.Attribute (for example numpy.concatenate). It turns out that in the source of the append function the node that realises the call to concatenate is a astroid.Name. Thus the correction proposed here is to register the concatenate inference tip function in order to apply it, also, to astroid.Name.

This PR contains also a refactor of the brain_numpy_core_fromnumeric module in order to minimize the interaction with the inference engine. There is no need to redefine the sum function, but instead help astroid to correctly infer the variable out in the function sum.

Type of Changes

Type
🐛 Bug fix

Related Issue

Closes #666

@hippo91
Copy link
Contributor Author

hippo91 commented Dec 27, 2019

@PCManticore

Please do not take into account this pull request. I just realized some problems with it. Sorry

@hippo91 hippo91 closed this Dec 27, 2019
@DanielNoord DanielNoord deleted the bug_666 branch December 21, 2021 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add numpy brain tips for numpy.append

2 participants