[chirp_devel] Using Python properties
While making some changes to the Platform class, I realized the code could probably be simplified by removing some getters and using properties instead. However, to make that change, the Platform class needs to be derived from Object, which converts it to a new style class.
This appears to be a safe change, but I wanted to get other opinions before I did that.
mike
On Sep 11, 2013 6:03 PM, "Michael Pittaro" mikeyp@lhrc.com wrote:
While making some changes to the Platform class, I realized the code
could probably be simplified by removing some getters and using properties instead. However, to make that change, the Platform class needs to be derived from Object, which converts it to a new style class.
This appears to be a safe change, but I wanted to get other opinions
before I did that.
I've done this with other Chirp classes without issue.
Tom KD7LXL
While making some changes to the Platform class, I realized the code could probably be simplified by removing some getters and using properties instead. However, to make that change, the Platform class needs to be derived from Object, which converts it to a new style class.
This appears to be a safe change, but I wanted to get other opinions before I did that.
Yep, that's fine with me. If you're going to do that, I'd like to see it done in small pieces, changing one getter to a property at a time, along with all the other changes required to the rest of the code. I'd also like to see unit tests come with that to make sure we're good going forward :)
OK - in that case, I'll submit the virtualenv changes first, then follow up with the property changes.
mike
On Thu, Sep 12, 2013 at 5:33 AM, Dan Smith dsmith@danplanet.com wrote:
While making some changes to the Platform class, I realized the code could probably be simplified by removing some getters and using properties instead. However, to make that change, the Platform class needs to be derived from Object, which converts it to a new style class.
This appears to be a safe change, but I wanted to get other opinions before I did that.
Yep, that's fine with me. If you're going to do that, I'd like to see it done in small pieces, changing one getter to a property at a time, along with all the other changes required to the rest of the code. I'd also like to see unit tests come with that to make sure we're good going forward :)
-- Dan Smith www.danplanet.com KK7DS
chirp_devel mailing list chirp_devel@intrepid.danplanet.com http://intrepid.danplanet.com/mailman/listinfo/chirp_devel Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
participants (3)
-
Dan Smith
-
Michael Pittaro
-
Tom Hayward