class_docstr: class that mimics the necessary behaviour of optparse.Option
  
  it's currently a least effort implementation
  and ignoring choices and integer prefixes
  https://docs.python.org/3/library/optparse.html#optparse-standard-option-types
docstr: store parms in private vars for use in add_argument
docstr_tok: ["store","parms","in","private","vars","for","use","in","add_argument"]
code: def __init__(self, *names, **attrs):
      """store parms in private vars for use in add_argument"""
      self._attrs = attrs
      self._short_opts = []
      self._long_opts = []
      self.dest = attrs.get("dest")
      if "%default" in (attrs.get("help") or ""):
          warnings.warn(
              'pytest now uses argparse. "%default" should be'
              ' changed to "%(default)s" ',
              DeprecationWarning,
              stacklevel=3,
          )
      try:
          typ = attrs["type"]
      except KeyError:
          pass
      else:
          # this might raise a keyerror as well, don't want to catch that
          if isinstance(typ, six.string_types):
              if typ == "choice":
                  warnings.warn(
                      "`type` argument to addoption() is the string %r."
                      " For choices this is optional and can be omitted, "
                      " but when supplied should be a type (for example `str` or `int`)."
                      " (options: %s)" % (typ, names),
                      DeprecationWarning,
                      stacklevel=4,
                  )
                  # argparse expects a type here take it from
                  # the type of the first element
                  attrs["type"] = type(attrs["choices"][0])
              else:
                  warnings.warn(
                      "`type` argument to addoption() is the string %r, "
                      " but when supplied should be a type (for example `str` or `int`)."
                      " (options: %s)" % (typ, names),
                      DeprecationWarning,
                      stacklevel=4,
                  )
                  attrs["type"] = Argument._typ_map[typ]
              # used in test_parseopt -> test_parse_defaultgetter
              self.type = attrs["type"]
          else:
              self.type = typ
      try:
          # attribute existence is tested in Config._processopt
          self.default = attrs["default"]
      except KeyError:
          pass
      self._set_opt_strings(names)
      if not self.dest:
          if self._long_opts:
              self.dest = self._long_opts[0][2:].replace("-", "_")
          else:
              try:
                  self.dest = self._short_opts[0][1:]
              except IndexError:
                  raise ArgumentError(
                      "need a long or short option", self
                  )
  
imports: import argparse
  import warnings
  import py
  import six
  from _pytest.config.exceptions import UsageError
label_desc: Use image node_id 1 to create a new Argument object from inherited base classes: object with example: obj = Argument()