Alan Turing's Legacy, Part VII

Alan Turing's Legacy, Part VII

I have run out of AT pictures - maybe one of his memorial - but I want to keep sticking to the titles.

My next plan was to use pictures of wind farms in Luxembourg, where I am from, so here we go.

Using TypedDict

So this was my second homework assignment that was set to me by my incredible mentor. I am so so lucky. 

I have the most incredible mentorship. 

I have the best mentors in the world!

And so one of them has set me a task to learn what TypedDict is 

And so that means I need to read again - arrrgh. Luckily my lead and I have spent a bit more time on this today so I have some context. But I still need more - hey I wonder if I covered it in my Codecademy course.

It's so obvious, please - DUH

It does exactly what my Lead has said to me that it does, based on the conversation that we had this morning. So why was I worrying about it so much?

From Dafoster (???!)


"A TypedDict is a new kind of type recognized by Python typcheckers such as mypy." ALREADY lost then. K THX BYE.

"IT DESCRIBES A STRUCTURED DICTIONARY/MAP WITH AN EXPECTED SET OF NAMED STRING KEYS MAPPED TO VALUES OF PARTICULAR EXPECTED TYPES."

Alan Turing's Legacy

Look, I'm not going to lie to you. I'm going to be honest with you. Sometimes it gets a bit overwhelming.

Sometimes it gets really really overwhelming.

But then I listen to Alan Turing's Legacy from the Imitation Game movie.

I love Alan Turing so so much.

I'm sure this would've been what he wanted me to do.

To keep on learning and keep on coding.

I'm sure this would've been what he wanted all of us who are doing these things and are pursuing such matters to do.

To follow and practice this discipline that he loved so much. That he loved with all his heart. And gave everything to.

Python DictTypes

The below screenshot sums it up pretty well:

Finally, I'm onto something...

I've found a really really good blog post that actually makes sense to me.

So here we go.

from typing import TypedDict

class Person(TypedDict):
  name: str
  age: int
  favourite_song: str

susanna: Person = {
  "name": "Susanna",
  "age": 29,
  "favourite_song": "Yosemite"
}


Comments

Popular posts from this blog

Hello World

Yosemite

Where To Hide A Star