Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Lazy connections #2
Conversation
Making these newtork calls proactively in our constructors is not a good practice. Constructors should only configure the object for use and NOT actually instantiate non-config object properties. Perfect case for lazy-loading is testing. Unless the object is heavily mocked these network calls would 1) require a network connection for testing even if the object is only instanted in the test and not used and 2) slow down tests due to network calls.
Updated setup.py to use this version property so there is only one source of truth.
Making these network calls proactively in our constructors is not a good
practice. Constructors should only configure the object for use and NOT
actually instantiate non-config object properties.
Perfect case for lazy-loading is testing. Unless the object is heavily
mocked these network calls would 1) require a network connection for
testing even if the object is only instantiated in the test and not used
and 2) slow down tests due to network calls.