[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-27 Thread E. Paine


E. Paine  added the comment:

> Can you change labels on your own PRs?

Sadly not (hence why I need to ask for e.g. skip news)

--

___
Python tracker 

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



[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There were some issues with the backporting bot. Seems they were temporary.

Thank you for your contribution E. Paine. For this issue and others.

--
resolution:  -> fixed
stage: patch review -> 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



[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-27 Thread miss-islington


miss-islington  added the comment:


New changeset e1f3bd2bb50a76ba15a2f8d561e2c9968ae3a1b2 by Miss Islington (bot) 
in branch '3.10':
bpo-44404: tkinter `after` support callable classes (GH-26812)
https://github.com/python/cpython/commit/e1f3bd2bb50a76ba15a2f8d561e2c9968ae3a1b2


--
nosy: +miss-islington

___
Python tracker 

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



[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
stage:  -> patch review

___
Python tracker 

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



[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

When the backport is done or Serhiy changes his mind.

Can you change labels on your own PRs?

--
nosy:  -miss-islington
stage: patch review -> 

___
Python tracker 

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



[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-26 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +25494
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26921

___
Python tracker 

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



[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-26 Thread E. Paine


E. Paine  added the comment:

Can this issue be closed?

--

___
Python tracker 

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



[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I was thinking the same.

--

___
Python tracker 

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



[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is on borderline between new feature and bugfix (depends on your 
interpretation of the documentation), so I decided to backport it to not yet 
released 3.10, but not to 3.9 which has been already used for a year.

--
stage: patch review -> 
type: behavior -> enhancement
versions:  -Python 3.9

___
Python tracker 

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



[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset e9c8f784fa13ea3a51df3b72a498a3896ec9e768 by E-Paine in branch 
'main':
bpo-44404: tkinter `after` support callable classes (GH-26812)
https://github.com/python/cpython/commit/e9c8f784fa13ea3a51df3b72a498a3896ec9e768


--

___
Python tracker 

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



[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-20 Thread E. Paine


Change by E. Paine :


--
keywords: +patch
pull_requests: +25394
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26812

___
Python tracker 

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



[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-18 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The docstring for .after says the 2nd argument must be a 'function'.  Whether 
this issue is a bugfix or enhancement request depends whether one interprets 
'function' as 'callable' or something narrower that only includes objects that 
necessarily have __name__ attributes.  The latter would exclude partials and 
instances of user classes with __call__ methods.

While a one-time-use partial as in the example is superfluous, I think other 
uses and parameterized callback classes should be supported.  So I agree with 
changing the tkinter code rather than qualifying 'function' with 'has a 
.__name__ attribute'.  I think 'type(func).__name__' should be safe.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-13 Thread E. Paine


E. Paine  added the comment:

Reproducible in Python 3.9. The issue occurs because functools.partial is a 
class, not function. I believe the fix is simply something like:

try:
callit.__name__ = func.__name__
except AttributeError:
callit.__name__ = type(func).__name__

This will use the name 'partial'. The lack of '__name__' is noted in the 
functools docs so I agree with Philip that this is an issue with tkinter. 
Philip, do you want to open a pull request for this?

It should be noted that functools.partial is not required in this situation as 
'after' takes arguments for the function call:
r.after(500, print, "lol")

--
nosy: +epaine, serhiy.storchaka
versions: +Python 3.10, Python 3.11

___
Python tracker 

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



[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-12 Thread Philip Sundt


New submission from Philip Sundt :

```
>>> import tkinter
>>> from functools import partial
>>> r=tkinter.Tk()
>>> r.after(500, partial(print, "lol"))
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.7/tkinter/__init__.py", line 755, in after
callit.__name__ = func.__name__
AttributeError: 'functools.partial' object has no attribute '__name__'
```

--
components: Tkinter
messages: 395712
nosy: phil.tgd
priority: normal
severity: normal
status: open
title: tkinter's after() AttributeError with functools.partial (no attribute 
__name__)
type: behavior
versions: Python 3.9

___
Python tracker 

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