-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace py::object type by optional<std::string> for name parameters #1446
Replace py::object type by optional<std::string> for name parameters #1446
Conversation
Signed-off-by: Jean-Christophe Morin <[email protected]>
Are you asking, specifically with regards to this PR, should we replace the |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1446 +/- ##
=======================================
Coverage 78.83% 78.84%
=======================================
Files 203 203
Lines 22252 22248 -4
Branches 4521 4519 -2
=======================================
- Hits 17543 17542 -1
Misses 2437 2437
+ Partials 2272 2269 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Specifically with regards to this PR. |
Ok, my first question would be if you make it not-optional, would there be a lot of work on adapters and other py based tools to introduce names where maybe there are none presently? |
When I remove the diff --git a/src/py-opentimelineio/opentimelineio/adapters/fcp_xml.py b/src/py-opentimelineio/opentimelineio/adapters/fcp_xml.py
index 98e1fd1..4d60e3a 100644
--- a/src/py-opentimelineio/opentimelineio/adapters/fcp_xml.py
+++ b/src/py-opentimelineio/opentimelineio/adapters/fcp_xml.py
@@ -738,7 +738,7 @@ class FCP7XMLParser:
"""
local_context = context.context_pushing_element(track_element)
name_element = track_element.find("./name")
- track_name = (name_element.text if name_element is not None else None)
+ track_name = (name_element.text if name_element is not None else '')
timeline_item_tags = {"clipitem", "generatoritem", "transitionitem"} At least all tests are passing with this change.
|
ok, sounds good to me. |
@ssteinbach @meshula what should we do about the inconsistency of the |
From TSC meeting: The change of no longer accepting |
Perfect, I'll create a PR later this week. Thanks! |
…cademySoftwareFoundation#1446) Signed-off-by: Jean-Christophe Morin <[email protected]> Signed-off-by: Michele Spina <[email protected]>
Summarize your change.
Yet another type improvement. This time, I'm changing the
name
parameters to be explicit about which types they accept. They accept either None or a string.Note that this has a side effect. Before, the
name
parameters would accept anything (because ofpy::object
), which means that passing a dict would produce"{}"
for example. I think it's fine if we stop supporting this as it was probably not intentional in the first place.Question for the TSC: Some constructors use
std::string
for thename
parameter while some others acceptNone
or string. Should we simply just remove support for None? That would simplify things and also make it consistent across constructors.