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

All Samples(20)  |  Call(12)  |  Derive(0)  |  Import(8)

        def makeDictCreationOrConstant(keys, values, lazy_order, source_ref):
    # Create dictionary node. Tries to avoid it for constant values that are not
    # mutable.

    assert len( keys ) == len( values )
    for key, value in zip( keys, values ):
        if not key.isExpressionConstantRef():
            constant = False
            break

        if not value.isExpressionConstantRef():
            constant = False
            break
    else:
        constant = True

    # Note: This would happen in optimization instead, but lets just do it
    # immediately to save some time.
    if constant:
        # Unless tolder otherwise, create the dictionary in its full size, so
        # that no growing occurs and the constant becomes as similar as possible
        # before being marshalled.
        return ExpressionConstantRef(
            constant      = Constants.createConstantDict(
                lazy_order = not lazy_order,
                keys       = [ key.getConstant() for key in keys ],
                values     = [ value.getConstant() for value in values ]
            ),
            source_ref    = source_ref,
            user_provided = True
        )
    else:
        return ExpressionMakeDict(
            pairs      = [
                ExpressionKeyValuePair( key, value, key.getSourceReference() )
                for key, value in
                zip( keys, values )
            ],
            lazy_order = lazy_order,
            source_ref = source_ref
        )
        


src/n/u/Nuitka-HEAD/nuitka/tree/Building.py   Nuitka(Download)
 
# Some helpers.
from .Helpers import (
    makeStatementsSequenceOrStatement,
    makeSequenceCreationOrConstant,
def buildDictionaryNode(provider, node, source_ref):
    return makeDictCreationOrConstant(
        keys       = buildNodeList(provider, node.keys, source_ref),
        values     = buildNodeList(provider, node.values, source_ref),
        lazy_order = False,

src/n/u/Nuitka-0.5.1.5/nuitka/tree/Building.py   Nuitka(Download)
 
# Some helpers.
from .Helpers import (
    makeStatementsSequenceOrStatement,
    makeSequenceCreationOrConstant,
def buildDictionaryNode(provider, node, source_ref):
    return makeDictCreationOrConstant(
        keys       = buildNodeList( provider, node.keys, source_ref ),
        values     = buildNodeList( provider, node.values, source_ref ),
        lazy_order = False,

src/n/u/Nuitka-HEAD/nuitka/tree/ReformulationClasses.py   Nuitka(Download)
from nuitka.nodes.ParameterSpecs import ParameterSpec
 
from .Helpers import (
    makeStatementsSequenceFromStatement,
    makeSequenceCreationOrConstant,
            ),
            source       = makeDictCreationOrConstant(
                keys      = [
                    ExpressionConstantRef(
                        constant      = keyword.arg,

src/n/u/Nuitka-HEAD/nuitka/tree/ReformulationFunctionStatements.py   Nuitka(Download)
from nuitka.nodes.AssignNodes import StatementAssignmentVariable
 
from .Helpers import (
    makeStatementsSequenceFromStatement,
    makeDictCreationOrConstant,
 
            kw_defaults = makeDictCreationOrConstant(
                keys       = keys,
                values     = values,
                lazy_order = False,
    if keys:
        return makeDictCreationOrConstant(
            keys       = keys,
            values     = values,
            lazy_order = False,

src/n/u/Nuitka-0.5.1.5/nuitka/tree/ReformulationClasses.py   Nuitka(Download)
from nuitka.nodes.ParameterSpecs import ParameterSpec
 
from .Helpers import (
    makeStatementsSequenceFromStatement,
    makeSequenceCreationOrConstant,
            ),
            source       = makeDictCreationOrConstant(
                keys      = [
                    ExpressionConstantRef(
                        constant      = keyword.arg,

src/n/u/Nuitka-0.5.1.5/nuitka/tree/ReformulationFunctionStatements.py   Nuitka(Download)
from nuitka.nodes.AssignNodes import StatementAssignmentVariable
 
from .Helpers import (
    makeStatementsSequenceFromStatement,
    makeDictCreationOrConstant,
 
            kw_defaults = makeDictCreationOrConstant(
                keys       = keys,
                values     = values,
                lazy_order = False,
    if keys:
        return makeDictCreationOrConstant(
            keys       = keys,
            values     = values,
            lazy_order = False,

src/n/u/Nuitka-HEAD/nuitka/tree/ReformulationCallExpressions.py   Nuitka(Download)
    ExpressionFunctionRef
)
from .Helpers import (
    makeSequenceCreationOrConstant,
    makeDictCreationOrConstant,
            ),
            kw      = makeDictCreationOrConstant(
                keys       = keys,
                values     = values,
                lazy_order = True,
            helper_args.append(
                makeDictCreationOrConstant(
                    keys       = keys,
                    values     = values,
                    lazy_order = True,

src/n/u/Nuitka-0.5.1.5/nuitka/tree/ReformulationCallExpressions.py   Nuitka(Download)
    ExpressionFunctionRef
)
from .Helpers import (
    makeSequenceCreationOrConstant,
    makeDictCreationOrConstant,
            ),
            kw      = makeDictCreationOrConstant(
                keys       = keys,
                values     = values,
                lazy_order = True,
            helper_args.append(
                makeDictCreationOrConstant(
                    keys       = keys,
                    values     = values,
                    lazy_order = True,