Can't set bin type on CullBinManager

Hey, I am trying to set bin type for optimization like this:

CullBinManager.setBinType("opaque",CullBinManager.BT_front_to_back)

However, I get this exception:

TypeError: descriptor 'setBinType' requires a 'panda3d.core.CullBinManager' object but received a 'str'

Which seems like the setBinType method needs a class instance, but it should be a static class method from what I have read.

If I do

CullBinManager.setBinType(name="opaque",type=CullBinManager.BT_front_to_back)

I get

TypeError: descriptor 'setBinType' of 'panda3d.core.CullBinManager' object needs an argument

I am using Panda 1.9.0 on Ubuntu. Is this caused by the unstable version or is it something else? I’d be extremely glad if anyone could help.

OK, I found a solution, so maybe if someone sometime is looking for it:

cull_bin_manager = CullBinManager.getGlobalPtr() 
cull_bin_manager.setBinType(name="opaque",type=CullBinManager.BT_front_to_back)