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

All Samples(12)  |  Call(7)  |  Derive(0)  |  Import(5)
Make a statement sequence, but only if more than one statement

Useful for when we can unroll constructs already here, but are not sure if
we actually did that. This avoids the branch or the pollution of doing it
always.

        def makeStatementsSequenceOrStatement(statements, source_ref):
    """ Make a statement sequence, but only if more than one statement

    Useful for when we can unroll constructs already here, but are not sure if
    we actually did that. This avoids the branch or the pollution of doing it
    always.
    """

    if len(statements) > 1:
        return StatementsSequence(
            statements = mergeStatements(statements),
            source_ref = source_ref
        )
    else:
        return statements[0]
        


src/n/u/Nuitka-HEAD/nuitka/tree/Building.py   Nuitka(Download)
 
# Some helpers.
from .Helpers import (
    makeStatementsSequenceOrStatement,
    makeSequenceCreationOrConstant,
    # have a sequence of imports that only import one thing therefore.
    return makeStatementsSequenceOrStatement(
        statements = import_nodes,
        source_ref = source_ref
    )

src/n/u/Nuitka-0.5.1.5/nuitka/tree/Building.py   Nuitka(Download)
 
# Some helpers.
from .Helpers import (
    makeStatementsSequenceOrStatement,
    makeSequenceCreationOrConstant,
    # have a sequence of imports that only import one thing therefore.
    return makeStatementsSequenceOrStatement(
        statements = import_nodes,
        source_ref = source_ref
    )

src/n/u/Nuitka-HEAD/nuitka/tree/ReformulationTryFinallyStatements.py   Nuitka(Download)
from nuitka.nodes.TryNodes import StatementTryFinally
 
from .Helpers import (
    makeStatementsSequenceFromStatement,
    makeStatementsSequenceOrStatement,
 
    return makeStatementsSequenceOrStatement(
        statements = statements,
        source_ref = source_ref
    )

src/n/u/Nuitka-HEAD/nuitka/tree/ReformulationAssignmentStatements.py   Nuitka(Download)
from nuitka.nodes.SliceNodes import ExpressionSliceLookup
 
from .Helpers import (
    makeStatementsSequenceFromStatement,
    makeStatementsSequenceOrStatement,
 
        return makeStatementsSequenceOrStatement(
            statements = result,
            source_ref = source_ref
        )
 
    return makeStatementsSequenceOrStatement(
        statements = statements,
        source_ref = source_ref
    )

src/n/u/Nuitka-0.5.1.5/nuitka/tree/ReformulationAssignmentStatements.py   Nuitka(Download)
from nuitka.nodes.SliceNodes import ExpressionSliceLookup
 
from .Helpers import (
    makeStatementsSequenceFromStatement,
    makeStatementsSequenceOrStatement,
 
        return makeStatementsSequenceOrStatement(
            statements = result,
            source_ref = source_ref
        )
 
    return makeStatementsSequenceOrStatement(
        statements = statements,
        source_ref = source_ref
    )