def __new__(cls, qname):
    """Create the `QName` instance.
        
        :param qname: the qualified name as a string of the form
                      ``{namespace-uri}local-name``, where the leading curly
                      brace is optional
        """
    if type(qname) is cls:
        return qname
    qname = qname.lstrip('{')
    parts = qname.split('}', 1)
    if len(parts) > 1:
        self = str.__new__(cls, '{%s' % qname)
        self.namespace, self.localname = list(map(str, parts))
    else:
        self = str.__new__(cls, qname)
        self.namespace, self.localname = None, str(qname)
    return self
