FF-Multi-Converter icon indicating copy to clipboard operation
FF-Multi-Converter copied to clipboard

Simplify utils.add_to_layout() avoiding the use of type checking

Open lpozo opened this issue 7 years ago • 3 comments
trafficstars

Simplify utils.add_to_layout() avoiding the use of type checking and improving performance

lpozo avatar Aug 13 '18 16:08 lpozo

Hello there.

I don't understand why you want to replace the isinstance calls by manually checking the class's names. You're trying to do the same thing only in an unreliable and non-standard way.

Also by removing the final else clause that raises the TypeError you assume that the caller passed a proper type. And that is not a good assumption.

Finally, I don't have a strong opinion about passing strings as the first arg to add_to_layout. I reckon that I did it that way in order for the calls to this function to be shorter in length as it is called frequently. Why do you propose that it should be removed and the caller should explicitly pass a layout class?

Thanks.

ilstam avatar Aug 13 '18 20:08 ilstam

Do you really want someone to collaborate with this project?

lpozo avatar Aug 13 '18 21:08 lpozo

I would be happy to accept patches that improve the source code's quality or implement new functionality.

However, I raised my concerns and questions about your changes and you're not really giving any answers.

ilstam avatar Aug 13 '18 22:08 ilstam