3 Mar
2018
3 Mar
'18
11:44 a.m.
On 03/03/2018 17:38, Eric V. Smith wrote:
I'd just do: import yourmodule obj = yourmodule.YourClass()
Or as one line, if that's your thing: import yourmodule; obj = yourmodule.YourClass()
Which is More transparent: it's evident what the imported module is used for. More maintainable: you only need to add or remove one line or two adjacent lines per instance, instead of two widely separated lines. (as long as you're happy to defer the imports, of course). Regards Rob Cliffe