mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
942cf50735
Package revng's python code in two wheels: `revng` and `revng_internal`.
The revng wheel contains the
`revng.{pipeline_description,model,tupletree}` modules, while the
`revng_internal` one everything under `revng.internal`.
31 lines
696 B
Python
31 lines
696 B
Python
#
|
|
# This file is distributed under the MIT License. See LICENSE.md for details.
|
|
#
|
|
|
|
from dataclasses import dataclass
|
|
from typing import Generic, TypeVar
|
|
|
|
from ._capi import _api
|
|
from .utils import make_python_string
|
|
|
|
|
|
class Invalidations:
|
|
def __init__(self, invalidations=None):
|
|
if invalidations is None:
|
|
self._invalidations = _api.rp_invalidations_create()
|
|
else:
|
|
self._invalidations = invalidations
|
|
|
|
def __str__(self):
|
|
res = _api.rp_invalidations_serialize(self._invalidations)
|
|
return make_python_string(res)
|
|
|
|
|
|
T = TypeVar("T")
|
|
|
|
|
|
@dataclass
|
|
class ResultWithInvalidations(Generic[T]):
|
|
result: T
|
|
invalidations: Invalidations
|