{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "A type representing "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "numpy.number",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "numpy:number"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " precision during static type checking."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Used exclusively for the purpose of static type checking, "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "NBitBase",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "numpy.typing:NBitBase"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " represents the base of a hierarchical set of subclasses. Each subsequent subclass is herein used for representing a lower level of precision, "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "e.g."
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "64Bit > 32Bit > 16Bit"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "versionadded",
          "base_type": "neutral",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "versionadded 1.20"
                }
              ]
            }
          ]
        },
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "deprecated",
          "base_type": "neutral",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "deprecated 2.3"
                }
              ]
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Use "
                },
                {
                  "__type": "InlineCode",
                  "__tag": 4051,
                  "value": "@typing.overload"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": " or a "
                },
                {
                  "__type": "InlineCode",
                  "__tag": 4051,
                  "value": "TypeVar"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": " with a scalar-type as upper bound, instead."
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/numpy/typing/__init__.py",
  "item_line": null,
  "item_type": "class",
  "aliases": [
    "numpy.typing.NBitBase"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "Below is a typical usage example: `NBitBase` is herein used for annotating\na function that takes a float and integer of arbitrary precision\nas arguments and returns a new float of whichever precision is largest\n(*e.g.* ``np.float16 + np.int64 -> np.float64``).\n\n.. code-block:: python\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "from typing import TypeVar, TYPE_CHECKING\nimport numpy as np\nimport numpy.typing as npt\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "S = TypeVar(\"S\", bound=npt.NBitBase)\nT = TypeVar(\"T\", bound=npt.NBitBase)\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "def add(a: np.floating[S], b: np.integer[T]) -> np.floating[S | T]:\n    return a + b\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "a = np.float16()\nb = np.int64()\nout = add(a, b)\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "if TYPE_CHECKING:\n    reveal_locals()\n    # note: Revealed local types are:\n    # note:     a: numpy.floating[numpy.typing._16Bit*]\n    # note:     b: numpy.signedinteger[numpy.typing._64Bit*]\n    # note:     out: numpy.floating[numpy.typing._64Bit*]\n",
        "execution_status": "success"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "NBitBase"
  },
  "references": null,
  "qa": "numpy.typing:NBitBase",
  "arbitrary": [],
  "local_refs": []
}