exxeleron / qPython

interprocess communication between Python and kdb+
http://www.devnet.de
Apache License 2.0
152 stars 89 forks source link

Allow composition in QReaders #45

Open audetto opened 7 years ago

audetto commented 7 years ago

Hi, I once open an issue about Strings in qPyton that are returned ad bytes and not unicode strings in python 3. https://github.com/exxeleron/qPython/issues/35

The issue was closed after some improvement to the QReader were implemented.

I think there is still room for improvement as even with the current code I struggle to have override the behaviour. The problem is that I want to use PandasQReader.

Now, PandasQReader inherits from QReader, so I cant really inject my class in between, I would have to copy PandasQReader so it inherits from my class.

This is similar to the stream framework in Java. There each stream class introduces some new behaviour and the way to make them work together is by putting one inside the other, rather than make them inherit from a particular one.

So if PandasQReader took a QReader in the constructor I could pass at runtime my modified class as opposed to the default one.

Unless I have missed something.