Skip to content

Instantly share code, notes, and snippets.

Created July 26, 2013 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/6088906 to your computer and use it in GitHub Desktop.
Save anonymous/6088906 to your computer and use it in GitHub Desktop.
/* long-hand */
public class MyClass
{
string _myString;
public string MyString
{
get { return _myString; }
set { _myString = value; }
}
}
/* short-hand */
public class MyClass
{
public string MyString { get; set; }
}
class MyClass:
def __init__(self):
self._myString = None
@property
def myString(self):
return self._myString
@myString.setter
def set_myString(self, value):
self._myString = value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment