Re: [Python-ideas] Adding multiple constructors on one class

2019-05-05 Thread Greg Ewing
Steven D'Aprano wrote: Guido's time machine strikes again -- classes can have any number of constructors, and we've had the ability to do this since at least Python 2.2 if not earlier. Although I think the OP wants all the constructors to have the same name, which is more difficult to achieve

Re: [Python-ideas] Adding multiple constructors on one class

2019-05-05 Thread Chris Angelico
On Mon, May 6, 2019 at 6:09 AM Zakariae Saih wrote: > > Hello python team! > you should consider adding the ability to create multiple constructors on one > class like c# and Java it is really useful. > Example: > i want a constructor takes 1 argument and other constructor takes 2 and >

[Python-ideas] Adding multiple constructors on one class

2019-05-05 Thread Zakariae Saih
Hello python team! you should consider adding the ability to create multiple constructors on one class like c# and Java it is really useful. *Example*: i want a constructor takes 1 argument and other constructor takes 2 and another one takes none in the same class. so when i want to create an

[Python-ideas] A proper way to bring real interfaces to Python

2019-05-05 Thread Stephen J. Turnbull
Serge Matveenko writes: > So, I would like to propose adding a third main object called > `interface` in addition to `object` and `type` and to use it to define > interface objects. Such interfaces could then be used in the class > definition in the following way. How does this compare to

[Python-ideas] Running average and stdev in the statistics module?

2019-05-05 Thread Luca Baldini
Hi here, I wonder if the idea of adding to the statistics module a class to calculate the running statistics (average and standard deviation) of a generic input data stream has ever come up in the past. The basic idea is to do the necessary book-keeping as the data are fed into the