Преглед изворни кода

Del `(object)` from 200 inc deeplearning/aicamera/trainer/utils/metrics.py

Summary: Python3 makes the use of `(object)` in class inheritance unnecessary. Let's modernize our code by eliminating this.

Reviewed By: itamaro

Differential Revision: D48673901

fbshipit-source-id: 3e0ef05efe886b32a07bb58bd0725fa2ec934c14
Richard Barnes пре 2 година
родитељ
комит
166ce2c71a
2 измењених фајлова са 3 додато и 3 уклоњено
  1. 2 2
      python/fasttext_module/fasttext/FastText.py
  2. 1 1
      setup.py

+ 2 - 2
python/fasttext_module/fasttext/FastText.py

@@ -24,7 +24,7 @@ EOW = ">"
 displayed_errors = {}
 displayed_errors = {}
 
 
 
 
-class _Meter(object):
+class _Meter:
     def __init__(self, fasttext_model, meter):
     def __init__(self, fasttext_model, meter):
         self.f = fasttext_model
         self.f = fasttext_model
         self.m = meter
         self.m = meter
@@ -77,7 +77,7 @@ class _Meter(object):
         return recall
         return recall
 
 
 
 
-class _FastText(object):
+class _FastText:
     """
     """
     This class defines the API to inspect models and should not be used to
     This class defines the API to inspect models and should not be used to
     create objects. It will be returned by functions such as load_model or
     create objects. It will be returned by functions such as load_model or

+ 1 - 1
setup.py

@@ -26,7 +26,7 @@ FASTTEXT_SRC = "src"
 
 
 # Based on https://github.com/pybind/python_example
 # Based on https://github.com/pybind/python_example
 
 
-class get_pybind_include(object):
+class get_pybind_include:
     """Helper class to determine the pybind11 include path
     """Helper class to determine the pybind11 include path
 
 
     The purpose of this class is to postpone importing pybind11
     The purpose of this class is to postpone importing pybind11