Skip to content

Commit

Permalink
Add comments and changelog entry (#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
hippo91 authored Sep 14, 2020
1 parent 25384d4 commit 8b19be2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ astroid's ChangeLog
What's New in astroid 2.5.0?
============================
Release Date: TBA
* The flat attribute of ``numpy.ndarray`` is now inferred as an ``numpy.ndarray`` itself.
It should be a ``numpy.flatiter`` instance, but this class is not yet available in the numpy brain.

Fixes PyCQA/pylint#3640

* Added a brain for ``sqlalchemy.orm.session``

Expand Down
4 changes: 3 additions & 1 deletion astroid/brain/brain_numpy_core_numerictypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ def __init__(self, value):
self.data = None
self.dtype = None
self.flags = None
self.flat = None
# Should be a numpy.flatiter instance but not available for now
# Putting an array instead so that iteration and indexing are authorized
self.flat = np.ndarray([0, 0])
self.imag = None
self.itemsize = None
self.nbytes = None
Expand Down
4 changes: 3 additions & 1 deletion astroid/brain/brain_numpy_ndarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def __init__(self, shape, dtype=float, buffer=None, offset=0,
self.data = None
self.dtype = None
self.flags = None
self.flat = None
# Should be a numpy.flatiter instance but not available for now
# Putting an array instead so that iteration and indexing are authorized
self.flat = np.ndarray([0, 0])
self.imag = np.ndarray([0, 0])
self.itemsize = None
self.nbytes = None
Expand Down

0 comments on commit 8b19be2

Please sign in to comment.