Concatenation of the result of a function with a mutable default argument in pythonCalling a function of a module by using its name (a string)“Least Astonishment” and the Mutable Default ArgumentHow do I concatenate two lists in Python?Good uses for mutable function argument default values?Instantiation time for mutable default arguments of closures in PythonWarning about mutable default argument in PyCharmFunctions with mutable default values

Church Booleans

Concatenation of the result of a function with a mutable default argument in python

Sleeping solo in a double sleeping bag

Check in to 2 hotels at same location

If all stars rotate, why was there a theory developed, that requires non-rotating stars?

Three Singles in Three Clubs

Was Switzerland really impossible to invade during WW2?

Fried gnocchi with spinach, bacon, cream sauce in a single pan

Defense against attacks using dictionaries

Why did this happen to Thanos's ships at the end of "Avengers: Endgame"?

The teacher logged me in as administrator for doing a short task, is the whole system now compromised?

LeetCode: Pascal's Triangle C#

Why did MS-DOS applications built using Turbo Pascal fail to start with a division by zero error on faster systems?

Why is my Earth simulation slower than the reality?

How do I make distance between concentric circles equal?

Why doesn't the Falcon-9 first stage use three legs to land?

Avoiding racist tropes in fantasy

How do I find the fastest route from Heathrow to an address in London using all forms of transport?

If the first law of thermodynamics ensures conservation of energy, why does it allow systems to lose energy?

IndexOptimize - Configuration

Why does The Ancient One think differently about Doctor Strange in Endgame than the film Doctor Strange?

What professions would a medieval village with a population of 100 need?

Why is observed clock rate < 3MHz on Arduino Uno?

Is refusing to concede in the face of an unstoppable Nexus combo punishable?



Concatenation of the result of a function with a mutable default argument in python


Calling a function of a module by using its name (a string)“Least Astonishment” and the Mutable Default ArgumentHow do I concatenate two lists in Python?Good uses for mutable function argument default values?Instantiation time for mutable default arguments of closures in PythonWarning about mutable default argument in PyCharmFunctions with mutable default values






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








17















Suppose a function with a mutable default argument:



def f(l=[]):
l.append(len(l))
return l


If I run this:



def f(l=[]):
l.append(len(l))
return l
print(f()+["-"]+f()+["-"]+f()) # -> [0, '-', 0, 1, '-', 0, 1, 2]


If I run this:



def f(l=[]):
l.append(len(l))
return l
print(f()+f()+f()) # -> [0, 1, 0, 1, 0, 1, 2]


Instead of this, which would be more logical:



print(f()+f()+f()) # -> [0, 0, 1, 0, 1, 2]


Why ?










share|improve this question


























  • if you want to see the result of individual functional call then use return [l.copy()]

    – prashant rana
    8 hours ago











  • Well the last funciont returns me this: [0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5]

    – Celius Stingher
    8 hours ago











  • @CeliusStingher You have to redefine the function between uses.

    – Benoît Pilatte
    8 hours ago











  • with - you will be able to distinguish between your data from each functional call , in second one you need to write a code to get the pattern

    – prashant rana
    8 hours ago

















17















Suppose a function with a mutable default argument:



def f(l=[]):
l.append(len(l))
return l


If I run this:



def f(l=[]):
l.append(len(l))
return l
print(f()+["-"]+f()+["-"]+f()) # -> [0, '-', 0, 1, '-', 0, 1, 2]


If I run this:



def f(l=[]):
l.append(len(l))
return l
print(f()+f()+f()) # -> [0, 1, 0, 1, 0, 1, 2]


Instead of this, which would be more logical:



print(f()+f()+f()) # -> [0, 0, 1, 0, 1, 2]


Why ?










share|improve this question


























  • if you want to see the result of individual functional call then use return [l.copy()]

    – prashant rana
    8 hours ago











  • Well the last funciont returns me this: [0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5]

    – Celius Stingher
    8 hours ago











  • @CeliusStingher You have to redefine the function between uses.

    – Benoît Pilatte
    8 hours ago











  • with - you will be able to distinguish between your data from each functional call , in second one you need to write a code to get the pattern

    – prashant rana
    8 hours ago













17












17








17


1






Suppose a function with a mutable default argument:



def f(l=[]):
l.append(len(l))
return l


If I run this:



def f(l=[]):
l.append(len(l))
return l
print(f()+["-"]+f()+["-"]+f()) # -> [0, '-', 0, 1, '-', 0, 1, 2]


If I run this:



def f(l=[]):
l.append(len(l))
return l
print(f()+f()+f()) # -> [0, 1, 0, 1, 0, 1, 2]


Instead of this, which would be more logical:



print(f()+f()+f()) # -> [0, 0, 1, 0, 1, 2]


Why ?










share|improve this question
















Suppose a function with a mutable default argument:



def f(l=[]):
l.append(len(l))
return l


If I run this:



def f(l=[]):
l.append(len(l))
return l
print(f()+["-"]+f()+["-"]+f()) # -> [0, '-', 0, 1, '-', 0, 1, 2]


If I run this:



def f(l=[]):
l.append(len(l))
return l
print(f()+f()+f()) # -> [0, 1, 0, 1, 0, 1, 2]


Instead of this, which would be more logical:



print(f()+f()+f()) # -> [0, 0, 1, 0, 1, 2]


Why ?







python python-3.x






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 8 hours ago







Benoît Pilatte

















asked 8 hours ago









Benoît PilatteBenoît Pilatte

1,6274 silver badges23 bronze badges




1,6274 silver badges23 bronze badges















  • if you want to see the result of individual functional call then use return [l.copy()]

    – prashant rana
    8 hours ago











  • Well the last funciont returns me this: [0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5]

    – Celius Stingher
    8 hours ago











  • @CeliusStingher You have to redefine the function between uses.

    – Benoît Pilatte
    8 hours ago











  • with - you will be able to distinguish between your data from each functional call , in second one you need to write a code to get the pattern

    – prashant rana
    8 hours ago

















  • if you want to see the result of individual functional call then use return [l.copy()]

    – prashant rana
    8 hours ago











  • Well the last funciont returns me this: [0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5]

    – Celius Stingher
    8 hours ago











  • @CeliusStingher You have to redefine the function between uses.

    – Benoît Pilatte
    8 hours ago











  • with - you will be able to distinguish between your data from each functional call , in second one you need to write a code to get the pattern

    – prashant rana
    8 hours ago
















if you want to see the result of individual functional call then use return [l.copy()]

– prashant rana
8 hours ago





if you want to see the result of individual functional call then use return [l.copy()]

– prashant rana
8 hours ago













Well the last funciont returns me this: [0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5]

– Celius Stingher
8 hours ago





Well the last funciont returns me this: [0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5]

– Celius Stingher
8 hours ago













@CeliusStingher You have to redefine the function between uses.

– Benoît Pilatte
8 hours ago





@CeliusStingher You have to redefine the function between uses.

– Benoît Pilatte
8 hours ago













with - you will be able to distinguish between your data from each functional call , in second one you need to write a code to get the pattern

– prashant rana
8 hours ago





with - you will be able to distinguish between your data from each functional call , in second one you need to write a code to get the pattern

– prashant rana
8 hours ago












1 Answer
1






active

oldest

votes


















18













That's actually pretty interesting!



As we know, the list l in the function definition is initialized only once at the definition of this function, and for all invocations of this function, there will be exactly one copy of this list. Now, the function modifies this list, which means that multiple calls to this function will modify the exact same object multiple times. This is the first important part.



Now, consider the expression that adds these lists:



f()+f()+f()


According to the laws of operator precedence, this is equivalent to the following:



(f() + f()) + f()


...which is exactly the same as this:



temp1 = f() + f() # (1)
temp2 = temp1 + f() # (2)


This is the second important part.



Addition of lists produces a new object, without modifying any of its arguments. This is the third important part.



Now let's combine what we know together.



In line 1 above, the first call returns [0], as you'd expect. The second call returns [0, 1], as you'd expect. Oh, wait! The function will return the exact same object (not its copy!) over and over again, after modifying it! This means that the object that the first call returned has now changed to become [0, 1] as well! And that's why temp1 == [0, 1] + [0, 1].



The result of addition, however, is a completely new object, so [0, 1, 0, 1] + f() is the same as [0, 1, 0, 1] + [0, 1, 2]. Note that the second list is, again, exactly what you'd expect your function to return. The same thing happens when you add f() + ["-"]: this creates a new list object, so that any other calls to f won't interfere with it.



You can reproduce this by concatenating the results of two function calls:



>>> f() + f()
[0, 1, 0, 1]
>>> f() + f()
[0, 1, 2, 3, 0, 1, 2, 3]
>>> f() + f()
[0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5]


Again, you can do all that because you're concatenating references to the same object.






share|improve this answer



























  • Wow, 🤯. The best thing about this answer is that it is right. []+f()+f() gives [0, 0, 1] and f()+f()+[] gives [0, 1, 0, 1] !!!

    – Benoît Pilatte
    8 hours ago







  • 2





    The new object returned by + is definitely the key here, it's so subtle

    – C.Nivs
    8 hours ago






  • 1





    A good reminder for why a mutable default argument is a big no-no.

    – EliadL
    8 hours ago






  • 2





    Looked into dis(lambda: f()+f()+f()) and the function f did get called twice before add is performed. Great answer btw.

    – Henry Yik
    7 hours ago






  • 1





    @HenryYik it's because of how list.__add__ is implemented. The first f() instantiates the list object, let's call it l1. Then l1.__add__(f()) is called, so, f() needs to be evaluated first, which changes the reference that is shared with l1. Then l1.__add__(l2) finishes, returning the new object.

    – C.Nivs
    7 hours ago










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f57593294%2fconcatenation-of-the-result-of-a-function-with-a-mutable-default-argument-in-pyt%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









18













That's actually pretty interesting!



As we know, the list l in the function definition is initialized only once at the definition of this function, and for all invocations of this function, there will be exactly one copy of this list. Now, the function modifies this list, which means that multiple calls to this function will modify the exact same object multiple times. This is the first important part.



Now, consider the expression that adds these lists:



f()+f()+f()


According to the laws of operator precedence, this is equivalent to the following:



(f() + f()) + f()


...which is exactly the same as this:



temp1 = f() + f() # (1)
temp2 = temp1 + f() # (2)


This is the second important part.



Addition of lists produces a new object, without modifying any of its arguments. This is the third important part.



Now let's combine what we know together.



In line 1 above, the first call returns [0], as you'd expect. The second call returns [0, 1], as you'd expect. Oh, wait! The function will return the exact same object (not its copy!) over and over again, after modifying it! This means that the object that the first call returned has now changed to become [0, 1] as well! And that's why temp1 == [0, 1] + [0, 1].



The result of addition, however, is a completely new object, so [0, 1, 0, 1] + f() is the same as [0, 1, 0, 1] + [0, 1, 2]. Note that the second list is, again, exactly what you'd expect your function to return. The same thing happens when you add f() + ["-"]: this creates a new list object, so that any other calls to f won't interfere with it.



You can reproduce this by concatenating the results of two function calls:



>>> f() + f()
[0, 1, 0, 1]
>>> f() + f()
[0, 1, 2, 3, 0, 1, 2, 3]
>>> f() + f()
[0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5]


Again, you can do all that because you're concatenating references to the same object.






share|improve this answer



























  • Wow, 🤯. The best thing about this answer is that it is right. []+f()+f() gives [0, 0, 1] and f()+f()+[] gives [0, 1, 0, 1] !!!

    – Benoît Pilatte
    8 hours ago







  • 2





    The new object returned by + is definitely the key here, it's so subtle

    – C.Nivs
    8 hours ago






  • 1





    A good reminder for why a mutable default argument is a big no-no.

    – EliadL
    8 hours ago






  • 2





    Looked into dis(lambda: f()+f()+f()) and the function f did get called twice before add is performed. Great answer btw.

    – Henry Yik
    7 hours ago






  • 1





    @HenryYik it's because of how list.__add__ is implemented. The first f() instantiates the list object, let's call it l1. Then l1.__add__(f()) is called, so, f() needs to be evaluated first, which changes the reference that is shared with l1. Then l1.__add__(l2) finishes, returning the new object.

    – C.Nivs
    7 hours ago















18













That's actually pretty interesting!



As we know, the list l in the function definition is initialized only once at the definition of this function, and for all invocations of this function, there will be exactly one copy of this list. Now, the function modifies this list, which means that multiple calls to this function will modify the exact same object multiple times. This is the first important part.



Now, consider the expression that adds these lists:



f()+f()+f()


According to the laws of operator precedence, this is equivalent to the following:



(f() + f()) + f()


...which is exactly the same as this:



temp1 = f() + f() # (1)
temp2 = temp1 + f() # (2)


This is the second important part.



Addition of lists produces a new object, without modifying any of its arguments. This is the third important part.



Now let's combine what we know together.



In line 1 above, the first call returns [0], as you'd expect. The second call returns [0, 1], as you'd expect. Oh, wait! The function will return the exact same object (not its copy!) over and over again, after modifying it! This means that the object that the first call returned has now changed to become [0, 1] as well! And that's why temp1 == [0, 1] + [0, 1].



The result of addition, however, is a completely new object, so [0, 1, 0, 1] + f() is the same as [0, 1, 0, 1] + [0, 1, 2]. Note that the second list is, again, exactly what you'd expect your function to return. The same thing happens when you add f() + ["-"]: this creates a new list object, so that any other calls to f won't interfere with it.



You can reproduce this by concatenating the results of two function calls:



>>> f() + f()
[0, 1, 0, 1]
>>> f() + f()
[0, 1, 2, 3, 0, 1, 2, 3]
>>> f() + f()
[0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5]


Again, you can do all that because you're concatenating references to the same object.






share|improve this answer



























  • Wow, 🤯. The best thing about this answer is that it is right. []+f()+f() gives [0, 0, 1] and f()+f()+[] gives [0, 1, 0, 1] !!!

    – Benoît Pilatte
    8 hours ago







  • 2





    The new object returned by + is definitely the key here, it's so subtle

    – C.Nivs
    8 hours ago






  • 1





    A good reminder for why a mutable default argument is a big no-no.

    – EliadL
    8 hours ago






  • 2





    Looked into dis(lambda: f()+f()+f()) and the function f did get called twice before add is performed. Great answer btw.

    – Henry Yik
    7 hours ago






  • 1





    @HenryYik it's because of how list.__add__ is implemented. The first f() instantiates the list object, let's call it l1. Then l1.__add__(f()) is called, so, f() needs to be evaluated first, which changes the reference that is shared with l1. Then l1.__add__(l2) finishes, returning the new object.

    – C.Nivs
    7 hours ago













18












18








18







That's actually pretty interesting!



As we know, the list l in the function definition is initialized only once at the definition of this function, and for all invocations of this function, there will be exactly one copy of this list. Now, the function modifies this list, which means that multiple calls to this function will modify the exact same object multiple times. This is the first important part.



Now, consider the expression that adds these lists:



f()+f()+f()


According to the laws of operator precedence, this is equivalent to the following:



(f() + f()) + f()


...which is exactly the same as this:



temp1 = f() + f() # (1)
temp2 = temp1 + f() # (2)


This is the second important part.



Addition of lists produces a new object, without modifying any of its arguments. This is the third important part.



Now let's combine what we know together.



In line 1 above, the first call returns [0], as you'd expect. The second call returns [0, 1], as you'd expect. Oh, wait! The function will return the exact same object (not its copy!) over and over again, after modifying it! This means that the object that the first call returned has now changed to become [0, 1] as well! And that's why temp1 == [0, 1] + [0, 1].



The result of addition, however, is a completely new object, so [0, 1, 0, 1] + f() is the same as [0, 1, 0, 1] + [0, 1, 2]. Note that the second list is, again, exactly what you'd expect your function to return. The same thing happens when you add f() + ["-"]: this creates a new list object, so that any other calls to f won't interfere with it.



You can reproduce this by concatenating the results of two function calls:



>>> f() + f()
[0, 1, 0, 1]
>>> f() + f()
[0, 1, 2, 3, 0, 1, 2, 3]
>>> f() + f()
[0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5]


Again, you can do all that because you're concatenating references to the same object.






share|improve this answer















That's actually pretty interesting!



As we know, the list l in the function definition is initialized only once at the definition of this function, and for all invocations of this function, there will be exactly one copy of this list. Now, the function modifies this list, which means that multiple calls to this function will modify the exact same object multiple times. This is the first important part.



Now, consider the expression that adds these lists:



f()+f()+f()


According to the laws of operator precedence, this is equivalent to the following:



(f() + f()) + f()


...which is exactly the same as this:



temp1 = f() + f() # (1)
temp2 = temp1 + f() # (2)


This is the second important part.



Addition of lists produces a new object, without modifying any of its arguments. This is the third important part.



Now let's combine what we know together.



In line 1 above, the first call returns [0], as you'd expect. The second call returns [0, 1], as you'd expect. Oh, wait! The function will return the exact same object (not its copy!) over and over again, after modifying it! This means that the object that the first call returned has now changed to become [0, 1] as well! And that's why temp1 == [0, 1] + [0, 1].



The result of addition, however, is a completely new object, so [0, 1, 0, 1] + f() is the same as [0, 1, 0, 1] + [0, 1, 2]. Note that the second list is, again, exactly what you'd expect your function to return. The same thing happens when you add f() + ["-"]: this creates a new list object, so that any other calls to f won't interfere with it.



You can reproduce this by concatenating the results of two function calls:



>>> f() + f()
[0, 1, 0, 1]
>>> f() + f()
[0, 1, 2, 3, 0, 1, 2, 3]
>>> f() + f()
[0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5]


Again, you can do all that because you're concatenating references to the same object.







share|improve this answer














share|improve this answer



share|improve this answer








edited 4 hours ago

























answered 8 hours ago









ForceBruForceBru

24.6k9 gold badges36 silver badges62 bronze badges




24.6k9 gold badges36 silver badges62 bronze badges















  • Wow, 🤯. The best thing about this answer is that it is right. []+f()+f() gives [0, 0, 1] and f()+f()+[] gives [0, 1, 0, 1] !!!

    – Benoît Pilatte
    8 hours ago







  • 2





    The new object returned by + is definitely the key here, it's so subtle

    – C.Nivs
    8 hours ago






  • 1





    A good reminder for why a mutable default argument is a big no-no.

    – EliadL
    8 hours ago






  • 2





    Looked into dis(lambda: f()+f()+f()) and the function f did get called twice before add is performed. Great answer btw.

    – Henry Yik
    7 hours ago






  • 1





    @HenryYik it's because of how list.__add__ is implemented. The first f() instantiates the list object, let's call it l1. Then l1.__add__(f()) is called, so, f() needs to be evaluated first, which changes the reference that is shared with l1. Then l1.__add__(l2) finishes, returning the new object.

    – C.Nivs
    7 hours ago

















  • Wow, 🤯. The best thing about this answer is that it is right. []+f()+f() gives [0, 0, 1] and f()+f()+[] gives [0, 1, 0, 1] !!!

    – Benoît Pilatte
    8 hours ago







  • 2





    The new object returned by + is definitely the key here, it's so subtle

    – C.Nivs
    8 hours ago






  • 1





    A good reminder for why a mutable default argument is a big no-no.

    – EliadL
    8 hours ago






  • 2





    Looked into dis(lambda: f()+f()+f()) and the function f did get called twice before add is performed. Great answer btw.

    – Henry Yik
    7 hours ago






  • 1





    @HenryYik it's because of how list.__add__ is implemented. The first f() instantiates the list object, let's call it l1. Then l1.__add__(f()) is called, so, f() needs to be evaluated first, which changes the reference that is shared with l1. Then l1.__add__(l2) finishes, returning the new object.

    – C.Nivs
    7 hours ago
















Wow, 🤯. The best thing about this answer is that it is right. []+f()+f() gives [0, 0, 1] and f()+f()+[] gives [0, 1, 0, 1] !!!

– Benoît Pilatte
8 hours ago






Wow, 🤯. The best thing about this answer is that it is right. []+f()+f() gives [0, 0, 1] and f()+f()+[] gives [0, 1, 0, 1] !!!

– Benoît Pilatte
8 hours ago





2




2





The new object returned by + is definitely the key here, it's so subtle

– C.Nivs
8 hours ago





The new object returned by + is definitely the key here, it's so subtle

– C.Nivs
8 hours ago




1




1





A good reminder for why a mutable default argument is a big no-no.

– EliadL
8 hours ago





A good reminder for why a mutable default argument is a big no-no.

– EliadL
8 hours ago




2




2





Looked into dis(lambda: f()+f()+f()) and the function f did get called twice before add is performed. Great answer btw.

– Henry Yik
7 hours ago





Looked into dis(lambda: f()+f()+f()) and the function f did get called twice before add is performed. Great answer btw.

– Henry Yik
7 hours ago




1




1





@HenryYik it's because of how list.__add__ is implemented. The first f() instantiates the list object, let's call it l1. Then l1.__add__(f()) is called, so, f() needs to be evaluated first, which changes the reference that is shared with l1. Then l1.__add__(l2) finishes, returning the new object.

– C.Nivs
7 hours ago





@HenryYik it's because of how list.__add__ is implemented. The first f() instantiates the list object, let's call it l1. Then l1.__add__(f()) is called, so, f() needs to be evaluated first, which changes the reference that is shared with l1. Then l1.__add__(l2) finishes, returning the new object.

– C.Nivs
7 hours ago








Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f57593294%2fconcatenation-of-the-result-of-a-function-with-a-mutable-default-argument-in-pyt%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

François Viète Contents Biography Work and thought Bibliography See also Notes Further reading External links Navigation menup. 21Google Bookspp. 75–77Google BooksDe thou (from University of Saint Andrews)ArchivedGoogle BooksGoogle BooksGoogle BooksGoogle booksGoogle Bookscc-parthenay.frL'histoire universelle (fr)Universal History (en)ArchivedAdsabs.harvard.eduPagesperso-orange.frArchive.orgChikara Sasaki. Descartes' mathematical thought p.259Google BooksGoogle BooksGoogle Bookspp. 152 and onwardGoogle BooksGoogle BooksScribd.comGoogle Books1257-7979Google BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGallica.bnf.frGoogle BooksGoogle Books"François Viète"Francois Viète: Father of Modern Algebraic NotationThe Lawyer and the GamblerAbout TarporleySite de Jean-Paul GuichardL'algèbre nouvelle"About the Harmonicon"cb120511976(data)1188044800000 0001 0913 5903n82164680ola2013766880073431702w6vt1sb70287374827140948071409480