Skip to main content

PEP 561 type stubs for pycparser

Project description

pycparser-stubs

Type information for pycparser.

warning

This typing stub package is mainly written according to C language section of cppreference.com and runtime tests, so there can be wrong annotations.
Also, I haven't tested it with mypy, but it is usable with Pylance.

type alias

All type alias only exist in this package and is not avaliable at runtime. Put them in quotes if you want you use them to annotate. For example:

from pycparser import c_ast

def get_decl_name(decl: 'c_ast.Declarator') -> str:
    while type(decl) != c_ast.TypeDecl:
        decl = decl.type
    return decl.declname or ''

Without quotes you will get:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'pycparser.c_ast' has no attribute 'Declarator'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pycparser_stubs-0.0.1-py3-none-any.whl (10.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page