@ SuppressWarnings ( "static-method" ) protected boolean generatePythonClassDeclaration ( String typeName , boolean isAbstract , List < ? extends JvmTypeReference > superTypes , String comment , boolean ignoreObjectType , PyAppendable it , IExtraLanguageGeneratorContext context ) { if ( ! Strings . isEmpty ( typeName ) ) { it . append ( "class " ) . append ( typeName ) . append ( "(" ) ; //$NON-NLS-1$ //$NON-NLS-2$ boolean isOtherSuperType = false ; boolean first = true ; for ( final JvmTypeReference reference : superTypes ) { if ( ! ignoreObjectType || ! Strings . equal ( reference . getQualifiedName ( ) , Object . class . getCanonicalName ( ) ) ) { isOtherSuperType = true ; if ( first ) { first = false ; } else { it . append ( "," ) ; //$NON-NLS-1$ } it . append ( reference . getType ( ) ) ; } } if ( isOtherSuperType ) { it . append ( "," ) ; //$NON-NLS-1$ } // Add "object to avoid a bug within the Python interpreter. it . append ( "object):" ) ; //$NON-NLS-1$ it . increaseIndentation ( ) . newLine ( ) ; generateDocString ( comment , it ) ; return true ; } return false ; }
Generate the type declaration for a Python class .