From:
WPS420 — Forbid some python keywords.
pass keyword is just useless by design. There’s no use-case for it. Because it does literally nothing.
This is a snippet from a selector. In short, we need at the end a copy of render_data. We can get render_data out of doc, but sometimes we have only the data and no doc in sight.
class RenderSettings(object):
def __init__(
self,
doc: Optional[c4d.documents.BaseDocument] | None = None,
render_data: Optional[RenderData] | None = None,
):
match (doc, render_data):
case (None, None):
doc = c4d.documents.GetActiveDocument()
render_data = doc.GetActiveRenderData()
case (None, _):
pass
case (_, None):
render_data = doc.GetActiveRenderData()
case (_, _):
raise ValueError("doc and render_data are mutually exclusive.")
if render_data is None:
raise RuntimeError("No render data found.")
self.rd: RenderData = render_data.GetClone()
It would seem, I literally want to just exit the match-case in a case where we have only render_data at the input.
Am I missing something?
From:
WPS420 — Forbid some python keywords.
This is a snippet from a selector. In short, we need at the end a copy of render_data. We can get render_data out of doc, but sometimes we have only the data and no doc in sight.
It would seem, I literally want to just exit the match-case in a case where we have only render_data at the input.
Am I missing something?