On 25-Apr-11 08:30 AM, Ken Seehart wrote:
On 4/25/2011 4:59 AM, Colin J. Williams wrote:
On 24-Apr-11 13:07 PM, Ken Seehart wrote:
On 4/24/2011 2:58 AM, Steven D'Aprano wrote:
Consider this in Python 3.1:
def f(a=42):
... return a
...
f()
42
f.__defaults__ = (23,)
f()
23
Is this an a
On 4/25/2011 4:59 AM, Colin J. Williams wrote:
On 24-Apr-11 13:07 PM, Ken Seehart wrote:
On 4/24/2011 2:58 AM, Steven D'Aprano wrote:
Consider this in Python 3.1:
def f(a=42):
... return a
...
f()
42
f.__defaults__ = (23,)
f()
23
Is this an accident of implementation, or can I trust t
On 24-Apr-11 13:07 PM, Ken Seehart wrote:
On 4/24/2011 2:58 AM, Steven D'Aprano wrote:
Consider this in Python 3.1:
def f(a=42):
... return a
...
f()
42
f.__defaults__ = (23,)
f()
23
Is this an accident of implementation, or can I trust that changing
function defaults in this fashion i
On Sun, 24 Apr 2011 10:07:02 -0700, Ken Seehart wrote:
> On 4/24/2011 2:58 AM, Steven D'Aprano wrote:
[...]
>> Is this an accident of implementation, or can I trust that changing
>> function defaults in this fashion is guaranteed to work?
>
> This is documented in python 3, so I would expect it t
Gotta love that email latency. :-D
Ken
On 4/24/2011 2:47 PM, Daniel Kluev wrote:
On Mon, Apr 25, 2011 at 8:21 AM, Ken Seehart wrote:
Good point, Benjamin. I didn't think of testing on Jython before
answering. For practical purposes it's a really good idea to test obscure
features against all
On 4/24/2011 5:21 PM, Ken Seehart wrote:
Good point, Benjamin. I didn't think of testing on Jython before
answering. For practical purposes it's a really good idea to test
obscure features against all potential target platforms.
In this case, I would argue that**Benjamin's test demonstrates a bu
On Mon, Apr 25, 2011 at 8:21 AM, Ken Seehart wrote:
> Good point, Benjamin. I didn't think of testing on Jython before
> answering. For practical purposes it's a really good idea to test obscure
> features against all potential target platforms.
>
> In this case, I would argue that Benjamin's te
Oops, I must correct myself. Please ignore my previous post.
As Daniel points out, Writable is specified in the Python 3
documentation. Apparently I was reading the documentation with only my
right eye open, and the Writable tag fell on my blind spot.
I concur that this unambiguously implies
Good point, Benjamin. I didn't think of testing on Jython before
answering. For practical purposes it's a really good idea to test
obscure features against all potential target platforms.
In this case, I would argue that**Benjamin's test demonstrates a bug in
Jython.
One could counter by p
On 4/24/2011 2:58 AM, Steven D'Aprano wrote:
Consider this in Python 3.1:
def f(a=42):
... return a
...
f()
42
f.__defaults__ = (23,)
f()
23
Is this an accident of implementation, or can I trust that changing
function defaults in this fashion is guaranteed to work?
This is documen
http://docs.python.org/dev/reference/datamodel.html
Callable types
...
Special attributes:
...
__defaults__A tuple containing default argument values for those
arguments that have defaults, or None if no arguments have a default
value Writable
I don't see any 'implementation detail' mark the
On Sun, Apr 24, 2011 at 5:58 AM, Steven D'Aprano
wrote:
> Consider this in Python 3.1:
>
>
def f(a=42):
> ... return a
> ...
f()
> 42
f.__defaults__ = (23,)
f()
> 23
>
>
> Is this an accident of implementation, or can I trust that changing
> function defaults in this fashio
On 4/24/2011 5:58 AM, Steven D'Aprano wrote:
Consider this in Python 3.1:
def f(a=42):
... return a
...
f()
42
f.__defaults__ = (23,)
f()
23
Is this an accident of implementation, or can I trust that changing
function defaults in this fashion is guaranteed to work?
Interesting que
Consider this in Python 3.1:
>>> def f(a=42):
... return a
...
>>> f()
42
>>> f.__defaults__ = (23,)
>>> f()
23
Is this an accident of implementation, or can I trust that changing
function defaults in this fashion is guaranteed to work?
--
Steven
--
http://mail.python.org/mailman/lis
14 matches
Mail list logo