← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:py3only-no-object-base into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:py3only-no-object-base into launchpad:master.

Commit message:
Stop explicitly subclassing object

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/414529

pyupgrade missed these for various reasons (mainly doctests).
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3only-no-object-base into launchpad:master.
diff --git a/lib/lp/app/doc/badges.txt b/lib/lp/app/doc/badges.txt
index 1336fbc..3e7dfcc 100644
--- a/lib/lp/app/doc/badges.txt
+++ b/lib/lp/app/doc/badges.txt
@@ -170,7 +170,7 @@ determination methods to use the results of an alternative query.
 
     >>> from zope.interface import implementer
     >>> @implementer(IFoo)
-    ... class Foo(object):
+    ... class Foo:
     ...     @property
     ...     def bugs(self):
     ...         print("Foo.bugs")
diff --git a/lib/lp/app/stories/basics/notfound-head.txt b/lib/lp/app/stories/basics/notfound-head.txt
index b6988b7..bc2e57a 100644
--- a/lib/lp/app/stories/basics/notfound-head.txt
+++ b/lib/lp/app/stories/basics/notfound-head.txt
@@ -27,7 +27,7 @@ Register a test page that generates HTTP 500 errors.
     >>> from zope.component import provideAdapter
     >>> from zope.interface import Interface
     >>> from zope.publisher.interfaces.browser import IDefaultBrowserLayer
-    >>> class ErrorView(object):
+    >>> class ErrorView:
     ...     """A broken view"""
     ...     def __init__(self, *args):
     ...         oops
diff --git a/lib/lp/app/stories/basics/xx-developerexceptions.txt b/lib/lp/app/stories/basics/xx-developerexceptions.txt
index 42a794d..412bad9 100644
--- a/lib/lp/app/stories/basics/xx-developerexceptions.txt
+++ b/lib/lp/app/stories/basics/xx-developerexceptions.txt
@@ -11,7 +11,7 @@ Accessing that page gives us the OOPS error page.
     >>> from zope.publisher.interfaces.browser import IDefaultBrowserLayer
     >>> from lp.testing.fixture import ZopeAdapterFixture
 
-    >>> class ErrorView(object):
+    >>> class ErrorView:
     ...     """A broken view"""
     ...     def __call__(self, *args, **kw):
     ...         raise Exception('Oops')
diff --git a/lib/lp/app/stories/basics/xx-opstats.txt b/lib/lp/app/stories/basics/xx-opstats.txt
index 09a1389..9b5160b 100644
--- a/lib/lp/app/stories/basics/xx-opstats.txt
+++ b/lib/lp/app/stories/basics/xx-opstats.txt
@@ -136,7 +136,7 @@ particular need to differentiate these cases though:
     >>> from zope.publisher.interfaces.browser import IDefaultBrowserLayer
     >>> from lp.testing.fixture import ZopeAdapterFixture
 
-    >>> class ErrorView(object):
+    >>> class ErrorView:
     ...     """A broken view"""
     ...     def __call__(self, *args, **kw):
     ...         raise Exception('Oops')
diff --git a/lib/lp/app/validators/__init__.py b/lib/lp/app/validators/__init__.py
index 0a6bdd8..62587c9 100644
--- a/lib/lp/app/validators/__init__.py
+++ b/lib/lp/app/validators/__init__.py
@@ -105,7 +105,7 @@ class WidgetInputErrorView(Z3WidgetInputErrorView):
         >>> print(view.snippet())
         <b>Foo</b>
 
-        >>> class TooSmallError(object):
+        >>> class TooSmallError:
         ...     def doc(self):
         ...         return "Foo input < 1"
         >>> err = WidgetInputError("foo", "Foo", TooSmallError())
diff --git a/lib/lp/blueprints/doc/specgraph.txt b/lib/lp/blueprints/doc/specgraph.txt
index 01c1aac..97c5c92 100644
--- a/lib/lp/blueprints/doc/specgraph.txt
+++ b/lib/lp/blueprints/doc/specgraph.txt
@@ -18,7 +18,7 @@ SpecGraph to keep track of the nodes that have been added.
     >>> g.url_pattern_for_testing = 'http://whatever/%s'
     >>> default_target = factory.makeProduct(name='fnord')
 
-    >>> class Spec(object):
+    >>> class Spec:
     ...
     ...     def __init__(self, name,
     ...             is_complete=False, title=None, assignee=None):
diff --git a/lib/lp/buildmaster/doc/buildfarmjobbehaviour.txt b/lib/lp/buildmaster/doc/buildfarmjobbehaviour.txt
index 26528be..b2ed2c5 100644
--- a/lib/lp/buildmaster/doc/buildfarmjobbehaviour.txt
+++ b/lib/lp/buildmaster/doc/buildfarmjobbehaviour.txt
@@ -40,7 +40,7 @@ For this documentation, we'll also need a dummy new build farm job.
     >>> class IMyNewBuildFarmJob(IBuildFarmJob):
     ...     "Normally defines job-type specific database fields."""
     >>> @implementer(IMyNewBuildFarmJob)
-    ... class MyNewBuildFarmJob(object):
+    ... class MyNewBuildFarmJob:
     ...     pass
 
 Custom behaviours are not normally instantiated directly, instead an adapter
diff --git a/lib/lp/services/doc/propertycache.txt b/lib/lp/services/doc/propertycache.txt
index d8af5ff..00f24e1 100644
--- a/lib/lp/services/doc/propertycache.txt
+++ b/lib/lp/services/doc/propertycache.txt
@@ -14,7 +14,7 @@ and then returned each time it is asked for.
     >>> from itertools import count
     >>> counter = count(1)
 
-    >>> class Foo(object):
+    >>> class Foo:
     ...     @cachedproperty
     ...     def bar(self):
     ...         return next(counter)
@@ -123,7 +123,7 @@ A cached property can be declared with or without an explicit name. If
 not provided it will be derived from the decorated object. This name
 is the name under which values will be cached.
 
-    >>> class Foo(object):
+    >>> class Foo:
     ...     @cachedproperty("a_in_cache")
     ...     def a(self):
     ...         return 1234
diff --git a/lib/lp/services/fields/doc/uri-field.txt b/lib/lp/services/fields/doc/uri-field.txt
index d55670b..e4cf960 100644
--- a/lib/lp/services/fields/doc/uri-field.txt
+++ b/lib/lp/services/fields/doc/uri-field.txt
@@ -201,7 +201,7 @@ This widget is registered as an input widget:
     >>> from lp.services.webapp.servers import LaunchpadTestRequest
 
     >>> @implementer(IURIFieldTest)
-    ... class URIFieldTest(object):
+    ... class URIFieldTest:
     ...     field = None
 
     >>> context = URIFieldTest()
diff --git a/lib/lp/services/webapp/doc/canonical_url.txt b/lib/lp/services/webapp/doc/canonical_url.txt
index e7a0ce5..90d4df5 100644
--- a/lib/lp/services/webapp/doc/canonical_url.txt
+++ b/lib/lp/services/webapp/doc/canonical_url.txt
@@ -42,7 +42,7 @@ Add a view for Country/+map.
 
     >>> from zope.component import provideAdapter
     >>> from zope.publisher.interfaces.browser import IDefaultBrowserLayer
-    >>> class CountryMapView(object):
+    >>> class CountryMapView:
     ...     def __init__(self, country, request):
     ...         pass
     >>> provideAdapter(CountryMapView, (ICountry, IDefaultBrowserLayer),
diff --git a/lib/lp/services/webapp/doc/launchbag.txt b/lib/lp/services/webapp/doc/launchbag.txt
index db16e8c..75f0140 100644
--- a/lib/lp/services/webapp/doc/launchbag.txt
+++ b/lib/lp/services/webapp/doc/launchbag.txt
@@ -11,19 +11,19 @@ First, we'll set up various imports and stub objects.
     >>> from lp.services.webapp.interfaces import \
     ...     CookieAuthPrincipalIdentifiedEvent
 
-    >>> class Principal(object):
+    >>> class Principal:
     ...     id = 23
 
     >>> principal = Principal()
-    >>> class Participation(object):
+    >>> class Participation:
     ...     principal = principal
     ...     interaction = None
 
-    >>> class Response(object):
+    >>> class Response:
     ...     def getCookie(self, name):
     ...         return None
 
-    >>> class Request(object):
+    >>> class Request:
     ...     principal = principal
     ...     response = Response()
     ...     cookies = {}
diff --git a/lib/lp/services/webapp/doc/navigation.txt b/lib/lp/services/webapp/doc/navigation.txt
index 5d4348d..94d23ca 100644
--- a/lib/lp/services/webapp/doc/navigation.txt
+++ b/lib/lp/services/webapp/doc/navigation.txt
@@ -72,7 +72,7 @@ interface, we'll define one here.
 
     >>> from zope.publisher.interfaces.browser import IBrowserRequest
 
-    >>> class Response(object):
+    >>> class Response:
     ...
     ...     redirected_to = None
     ...     status = None
@@ -105,7 +105,7 @@ interface, we'll define one here.
     ...             return None
 
     >>> @implementer(IBrowserRequest)
-    ... class Request(object):
+    ... class Request:
     ...
     ...     def __init__(self):
     ...         self.response = Response()
@@ -141,7 +141,7 @@ interface, we'll define one here.
     ...     value = Attribute('the value of the thing')
 
     >>> @implementer(IThing)
-    ... class Thing(object):
+    ... class Thing:
     ...
     ...     def __init__(self, value):
     ...         self.value = value
@@ -150,7 +150,7 @@ interface, we'll define one here.
     ...         return "<Thing '%s'>" % self.value
 
     >>> @implementer(IThingSet)
-    ... class ThingSet(object):
+    ... class ThingSet:
     ...
     ...     def getThing(self, name):
     ...         if name.startswith('t'):
diff --git a/lib/lp/services/webapp/doc/webapp-publication.txt b/lib/lp/services/webapp/doc/webapp-publication.txt
index 5bf86ce..d7f8dcc 100644
--- a/lib/lp/services/webapp/doc/webapp-publication.txt
+++ b/lib/lp/services/webapp/doc/webapp-publication.txt
@@ -608,7 +608,7 @@ Originally, this variable isn't set.
 It is set during the afterTraversal() hook. The pageid is made of the
 name of the context class and the view class name.
 
-    >>> class TestView(object):
+    >>> class TestView:
     ...     """A very simple view."""
     ...
     ...     def __init__(self, context, request):
@@ -618,7 +618,7 @@ name of the context class and the view class name.
     ...     def __call__(self):
     ...         return u"Result"
 
-    >>> class TestContext(object):
+    >>> class TestContext:
     ...     """Test context object."""
 
     >>> view = TestView(TestContext(), request)
diff --git a/lib/lp/services/webapp/doc/zcmldirectives.txt b/lib/lp/services/webapp/doc/zcmldirectives.txt
index eebfbd2..96dd975 100644
--- a/lib/lp/services/webapp/doc/zcmldirectives.txt
+++ b/lib/lp/services/webapp/doc/zcmldirectives.txt
@@ -21,7 +21,7 @@ important, so we just discard it.
 
     >>> import re, pprint
     >>> atre = re.compile(' at [0-9a-fA-Fx]+')
-    >>> class Context(object):
+    >>> class Context:
     ...    actions = ()
     ...    def action(self, discriminator, callable, args, kw=None):
     ...        self.actions += ((discriminator, callable, args), )
diff --git a/lib/lp/services/webapp/metazcml.py b/lib/lp/services/webapp/metazcml.py
index d8feae0..dcdc374 100644
--- a/lib/lp/services/webapp/metazcml.py
+++ b/lib/lp/services/webapp/metazcml.py
@@ -458,7 +458,7 @@ def page(_context, name, permission, for_,
         if class_ is None:
             new_class = type('SimpleLaunchpadViewClass', (), cdict)
         else:
-            new_class = type(class_.__name__, (class_, object), cdict)
+            new_class = type(class_.__name__, (class_,), cdict)
 
     original_page(_context, name, permission, for_,
         layer=layer, template=template, class_=new_class,
diff --git a/lib/lp/testing/doc/pagetest-helpers.txt b/lib/lp/testing/doc/pagetest-helpers.txt
index dfe3603..6a6e6bd 100644
--- a/lib/lp/testing/doc/pagetest-helpers.txt
+++ b/lib/lp/testing/doc/pagetest-helpers.txt
@@ -7,7 +7,7 @@ doctest environement comes loaded with a bunch of predefined names that
 makes writing page test easy.
 
     >>> from lp.testing.pages import setUpGlobs
-    >>> class MockTest(object):
+    >>> class MockTest:
     ...     def __init__(self):
     ...         self.globs = {}