mikemalinowski / qute

A Qt helper library extending Marcus Ottosson's Qt.py library
MIT License
12 stars 3 forks source link

Suggestion: Would it be worth using `six` instead of direct support for string types? #15

Open ldunham1 opened 4 years ago

ldunham1 commented 4 years ago

https://github.com/mikemalinowski/qute/blob/736d3e57c9d3bb66e17bd4b61f24dc18e4faa349/qute/utilities/derive.py#L14

The six module can be useful for instances like this. For example, in this method, you're always unnecessarily paying the cost of testing against basestring if you're in Python 3.

Other option is to define the missing type once;

try:
    basestring
except NameError:
    basestring = str

and then using basestring. This being said, it may also cause confusion :/