(printer)
return "unknown"
Return the printer's name.
Return the printer's name.
Return the printer s name .
def printer_name(printer):
        """Return the printer's name."""
        if hasattr(printer, "name"):
            return printer.name
        if hasattr(printer, "__name__"):
            return printer.__name__
        # This "shouldn't happen", but the public API allows for
        # direct additions to the pretty-printer list, and we shouldn't
        # crash because someone added a bogus printer.
        # Plus we want to give the user a way to list unknown printers.
        return "unknown"
def printer_name ( printer ) : if hasattr ( printer , "name" ) : return printer . name if hasattr ( printer , "__name__" ) : return printer . __name__ # This "shouldn't happen", but the public API allows for # direct additions to the pretty-printer list, and we shouldn't # crash because someone added a bogus printer. # Plus we want to give the user a way to list unknown printers. return "unknown"