[issue30135] default value of argument seems to be overwritten

2017-04-22 Thread Steven D'Aprano

Steven D'Aprano added the comment:

In the future please don't post binary files containing source code, especially 
something as non-standard as 7z. That just makes it difficult for people to 
review the code. Either paste your code snippet directly into the bug report, 
or attach it as a .py file.

If the file is so huge it needs compression, you shouldn't be posting it at 
all. You should post the *minimum* code to demonstrate the problem, not an 
entire application: we don't a 200 line simulation of a Forth interpreter just 
to see something that can be shown in ten lines. Even though this is written 
for Java programmers, the same applies here: http://sscce.org/


Thank you.

--
nosy: +steven.daprano

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30135] default value of argument seems to be overwritten

2017-04-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is correct behavior. You just made a common mistake made by newcomers. 
Read Python FAQ and other resources, this can help you to avoid other pitfalls.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30135] default value of argument seems to be overwritten

2017-04-22 Thread Klaus Wolf

Klaus Wolf added the comment:

A documented misbheavior is still a misbehavior.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30135] default value of argument seems to be overwritten

2017-04-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See "Why are default values shared between objects?" in Python FAQ 
(https://docs.python.org/3/faq/programming.html#id13).

--
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30135] default value of argument seems to be overwritten

2017-04-21 Thread Klaus Wolf

New submission from Klaus Wolf:

Two function results differ if the parameter is given explictly instead of 
using the given default.

(Enclosed example: A small simple interpreter of Forth language, both scripts 
should give the same result, but the first one (variant1) fails because the 
value from the first pass remains on the stack.)

--
components: Interpreter Core
files: misc_math.7z
messages: 292100
nosy: approximately
priority: normal
severity: normal
status: open
title: default value of argument seems to be overwritten
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file46825/misc_math.7z

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com