Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(5)  |  Derive(0)  |  Import(1)

            def new_set(node, iterable=()):
        elts = sort_set_elts(iterable)
        elts = _new_constant_list(node, elts)
        return new_set_elts(node, elts)

src/a/s/astoptimizer-0.6/astoptimizer/optimizer.py   astoptimizer(Download)
if PYTHON27:
    from astoptimizer.ast_tools import new_set, new_set_elts
DROP_NODE = object()
            # Python 3.2+ bytecode peepholer replaces x in {1, 2} with x in
            # frozenset({1, 2}), where frozenset({1, 2}) is a constant.
            return new_set(data, constant)
    def visit_Compare(self, node):
            if (PYTHON27
            and qualname == 'set'):
                return new_set(node)
            if arg is not UNSET:
                del node.args[0]
                        if use_literal_set:
                            # set((1, 2, 3)) => {1, 2, 3}
                            return new_set(node, elts)
                            # frozenset("abab") => frozenset(("a", "b"))
        literal = sort_set_elts(literal)
        if PYTHON27:
            return new_set(node, literal)
            return new_tuple(node, literal)