Is there a Pythonic way to grab a property if an object exists on one line of code? Currently in the code below if someone passes in a None type object the code will break, so I need some clean way to check that it is not None, but on one line of code. C# has the ?.
syntax that works really well, so looking for something like that.
class MyClass:
def __init__():
self.my_property = "Hello, World!"
def print_class_property(myClassInstance):
print(myClassInstance???.my_property) # Here is where I need something inline