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

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file pycparser_stubs-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pycparser_stubs-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da151eeadd011073f43c60b3c79550ffd4ede9d8740b7c0ef3e1ce2337fdc7d0
MD5 f2cf273099a36c42416f511145616ebb
BLAKE2b-256 4fad8ab1fe8c587d8eed762c95955e67ef1b7ed3d504ddffc69b14f335bb81c1

See more details on using hashes here.

Supported by

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