Комментарии:
Is there any value in making a method generic that doesn't take any parameters, but could return a variety of things?
ОтветитьIf I remember correctly, you don't need necessarily to type annotate the constructor if you say so: my_object = FDict[str, int]()
In this case, it makes no sense but still, you can. BTW good video, and a very interesting topic
I have a question for you, @anthonywritescode. I am in a continuous merge request review discussion back and forth with others regarding the use of `NoReturn` vs `None` for the return of a function or method that does not returns anything. Can you please shine your light on it? Docs state then the `NoReturn` is used for functions that are not expected to return anything; eg. an Exception raising function.
ОтветитьAwesome, a video about covariant/contravariant would be nice
ОтветитьCool. Python becomes ... Haskell ;). Anthony, this is not fair. ;) Tell us about covariant and countervariant. ;)
ОтветитьThis is awesome
ОтветитьI remember my professor talking about covariate and contravariant types and all I remember is that "a bag of apples is not a bag of fruits"??
Ответитьwaiting for the 1 hour variance wideo *grabs popcorn
Ответитьrandom trivia I learned recently: to make a generic protocol class, you can do:
```
class C(Protocol, Generic[T]): ...
```
which is a bit much, so there's a shorthand:
```
class C(Protocol[T]): ...
```
/me misreads title as "python Geriatrics (intermediate)"...don't mind me
Ответить