PyFunction (LanguageLevel languageLevel, String propertyName, String fieldName, AccessDirection accessDirection) { String propertyText; if (accessDirection == AccessDirection.DELETE) { propertyText = "@" + propertyName + ".deleter\ndef " + propertyName + "(self):\n del self." + fieldName; } else if (accessDirection == AccessDirection.WRITE) { propertyText = "@" + propertyName + ".setter\ndef " + propertyName + "(self, value):\n self." + fieldName + " = value"; } else { propertyText = "@property\ndef " + propertyName + "(self):\n return self." + fieldName; } return createFromText(languageLevel, PyFunction.class, propertyText); }