Yes, it's as pythonic as such an non-Python object can be.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Thu, 9 Jul 2020 20:16:26 +0000 (22:16 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Thu, 9 Jul 2020 20:16:26 +0000 (22:16 +0200)
lagarde.py

index 711dc1d2a0e529c3b2b613fcefcb4400ad52837e..140ccd8d64d6e8ae8ab7c75bfa40afaebf52b78c 100755 (executable)
@@ -58,11 +58,8 @@ class Lagarde:
             return
 
         caps = pad.get_current_caps()
-        # assert (len(caps)) # we have a Gst.Caps object and it has no length
-        # s = caps[0] # also, it's not a list
         padsize = caps.get_size()
-        assert(padsize > 0)
-        for i in range(padsize): # pythonic?!
+        for i in range(padsize):
             s = caps.get_structure(i) # Gst.Structure
             name = s.get_name()
             if name.startswith('video'):