One function

Location in maxmind/GeoIP2-python

The author described this change as Fixed bug in longitude and metro_code caused by a missing comma. Closes #1.. It counts as a record because the check below fails on the code as it stood at ed119eaa3 and passes on f493f97be, with nothing else changed between the two runs.

Fix saved2013-06-20
Sharing licenceApache-2.0 · LICENSE
Change size+1 1

What the code was meant to do, written into the code itself as a docstring

Contains data for the location record associated with an IP address This class contains the location data associated with an IP address. This record is returned by all the end points except the Country end point. Attributes: .. attribute:: accuracy_radius The radius in kilometers around the specified location where the IP address is likely to be. This attribute is only available from the Omni end point. :type: int .. attribute:: latitude The latitude of the location as a floating point number. This attribute is returned by all end points except the Country end point. :type: float .. attribute:: longitude The longitude of the location as a floating point number. This attribute is returned by all end points except the Country end point. :type: float .. attribute:: metro_code The metro code of the location if the location is in the US. MaxMind returns the same metro codes as the `Google AdWords API <https://developers.google.com/adwords/api/docs/appendix/cities-DMAregions>`_. This attribute is returned by all end points except the Country end point. :type: int .. attribute:: time_zone The time zone associated with location, as specified by the `IANA Time Zone Database <http://www.iana.org/time-zones>`_, e.g., "America/New_York". This attribute is returned by all end points except the Country end point. :type: unicode

The change

5353 :type: unicode
5454
5555 """
56- _valid_attributes = set(['accuracy_radius', 'latitude', 'longitude'
56+ _valid_attributes = set(['accuracy_radius', 'latitude', 'longitude',
5757 'metro_code', 'postal_code', 'postal_confidence',
5858 'time_zone'])

The check that tells the two apart

failpass·tests/models_test.py::TestModels::test_omni_full

Check file tests/models_test.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before ited119eaa3c211ac43119f7a8ae0a8ddab39ceebb
Broken version dated2013-06-10
Modulegeoip2.records
Units changedLocation
Fingerprint62e14cf399771484
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.