Thanks, will do! Work has just been keeping me real busy - not enough time to create an entire course, so I thought this would be easier - I can just create videos and publish them one at a time.
32:30 concise it may be but not precise, we need iterables of iterables of exactly _two_ elements. Still need to add a comment or is there a way to express this through type hinting? Good video 👍
Well, you could use something like tuple[int|float, int|float] - this would specifically mandate that the elements be 2-element tuples of int or float. There might be other options available too, but to be honest I mainly use type hinting in conjunction with Pydantic to enforce those kinds of constraints, and there you can use annotated types. (I guess you could use an annotated type also, even without Pydantic, that way you have some sort of "documentation" that the type is a more general iterable of min_length = max_length = 2)
Fred! Thanks a lot for your videos and courses, they are such an incredible resource! I have request if time permits and you think it would be useful, would love to see a deep dive video on Python Generics. Maybe you already have it among all your videos and I missed it.
Hi Fred, thanks for the amazing lecture. I just bought your Pydantic V2 course. Before that I am on this video. I have a very basic doubt. Is List[Union[int, float]] the same thing as List[int | float]. The reason why am i asking this is because in my python version "int | float" is not working. Thanks in advanced
Yes, those are perfectly equivalent. That a | b syntax for type hints is available in Python 3.10 and up. I explain this in the Pydantic course when discussing nullable fields. Any reason why you are using a version of Python that is older than 3.10? (PEP for that change is here: peps.python.org/pep-0604/)
The * symbol is used to indicate "no more positional arguments". So in this case, since no arguments were defined before the *, it means this function has no positional arguments, only keyword-only arguments.
Just like the Udemy courses, on point and informative. Waiting for Part 5 of Udemy series
Same!
If you want to understand how something actually works, he is your man!
Made my day. Going to sleep today with satisfaction as learnt some good stuff.
I hope you slept well!
So much useful info in such a short time!
Glad it was helpful!
Great instruction, Fred, thank you!
You're welcome!
Your videos are awesome, it gives all required info. Thanks for this high quality stuff!
Glad you like them!
Fred, so great you have come back. Your 4 part Python course was amazing, but then you disappeared :-). Please, post!
Thanks, will do! Work has just been keeping me real busy - not enough time to create an entire course, so I thought this would be easier - I can just create videos and publish them one at a time.
great video
Thanks!
32:30 concise it may be but not precise, we need iterables of iterables of exactly _two_ elements. Still need to add a comment or is there a way to express this through type hinting?
Good video 👍
Well, you could use something like tuple[int|float, int|float] - this would specifically mandate that the elements be 2-element tuples of int or float. There might be other options available too, but to be honest I mainly use type hinting in conjunction with Pydantic to enforce those kinds of constraints, and there you can use annotated types. (I guess you could use an annotated type also, even without Pydantic, that way you have some sort of "documentation" that the type is a more general iterable of min_length = max_length = 2)
Fred! Thanks a lot for your videos and courses, they are such an incredible resource! I have request if time permits and you think it would be useful, would love to see a deep dive video on Python Generics. Maybe you already have it among all your videos and I missed it.
Thanks!
Generics is on my to do list for a future video.
Grazie mille :)
Oh man, thanks! Looking forward for that Pydantic video.
By the way, I am curious, will you be doing some content about FastAPI?
That's on my list of future videos, yes.
Hi Fred, thanks for the amazing lecture. I just bought your Pydantic V2 course. Before that I am on this video. I have a very basic doubt. Is List[Union[int, float]] the same thing as List[int | float]. The reason why am i asking this is because in my python version "int | float" is not working. Thanks in advanced
Yes, those are perfectly equivalent. That a | b syntax for type hints is available in Python 3.10 and up. I explain this in the Pydantic course when discussing nullable fields. Any reason why you are using a version of Python that is older than 3.10?
(PEP for that change is here: peps.python.org/pep-0604/)
@@mathbyteacademy Thanks for the clarification, Fred. I just forgot to update my python version xD.
def func(*, a: int, ....) I missed why you did the star or * in parameter ,... else great work!!!!!
A * used this way indicates that what follows are keyword-only arguments (i.e. they must be passed in as named arguments).
Did you ever make the pydantic video?
yes, it's in the channel videos
I have a question: what does the Asterix in your example def func(*, a: int, b: int = 0) do? is it a "shorthand" for *args?
The * symbol is used to indicate "no more positional arguments". So in this case, since no arguments were defined before the *, it means this function has no positional arguments, only keyword-only arguments.
@@mathbyteacademy thank you very much for the clarification!
I put like then start watching
Thanks!