What is the simplest way to define setter and getter in Python
What is the simplest way to define setter and getter in Python? Is there anything like in C# 

    public int Prop {get; set;}


How to make it like this? Since to write both setter and getter methods for one property like this is just too much work.

    class MyClass():
        def foo_get(self):
            return self._foo
    
        def foo_set(self, val):
            _foo = val
    
        foo = property(foo_get, foo_set)


Thanks in advance!
What is the simplest way to define setter and getter in Python
===

What is the simplest way to define setter and getter in Python? Is there anything like in C# 

    public int Prop {get; set;}


How to make it like this? Since to write both setter and getter methods for one property like this is just too much work.

    class MyClass():
        def foo_get(self):
            return self._foo
    
        def foo_set(self, val):
            _foo = val
    
        foo = property(foo_get, foo_set)


Thanks in advance!