pyGHDL.libghdl.file_comments

Variables

Functions


Variables

pyGHDL.libghdl.file_comments.Comment_Index

Type variable.

The preferred way to construct a type variable is via the dedicated syntax for generic functions, classes, and type aliases:

class Sequence[T]:  # T is a TypeVar
    ...

This syntax can also be used to create bound and constrained type variables:

# S is a TypeVar bound to str
class StrSequence[S: str]:
    ...

# A is a TypeVar constrained to str or bytes
class StrOrBytesSequence[A: (str, bytes)]:
    ...

Type variables can also have defaults:

class IntDefault[T = int]:

However, if desired, reusable type variables can also be constructed manually, like so:

T = TypeVar('T')  # Can be anything
S = TypeVar('S', bound=str)  # Can be any subtype of str
A = TypeVar('A', str, bytes)  # Must be exactly str or bytes
D = TypeVar('D', default=int)  # Defaults to int

Type variables exist primarily for the benefit of static type checkers. They serve as the parameters for generic types as well as for generic function and type alias definitions.

The variance of type variables is inferred by type checkers when they are created through the type parameter syntax and when infer_variance=True is passed. Manually created type variables may be explicitly marked covariant or contravariant by passing covariant=True or contravariant=True. By default, manually created type variables are invariant. See PEP 484 and PEP 695 for more details.

~Comment_Index
pyGHDL.libghdl.file_comments.No_Comment_Index

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer iteral. >>> int(‘0b100’, base=0) 4

0

Functions

pyGHDL.libghdl.file_comments.Find_First_Comment(File, N)[source]

Get the first comment associated to a node. :type N: c_uint :param N: Node :type File: TypeVar(SourceFileEntry, bound= c_uint) :param File: Source file for node

Return type:

TypeVar(Comment_Index, bound= c_uint)

Returns:

The first comment index, or No_Comment_Index if none.

Parameters:
pyGHDL.libghdl.file_comments.Get_Comment_Start(File, Idx)[source]

Get the start of comment

Return type:

TypeVar(SourcePtr, bound= c_int)

Parameters:
pyGHDL.libghdl.file_comments.Get_Comment_Last(File, Idx)[source]

Get the end of comment

Return type:

TypeVar(SourcePtr, bound= c_int)

Parameters:
pyGHDL.libghdl.file_comments.Get_Next_Comment(File, Idx)[source]

Get the next comment

Return type:

TypeVar(Comment_Index, bound= c_uint)

Parameters: