[issue39177] In tkinter, simple dialogs, askstrings, etc. with flexible coordinates and no viewable parent.

2019-12-31 Thread Dominic Mayers
New submission from Dominic Mayers : Currently, it's not possible to center or change the coordinates in anyway of an askstring, askfloat or askinteger dialog in simpledialog.py. One can see this by looking at the code: if parent.winfo_viewable(): self.transient(parent

[issue39171] Missing default root in tkinter simpledialog.py

2019-12-31 Thread Dominic Mayers
Dominic Mayers added the comment: Just to add that I realize now that tkinter is designed for applications with a root window, the "application window". That's why little attention is given to a possible missing root. In fact, it's interesting that we have this code in simpl

[issue39171] Missing default root in tkinter simpledialog.py

2019-12-31 Thread Dominic Mayers
Change by Dominic Mayers : -- versions: +Python 3.9 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue39171> ___ ___ Python-bugs-list mailin

[issue39171] Missing default root in tkinter simpledialog.py

2019-12-31 Thread Dominic Mayers
Dominic Mayers added the comment: Again, I just spent a few minutes looking at this, but in the ttk module, in a similar situation, they do: if master is None: if tkinter._support_default_root: master = tkinter._default_root or tkinter.Tk() else

[issue39171] Missing default root in tkinter simpledialog.py

2019-12-31 Thread Dominic Mayers
Dominic Mayers added the comment: If it's normal, then the error message should perhaps be more informative and user friendly than just a traceback: Traceback (most recent call last): File "./dialog.py", line 6, in integer_value = simpledialog.askinteger('Di

[issue39171] Missing default root in tkinter simpledialog.py

2019-12-31 Thread Dominic Mayers
New submission from Dominic Mayers : My first "bug" report here. Not sure I am doing it right. It is just that if I execute the code import tkinter from tkinter import simpledialog tkinter.Tk().withdraw() integer_value = simpledialog.askinteger('Dialog Title', 'Wh

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-05 Thread Dominic Mayers
Changes by Dominic Mayers <dominic_may...@yahoo.com>: Removed file: http://bugs.python.org/file46775/Issue29947_for_discussion_03.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-05 Thread Dominic Mayers
Dominic Mayers added the comment: An improved version of the patch, I hope. I will remove the old patch, because it's really does not help to see the old versions. -- Added file: http://bugs.python.org/file46781/Issue29947_for_discussion_04.patch

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-04 Thread Dominic Mayers
Changes by Dominic Mayers <dominic_may...@yahoo.com>: Added file: http://bugs.python.org/file46775/Issue29947_for_discussion_03.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-04 Thread Dominic Mayers
Changes by Dominic Mayers <dominic_may...@yahoo.com>: Removed file: http://bugs.python.org/file46774/Issue29947_for_discussion_02.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-04 Thread Dominic Mayers
Changes by Dominic Mayers <dominic_may...@yahoo.com>: Removed file: http://bugs.python.org/file46770/Issue29947_for_discussion.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-04 Thread Dominic Mayers
Dominic Mayers added the comment: I simplified the patch. Using a class as a factory function is the simplest case, so I took advantage of this. I also give one way to pass extra parameters to the handler in the factory function, because it's the main reason why we cannot always use a class

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-03 Thread Dominic Mayers
Dominic Mayers added the comment: The key point, IMHO, is that the BaseRequestHandler class is just provided as an option and its API (setup, handle and finish) is ignored by the code that we support. Some applications may have used the API, but these are details in applications. Simply, we

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-02 Thread Dominic Mayers
Dominic Mayers added the comment: I started to look at the documentation to see what would need to be changed, assuming that we agree for a change in the API. Just for the purpose of this discussion, I created a patch that only change the comments in socketserver.py

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-02 Thread Dominic Mayers
Changes by Dominic Mayers <dominic_may...@yahoo.com>: -- keywords: +patch Added file: http://bugs.python.org/file46770/Issue29947_for_discussion.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-02 Thread Dominic Mayers
Changes by Dominic Mayers <dominic_may...@yahoo.com>: Removed file: http://bugs.python.org/file46768/factorymixinclass ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-02 Thread Dominic Mayers
Dominic Mayers added the comment: I did not think very far when said that renaming the parameter could not possibly break the code ! Oh well ! But, renaming the parameter was not important in itself. It was to make the situation clearer and easier for those who write the documentation

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-01 Thread Dominic Mayers
Dominic Mayers added the comment: Oops, I did not realize that David was one of the developers. Well, may be this needs the attention of more than one developer. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-01 Thread Dominic Mayers
Dominic Mayers added the comment: The reason why I feel we should not make it immediately a documentation issue is that I don't know how a person working on documentation could proceed ahead without a clear go ahead signal from developers. In that sense, having a documentation that says

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-01 Thread Dominic Mayers
Dominic Mayers added the comment: To sum up, David clarified that we can in fact easily pass an arbitrary factory method that creates and starts a request handler, instead of a request handler class with setup, handle and finish in its API. This could indeed be a valid reason to consider

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-01 Thread Dominic Mayers
Dominic Mayers added the comment: Perhaps I should raise a separate issue, but it is related, because the current code "requires" that we define an handler class with `setup()`, `handle()` and `finish()` in its API. If you look at the actual code, there is no such requirement. We

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-03-31 Thread Dominic Mayers
Dominic Mayers added the comment: I am a bit ashamed that I missed that. Still, the intent in the current code, the name of the parameter, the examples, etc. is that we pass the handler class. This is more than its __init__ function and less than a generic factory method. An important

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-03-30 Thread Dominic Mayers
Dominic Mayers added the comment: On the other hand, it occurs to me that this seems way more flexible than passing the object through the server, because you share the factory with the server, not only the object. This means that you could even change the type of the handler while the server

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-03-30 Thread Dominic Mayers
Changes by Dominic Mayers <dominic_may...@yahoo.com>: -- resolution: wont fix -> status: closed -> open ___ Python tracker <rep...@bugs.python.org> <http://bugs.

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-03-30 Thread Dominic Mayers
Dominic Mayers added the comment: Finally, I looked around and people just use the server to pass any extra parameter. I do find it awkward, but it works and it is simple, in fact simpler than having to define a factory object. I don't close it, because I will be happy to see another opinion

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-03-30 Thread Dominic Mayers
Dominic Mayers added the comment: One way to make the factory optional is to offer a MixIn. I attached a file with a FactoryMixIn. It's just that I find it awkward that the proposed approach is to pass the extra parameters in a subclassed server. More modern approaches should also be offered

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-03-30 Thread Dominic Mayers
New submission from Dominic Mayers: I am just curious to know if someone considered the idea of passing a factory instance that returns RequestHandlerClass instances instead of directly passing the class? It may affect existing handlers that read non local variables, but there should be a way