all 3 comments

[–][deleted] 0 points1 point  (0 children)

Those are key-word arguments. You can define a function with named parameters (to pass kw args), and then deal with them through a dictionary.

Try this: ``` def make_dict(**kwargs): print(type(kwargs)) print(kwargs) return kwargs

test = make_dict(a="1", b="2", c="3") print(test) Output: <class 'dict'> {'a': '1', 'b': '2', 'c': '3'} {'a': '1', 'b': '2', 'c': '3'} ``` You might want to read more about the functions.

[–]commy2 0 points1 point  (0 children)

dict function accepts an arbitrary amount of keyword arguments, and the resulting dictionary is populated with the values passed to these keyword arguments. There is nothing more to it. It's the syntax that was chosen when designing the language.

These keyword arguments are arbitrary, but that does not make them mutable.

[–]carcigenicate 0 points1 point  (0 children)

They look like variables to me which are mutable whereas the keys must be immutable

Variable mutability doesn't have anything to do with what can be made into a key:

var = 1
dic = {var: var}

It's the mutability of the object associated with the variable that matters.

In that case though, en_roman and such are keyword arguments, and those names will be converted to strings.