title: Can classmethod/staticmethod access attributes of initial caller?
body: <p>I am learning and try to write python api client for some third-party API
  For simplicity:<br />
  I have 2 classes: Session, EndpointGroup:</p>
  <pre class="lang-py prettyprint-override"><code>class Session:
      def __init__(self, token=None):
          self.token = token
          self.group1 = EndpointGroup
  
  class EndpointGroup:
      @classmethod
      def ping(cls, token, **kwargs):
          return f'Calling ping() with params: {kwargs} and token {token}'
            
  </code></pre>
  <p>I have many EndpointGroups which contain same-category api calls.<br />
  I want to give end-user to call methods like this:</p>
  <pre class="lang-py prettyprint-override"><code>session = Session(token='123')
  r = session.group1.ping(data='somedata') # Calling ping with params: {'data':'somedata'} and token 123
  </code></pre>
  <p>I want to pass token to callable automaticly/implicitly so user don't have to on each call pass to callable something like session.group1.ping(data='somedata', token=session.token)<br />
  Is there &quot;built-in&quot; solution to do it? Because with _<em>getattribute</em>_ I only can access EndpointGroup class but not method which is called.<br />
  <strong>What i have already tried:</strong></p>
  <ul>
  <li>Creating instances of EndpointGroup passing session/token (Don't like solution because it creates too many instances for each single session) with _<em>getattribute</em>_</li>
  <li>Let Session inherit EndpointGroup methods, but then I lose desirable &quot;interface&quot; like <strong>session.groupN.method_X</strong> to <strong>session.method_X</strong></li>
  <li>Make in EndpointGroup class attr 'token' and On each call change it so method can access this token of current caller(session) (Don't like this solution because this way I will not be able to work asynchronously)</li>
  </ul>