src/basilisp/lang/reader.py
def _read_set(ctx: ReaderContext) -> lset.Set:
    """Return a set from the input stream."""
    start = ctx.reader.advance()
    assert start == "{"

    def set_if_valid(s: Collection) -> lset.Set:
        if len(s) != len(set(s)):
            raise SyntaxError("Duplicated values in set")
        return lset.set(s)

    return _read_coll(ctx, set_if_valid, "}", "set")
def _read_set(ctx: ReaderContext) -> lset.Set:
    start = ctx.reader.advance()
    assert start == "{"

    def set_if_valid(s: Collection) -> lset.Set:
        if len(s) != len(set(s)):
            raise SyntaxError("Duplicated values in set")
        return lset.set(s)

    return _read_coll(ctx, set_if_valid, "}", "set")
def _read_set ( ctx : ReaderContext ) -> lset . Set : start = ctx . reader . advance ( ) assert start == "{" def set_if_valid ( s : Collection ) -> lset . Set : if len ( s ) != len ( set ( s ) ) : raise SyntaxError ( "Duplicated values in set" ) return lset . set ( s ) return _read_coll ( ctx , set_if_valid , "}" , "set" )
Return a set from the input stream.
Return a set from the input stream .