On Fri, Oct 30, 2020 at 5:16 PM Julio Di Egidio wrote:
> Not to mention, from the point of view of formal verification,
> this is the corresponding annotated version, and it is in fact
> worse than useless:
>
> def abs(x: Any) -> Any:
> ...some code here...
>
Useless because, in the absence of
On Friday, 30 October 2020 05:09:34 UTC+1, Chris Angelico wrote:
> On Fri, Oct 30, 2020 at 1:06 PM Julio Di Egidio wrote:
> > On Sunday, 25 October 2020 20:55:26 UTC+1, Peter J. Holzer wrote:
> > > I think you are trying to use Python in a way contrary to its nature.
> > > Python is a dynamicall
On Fri, Oct 30, 2020 at 1:06 PM Julio Di Egidio wrote:
>
> On Sunday, 25 October 2020 20:55:26 UTC+1, Peter J. Holzer wrote:
> > I think you are trying to use Python in a way contrary to its nature.
> > Python is a dynamically typed language. Its variables don't have types,
> > only its objects.
On Sunday, 25 October 2020 20:55:26 UTC+1, Peter J. Holzer wrote:
> On 2020-10-22 23:35:21 -0700, Julio Di Egidio wrote:
> > On Friday, 23 October 2020 07:36:39 UTC+2, Greg Ewing wrote:
> > > On 23/10/20 2:13 pm, Julio Di Egidio wrote:
> > > > I am now thinking whether I could achieve the "standa
Peter J. Holzer wrote at 2020-10-25 20:48 +0100:
>On 2020-10-22 23:35:21 -0700, Julio Di Egidio wrote:
> ...
>> and the whole lot, indeed why even subclass ABC?
You often have the case that a base class can implement
a lot of functionality based on a few methods defined
by derived classes.
An exa
On 2020-10-22 23:35:21 -0700, Julio Di Egidio wrote:
> On Friday, 23 October 2020 07:36:39 UTC+2, Greg Ewing wrote:
> > On 23/10/20 2:13 pm, Julio Di Egidio wrote:
> > > I am now thinking whether I could achieve the "standard"
> > > behaviour via another approach, say with decorators, somehow
> >
I'm a C++ programmer and Python programmer as well. Python classes are not
exactly like C++ classes.
If you define a class where every method has an implementation, then it really
isn't abstract. It can be instantiated. You can force it to be abstract by
doing from abc import ABCMeta and dec
On Friday, 23 October 2020 07:36:39 UTC+2, Greg Ewing wrote:
> On 23/10/20 2:13 pm, Julio Di Egidio wrote:
> > I am now thinking whether I could achieve the "standard"
> > behaviour via another approach, say with decorators, somehow
> > intercepting calls to __new__... maybe.
>
> I'm inclined to
On 23/10/20 2:13 pm, Julio Di Egidio wrote:
I am now thinking whether I could achieve the "standard"
behaviour via another approach, say with decorators, somehow
intercepting calls to __new__... maybe.
I'm inclined to step back and ask -- why do you care about this?
Would it actually do any ha
On Thursday, 22 October 2020 23:04:25 UTC+2, Ethan Furman wrote:
> On 10/22/20 9:25 AM, Julio Di Egidio wrote:
>
> > Now, I do read in the docs that that is as intended,
> > but I am not understanding the rationale of it: why
> > only if there are abstract methods defined in an ABC
> > class is i
On 10/22/20 9:25 AM, Julio Di Egidio wrote:
Now, I do read in the docs that that is as intended,
but I am not understanding the rationale of it: why
only if there are abstract methods defined in an ABC
class is instantiation disallowed? IOW, why isn't
subclassing from ABC enough?
Let's say yo
On Thu, 22 Oct 2020 at 22:09, Marco Sulla
wrote:
> Not sure because I never tried or needed, but if no @abstractsomething in
> A is defined and your B class is a subclass of A, B should be an abstract
> class, not a concrete class.
>
Now I'm sure:
>>> from abc import ABC, abstractmethod
>>> cla
On Thu, 22 Oct 2020 at 18:31, Julio Di Egidio wrote:
> why
> only if there are abstract methods defined in an ABC
> class is instantiation disallowed?
>
Not sure because I never tried or needed, but if no @abstractsomething in A
is defined and your B class is a subclass of A, B should be an abst
13 matches
Mail list logo