You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to only specify a custom return type?
In my case, I want to specify tuple[list[int], fractions.Fraction, fractions.Fraction] instead of def get_pts(self, filename: str, index: int) -> tuple[list[int], fractions.Fraction, fractions.Fraction].
NB_MODULE(abc_video_provider, m) {
nanobind::class_<ABCVideoProvider>(m, "ABCVideoProvider")
.def(
"get_pts",
&ABCVideoProvider::get_pts,
nanobind::arg("filename"),
nanobind::arg("index"),
nanobind::sig("def get_pts(self, filename: str, index: int) -> tuple[list[int], fractions.Fraction, fractions.Fraction]"),
R"doc( Parameters: filename (str): A video path. index (int): Index of the video stream. Returns: A tuple containing these 3 informations: 1. A list of each pts sorted. 2. The time_base. 3. The fps.)doc"
);
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to only specify a custom return type?
In my case, I want to specify
tuple[list[int], fractions.Fraction, fractions.Fraction]instead ofdef get_pts(self, filename: str, index: int) -> tuple[list[int], fractions.Fraction, fractions.Fraction].Beta Was this translation helpful? Give feedback.
All reactions