Even after @Mickey Perlstein's answer and his 3 hours of detective work, it still took me a few more minutes to apply this in my own mess. In case someone is like me and needs additional help, this is what happened in my situation.
- Reviews is a module
- The response is the base class in the response module.
- GeoJsonResponse is a new class derived from Response
GeoJsonResponse starter class:
from pyexample.responses import Response class GeoJsonResponse(Response): def __init__(self, geo_json_data):
Looks good. No problem until you try to debug this thing when you get a bunch of seemingly vague error messages like this:
from pyexample.responses import GeoJsonResponse .. \ pyexample \ response \ GeoJsonResponse.py: 12: into the (module) class GeoJsonResponse (Response):
E TypeError: module () accepts no more than 2 arguments (given 3)
==================================== ERRORS ============== ========================
___________________ ERROR collecting tests /test_geojson.py ____________________
test_geojson.py:2: in (module) from pyexample.responses import GeoJsonResponse .. \ pyexample \ response \ GeoJsonResponse.py: 12: in (module)
Class GeoJsonResponse (Response): E TypeError: module () accepts no more than 2 arguments (3 given)
ERROR: not found: \ PyExample \ tests \ test_geojson.py :: TestGeoJson :: test_api_response
C:. \ Python37 \ Lib \ site packages \ aenum__init __ ne: 163
(without the name 'PyExample \ tests \ test_geojson.py :: TestGeoJson :: test_api_response' in any of [])
The errors did their best to point me in the right direction, and @Mickey Perlstein's answer was dead, it took me just one minute to put it all together in my own context:
I imported the module :
from pyexample.responses import Response
when i had to import the class :
from pyexample.responses.Response import Response
Hope this helps someone. (In my defense, it's still pretty early.)