Function type in typing

2020-07-08 Thread Jonathan Gossage
How could I type a function that returns a generic type? For example, I use a function that expects another function as an argument. This second function must return a datatype or a collection. I assume that I could use *Callable[..., return type]* and I have no way to specify the return type. --

Re: execution timing of the method QWidget.show()

2020-07-08 Thread Barry
Search for PyQt mailing list will get you to https://www.riverbankcomputing.com/mailman/listinfo/pyqt Barry > On 8 Jul 2020, at 21:17, artis.pain...@gmail.com wrote: > > I might be wrong but since I have not found anygroup newsgroup dedicated to > PyQt5. > > My small program is expected to s

Re: Questioning the effects of multiple assignment

2020-07-08 Thread DL Neil via Python-list
On 8/07/20 10:19 PM, Peter J. Holzer wrote: On 2020-07-08 12:26:06 +1200, dn via Python-list wrote: OTOH, using a tuple doesn't prevent the function from mutating mutable arguments: #!/usr/bin/python3 def f(*a): a[0]["new"] = 2 v = { "old": 1} f(v) print(v) prints «{'old': 1, 'new': 2}».

Re: Questioning the effects of multiple assignment

2020-07-08 Thread dn via Python-list
On 8/07/20 11:11 PM, o1bigtenor wrote: On Tue, Jul 7, 2020 at 2:30 AM Mike Dewhirst > wrote: Original message From: dn via Python-list mailto:python-list@python.org>> Date: 7/7/20  16:04  (GMT+10:00) To: 'Python' mailto:python-list@python

Re: Questioning the effects of multiple assignment

2020-07-08 Thread dn via Python-list
On 8/07/20 2:40 PM, Kyle Stanley wrote: A matter of style, which I like to follow [is it TDD's influence? - or does it actually come-from reading about DBC (Design by Contract*)?] is the injunction that one *not* vary the value of a parameter inside a method/function. (useful

Re: execution timing of the method QWidget.show()

2020-07-08 Thread MRAB
On 2020-07-08 21:11, artis.pain...@gmail.com wrote: I might be wrong but since I have not found anygroup newsgroup dedicated to PyQt5. My small program is expected to show a window GUI for 4 seconds before changing it, so I naively coded: "... ... # codes to set up the GUI ... F0.show() # F0

execution timing of the method QWidget.show()

2020-07-08 Thread artis . paintre
I might be wrong but since I have not found anygroup newsgroup dedicated to PyQt5. My small program is expected to show a window GUI for 4 seconds before changing it, so I naively coded: "... ... # codes to set up the GUI ... F0.show() # F0 being a QMainWindow object time.sleep(4) ... # codes t

Re: Questioning the effects of multiple assignment

2020-07-08 Thread o1bigtenor
On Tue, Jul 7, 2020 at 2:30 AM Mike Dewhirst wrote: > > Original message From: dn via Python-list < > python-list@python.org> Date: 7/7/20 16:04 (GMT+10:00) To: 'Python' < > python-list@python.org> Subject: Questioning the effects of multiple > assignment TLDR; if you are a Pyt

Re: Questioning the effects of multiple assignment

2020-07-08 Thread Peter J. Holzer
On 2020-07-08 12:26:06 +1200, dn via Python-list wrote: > A matter of style, which I like to follow [is it TDD's influence? - or > does it actually come-from reading about DBC (Design by Contract*)?] I think Design by Contract only affects the interfaces (parameters, return values and side effects