houli / earthquakemapper

A Google Maps visualisation of the past 24 hours' earthquakes.
2 stars 1 forks source link

Unpythonic Getters #1

Open IanConnolly opened 10 years ago

IanConnolly commented 10 years ago

Hey,

I know this was just hacked out in an afternoon, so feel free to ignore this.

There's no reason to wrap the properties of the Earthquake class with getter functions, they can be accessed directly anyway. If you absolutely need to provide get/set logic (which you don't here, you're just returning the accesses), you should use properties

Another style thing here, you actually don't need a class here. You could just use a dict or a namedtuple, which'd cut down on a lot of code :)

love ian <3

houli commented 10 years ago

Hey Ian, thanks for the suggestions. Must make sure to actually read some python best practices before I javafy my brain. Will make some changes when I get a chance.