Liste des Groupes | Revenir à cl misc |
On Wed, 28 Aug 2024 19:19:38 -0700, Keith Thompson wrote:My impression is that your unconventional style indicates a relative>
lack of experience in Python.
You think maybe I should practise by writing more Python code?
OK, how about your thoughts on comparing this
>
for attrname in obj.tag_attrs :
attr = getattr(obj, attrname)
if attr != None :
if isinstance(attr, enum.Enum) :
attr = attr.value
elif isinstance(attr, Type) :
attr = unparse_signature(attr)
elif not isinstance(attr, str) :
raise TypeError("unexpected attribute type %s for %s" % (type(attr).__name__, repr(attr)))
attrs.append("%s=%s" % (attrname, quote_xml_attr(attr)))
out.write(" " * indent + "<" + tag_name)
>
with this
>
for attrname in obj.tag_attrs :
attr = getattr(obj, attrname)
if attr != None :
if isinstance(attr, enum.Enum) :
attr = attr.value
elif isinstance(attr, Type) :
attr = unparse_signature(attr)
elif not isinstance(attr, str) :
raise TypeError("unexpected attribute type %s for %s" % (type(attr).__name__, repr(attr)))
attrs.append("%s=%s" % (attrname, quote_xml_attr(attr)))
out.write(" " * indent + "<" + tag_name)
Les messages affichés proviennent d'usenet.