larray-project / larray

N-dimensional labelled arrays in Python
https://larray.readthedocs.io/
GNU General Public License v3.0
8 stars 6 forks source link

Excel Range should not act as an Array #1097

Open gdementen opened 9 months ago

gdementen commented 9 months ago

It makes things ambiguous, and it cuts users from using some of xlwings features cleanly (e.g. Range.insert). There is also more opportunities to break user code relying on xlwings methods and we add a method with the same name in Array (in addition to the same problem when we add methods to Range, which should be much rarer).

i.e.

        def __getattr__(self, key):
            if hasattr(Array, key):
                return getattr(self.__larray__(), key)
            else:
                return getattr(self.xw_range, key)

should be changed to:

        def __getattr__(self, key):
            return getattr(self.xw_range, key)