[issue25137] Behavioral change / regression? with nested functools.partial

2015-09-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fa766b6f12b5 by Berker Peksag in branch '3.5':
Issue #25137: Add a note to whatsnew/3.5.rst for nested functools.partial calls
https://hg.python.org/cpython/rev/fa766b6f12b5

New changeset ed694938c61a by Berker Peksag in branch 'default':
Issue #25137: Add a note to whatsnew/3.5.rst for nested functools.partial calls
https://hg.python.org/cpython/rev/ed694938c61a

--
nosy: +python-dev

___
Python tracker 

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



[issue25137] Behavioral change / regression? with nested functools.partial

2015-09-22 Thread Berker Peksag

Berker Peksag added the comment:

Added a note to Doc/whatsnew/3.5.rst.

--
nosy: +berker.peksag
stage:  -> resolved

___
Python tracker 

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



[issue25137] Behavioral change / regression? with nested functools.partial

2015-09-18 Thread STINNER Victor

STINNER Victor added the comment:

Tim Graham wrote: "It's fine with me."

Oh, I see that your pull request was merged. I'm now closing the issue.

Anyway, thanks for the bug report. It's always good to have feedback on 
behaviour changes, even when they are legit :-)

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue25137] Behavioral change / regression? with nested functools.partial

2015-09-18 Thread STINNER Victor

STINNER Victor added the comment:

Can we close this issue?

--

___
Python tracker 

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



[issue25137] Behavioral change / regression? with nested functools.partial

2015-09-18 Thread Tim Graham

Tim Graham added the comment:

It's fine with me.

--

___
Python tracker 

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



[issue25137] Behavioral change / regression? with nested functools.partial

2015-09-18 Thread Markus Holtermann

Markus Holtermann added the comment:

Interesting thing tough, this optimization is nowhere mentioned in the 3.5 
release notes ;)

--

___
Python tracker 

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



[issue25137] Behavioral change / regression? with nested functools.partial

2015-09-16 Thread STINNER Victor

STINNER Victor added the comment:

> In my opinion this is a regression since there's no way to turn off the new 
> behavior.

Well, it depends on your point of view :-) On the performance point of view, 
it's much faster to flatten heavily nested partials like:

>>> import functools
>>> f = functools.partial(print, 1)
>>> f = functools.partial(f, 2)
>>> f = functools.partial(f, 3)
>>> f = functools.partial(f, 4)
>>> f = functools.partial(f, 5)
>>> f()
1 2 3 4 5

> This is a behavioral change that causes a test failure in Django because we 
> use nested partials to resolve relationships between models

Can you point me to the code? Why do you need to know the full chain of nested 
partials?

If you need to remember the chain of actions, maybe you can store it manually? 
You can add an attribute to a functools.partial() object. Or you can create a 
subclass of functools.partial.

--
nosy: +haypo

___
Python tracker 

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



[issue25137] Behavioral change / regression? with nested functools.partial

2015-09-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The specific attributes of a partial are not documented, so it is you are 
relying on them. Using partial as a container is also a bit unexpected...

--

___
Python tracker 

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



[issue25137] Behavioral change / regression? with nested functools.partial

2015-09-16 Thread Tim Graham

Tim Graham added the comment:

We can use an alternate approach in Django, if appropriate: 
https://github.com/django/django/pull/5294

--

___
Python tracker 

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



[issue25137] Behavioral change / regression? with nested functools.partial

2015-09-15 Thread Tim Graham

Changes by Tim Graham :


--
nosy: +Tim.Graham

___
Python tracker 

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



[issue25137] Behavioral change / regression? with nested functools.partial

2015-09-15 Thread Markus Holtermann

New submission from Markus Holtermann:

Since #7830 nested partials are flattened. This is a behavioral change that 
causes a test failure in Django because we use nested partials to resolve 
relationships between models: 
https://github.com/django/django/pull/4423#issuecomment-138996095

In my opinion this is a regression since there's no way to turn off the new 
behavior.

--
components: Library (Lib)
messages: 250814
nosy: MarkusH, belopolsky
priority: normal
severity: normal
status: open
title: Behavioral change / regression? with nested functools.partial
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue25137] Behavioral change / regression? with nested functools.partial

2015-09-15 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +ncoghlan, pitrou

___
Python tracker 

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



[issue25137] Behavioral change / regression? with nested functools.partial

2015-09-15 Thread Simon Charette

Changes by Simon Charette :


--
nosy: +charettes

___
Python tracker 

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