Skip to content

Commit

Permalink
Refs #23919 -- Stopped inheriting from object to define new style cla…
Browse files Browse the repository at this point in the history
…sses.
  • Loading branch information
charettes authored and claudep committed Jan 19, 2017
1 parent a556396 commit cecc079
Show file tree
Hide file tree
Showing 293 changed files with 512 additions and 514 deletions.
2 changes: 1 addition & 1 deletion django/apps/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
MODELS_MODULE_NAME = 'models'


class AppConfig(object):
class AppConfig:
"""
Class representing a Django application and its configuration.
"""
Expand Down
2 changes: 1 addition & 1 deletion django/apps/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from .config import AppConfig


class Apps(object):
class Apps:
"""
A registry that stores the configuration of installed applications.
Expand Down
4 changes: 2 additions & 2 deletions django/conf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def configured(self):
return self._wrapped is not empty


class Settings(object):
class Settings:
def __init__(self, settings_module):
# update this dict from global settings (but only for ALL_CAPS settings)
for setting in dir(global_settings):
Expand Down Expand Up @@ -150,7 +150,7 @@ def __repr__(self):
}


class UserSettingsHolder(object):
class UserSettingsHolder:
"""
Holder for user configured settings.
"""
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/admin/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def check_dependencies(**kwargs):
return errors


class BaseModelAdminChecks(object):
class BaseModelAdminChecks:

def check(self, admin_obj, **kwargs):
errors = []
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/admin/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from django.utils.translation import ugettext_lazy as _


class ListFilter(object):
class ListFilter:
title = None # Human-readable title to appear in the right sidebar.
template = 'admin/filter.html'

Expand Down
12 changes: 6 additions & 6 deletions django/contrib/admin/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ActionForm(forms.Form):
checkbox = forms.CheckboxInput({'class': 'action-select'}, lambda value: False)


class AdminForm(object):
class AdminForm:
def __init__(self, form, fieldsets, prepopulated_fields, readonly_fields=None, model_admin=None):
self.form, self.fieldsets = form, fieldsets
self.prepopulated_fields = [{
Expand Down Expand Up @@ -68,7 +68,7 @@ def media(self):
return media


class Fieldset(object):
class Fieldset:
def __init__(self, form, name=None, readonly_fields=(), fields=(), classes=(),
description=None, model_admin=None):
self.form = form
Expand All @@ -95,7 +95,7 @@ def __iter__(self):
yield Fieldline(self.form, field, self.readonly_fields, model_admin=self.model_admin)


class Fieldline(object):
class Fieldline:
def __init__(self, form, field, readonly_fields=None, model_admin=None):
self.form = form # A django.forms.Form instance
if not hasattr(field, "__iter__") or isinstance(field, str):
Expand Down Expand Up @@ -126,7 +126,7 @@ def errors(self):
)


class AdminField(object):
class AdminField:
def __init__(self, form, field, is_first):
self.field = form[field] # A django.forms.BoundField instance
self.is_first = is_first # Whether this field is first on the line
Expand Down Expand Up @@ -155,7 +155,7 @@ def errors(self):
return mark_safe(self.field.errors.as_ul())


class AdminReadonlyField(object):
class AdminReadonlyField:
def __init__(self, form, field, is_first, model_admin=None):
# Make self.field look a little bit like a field. This means that
# {{ field.name }} must be a useful class name to identify the field.
Expand Down Expand Up @@ -223,7 +223,7 @@ def contents(self):
return conditional_escape(result_repr)


class InlineAdminFormSet(object):
class InlineAdminFormSet:
"""
A wrapper around an inline formset for use in the admin system.
"""
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/admin/sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class NotRegistered(Exception):
pass


class AdminSite(object):
class AdminSite:
"""
An AdminSite object encapsulates an instance of the Django admin application, ready
to be hooked in to your URLconf. Models are registered with the AdminSite using the
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/admin/views/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
ALL_VAR, ORDER_VAR, ORDER_TYPE_VAR, SEARCH_VAR, IS_POPUP_VAR, TO_FIELD_VAR)


class ChangeList(object):
class ChangeList:
def __init__(self, request, model, list_display, list_display_links,
list_filter, date_hierarchy, search_fields, list_select_related,
list_per_page, list_max_show_all, list_editable, model_admin):
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/auth/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
UserModel = get_user_model()


class ModelBackend(object):
class ModelBackend:
"""
Authenticates against settings.AUTH_USER_MODEL.
"""
Expand Down
4 changes: 2 additions & 2 deletions django/contrib/auth/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# the template system can understand.


class PermLookupDict(object):
class PermLookupDict:
def __init__(self, user, app_label):
self.user, self.app_label = user, app_label

Expand All @@ -24,7 +24,7 @@ def __nonzero__(self): # Python 2 compatibility
return type(self).__bool__(self)


class PermWrapper(object):
class PermWrapper:
def __init__(self, user):
self.user = user

Expand Down
2 changes: 1 addition & 1 deletion django/contrib/auth/hashers.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def mask_hash(hash, show=6, char="*"):
return masked


class BasePasswordHasher(object):
class BasePasswordHasher:
"""
Abstract base class for password hashers
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/auth/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.utils.encoding import force_text


class AccessMixin(object):
class AccessMixin:
"""
Abstract CBV mixin that gives access mixins the same customizable
functionality.
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/auth/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class Meta(AbstractUser.Meta):
swappable = 'AUTH_USER_MODEL'


class AnonymousUser(object):
class AnonymousUser:
id = None
pk = None
username = ''
Expand Down
8 changes: 4 additions & 4 deletions django/contrib/auth/password_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def _password_validators_help_text_html(password_validators=None):
password_validators_help_text_html = lazy(_password_validators_help_text_html, str)


class MinimumLengthValidator(object):
class MinimumLengthValidator:
"""
Validate whether the password is of a minimum length.
"""
Expand All @@ -117,7 +117,7 @@ def get_help_text(self):
) % {'min_length': self.min_length}


class UserAttributeSimilarityValidator(object):
class UserAttributeSimilarityValidator:
"""
Validate whether the password is sufficiently different from the user's
attributes.
Expand Down Expand Up @@ -159,7 +159,7 @@ def get_help_text(self):
return _("Your password can't be too similar to your other personal information.")


class CommonPasswordValidator(object):
class CommonPasswordValidator:
"""
Validate whether the password is a common password.
Expand Down Expand Up @@ -192,7 +192,7 @@ def get_help_text(self):
return _("Your password can't be a commonly used password.")


class NumericPasswordValidator(object):
class NumericPasswordValidator:
"""
Validate whether the password is alphanumeric.
"""
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/auth/tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.utils.http import base36_to_int, int_to_base36


class PasswordResetTokenGenerator(object):
class PasswordResetTokenGenerator:
"""
Strategy object used to generate and check tokens for the password
reset mechanism.
Expand Down
4 changes: 2 additions & 2 deletions django/contrib/auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
UserModel = get_user_model()


class SuccessURLAllowedHostsMixin(object):
class SuccessURLAllowedHostsMixin:
success_url_allowed_hosts = set()

def get_success_url_allowed_hosts(self):
Expand Down Expand Up @@ -352,7 +352,7 @@ def password_reset_complete(request,
# prompts for a new password
# - PasswordResetCompleteView shows a success message for the above

class PasswordContextMixin(object):
class PasswordContextMixin:
extra_context = None

def get_context_data(self, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/contenttypes/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from django.utils.functional import cached_property


class GenericForeignKey(object):
class GenericForeignKey:
"""
Provide a generic many-to-one relation through the ``content_type`` and
``object_id`` fields.
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/db/backends/base/adapter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class WKTAdapter(object):
class WKTAdapter:
"""
This provides an adaptor for Geometries sent to the
MySQL and Oracle database backends.
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/db/backends/base/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.contrib.gis.db.models import aggregates


class BaseSpatialFeatures(object):
class BaseSpatialFeatures:
gis_enabled = True

# Does the database contain a SpatialRefSys model to store SRID information?
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/db/backends/base/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.contrib.gis import gdal


class SpatialRefSysMixin(object):
class SpatialRefSysMixin:
"""
The SpatialRefSysMixin is a class used by the database-dependent
SpatialRefSys objects to reduce redundant code.
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/db/backends/base/operations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class BaseSpatialOperations(object):
class BaseSpatialOperations:
"""
This module holds the base `BaseSpatialBackend` object, which is
instantiated by each spatial database backend with the features
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/db/backends/postgis/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from django.contrib.gis.geometry.backend import Geometry


class PostGISAdapter(object):
class PostGISAdapter:
def __init__(self, obj, geography=False):
"""
Initialize on the spatial object.
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/db/backends/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""


class SpatialOperator(object):
class SpatialOperator:
"""
Class encapsulating the behavior specific to a GIS operation (used by lookups).
"""
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/db/models/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_srid_info(srid, connection):
return _srid_cache[alias][srid]


class GeoSelectFormatMixin(object):
class GeoSelectFormatMixin:
def select_format(self, compiler, sql, params):
"""
Returns the selection format string, depending on the requirements
Expand Down
6 changes: 3 additions & 3 deletions django/contrib/gis/db/models/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def __init__(self, expression, geom, *expressions, **extra):
super(GeoFuncWithGeoParam, self).__init__(expression, GeomValue(geom), *expressions, **extra)


class SQLiteDecimalToFloatMixin(object):
class SQLiteDecimalToFloatMixin:
"""
By default, Decimal values are converted to str by the SQLite backend, which
is not acceptable by the GIS functions expecting numeric values.
Expand All @@ -112,7 +112,7 @@ def as_sqlite(self, compiler, connection):
return super(SQLiteDecimalToFloatMixin, self).as_sql(compiler, connection)


class OracleToleranceMixin(object):
class OracleToleranceMixin:
tolerance = 0.05

def as_oracle(self, compiler, connection):
Expand Down Expand Up @@ -230,7 +230,7 @@ class Difference(OracleToleranceMixin, GeoFuncWithGeoParam):
arity = 2


class DistanceResultMixin(object):
class DistanceResultMixin:
def source_is_geography(self):
return self.get_source_fields()[0].geography and self.srid == 4326

Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/db/models/sql/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from django.contrib.gis.measure import Area, Distance


class BaseField(object):
class BaseField:
empty_strings_allowed = True

def get_db_converters(self, connection):
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed


class GeoFeedMixin(object):
class GeoFeedMixin:
"""
This mixin provides the necessary routines for SyndicationFeed subclasses
to produce simple GeoRSS or W3C Geo elements.
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/gdal/envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class OGREnvelope(Structure):
]


class Envelope(object):
class Envelope:
"""
The Envelope object is a C structure that contains the minimum and
maximum X, Y coordinates for a rectangle bounding box. The naming
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/gdal/geomtype.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.contrib.gis.gdal.error import GDALException


class OGRGeomType(object):
class OGRGeomType:
"Encapsulates OGR Geometry Types."

wkb25bit = -2147483648
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/geoip2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class GeoIP2Exception(Exception):
pass


class GeoIP2(object):
class GeoIP2:
# The flags for GeoIP memory caching.
# Try MODE_MMAP_EXT, MODE_MMAP, MODE_FILE in that order.
MODE_AUTO = 0
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/geos/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ def clone(self):
return GEOSGeometry(capi.geom_clone(self.ptr), srid=self.srid)


class LinearGeometryMixin(object):
class LinearGeometryMixin:
"""
Used for LineString and MultiLineString.
"""
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/gis/geos/libgeos.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def get_pointer_arr(n):
lgeos = SimpleLazyObject(load_geos)


class GEOSFuncFactory(object):
class GEOSFuncFactory:
"""
Lazy loading of GEOS functions.
"""
Expand Down
Loading

0 comments on commit cecc079

Please sign in to comment.