Live data from Hacker News

PyCon US 2021 Recordings are Available

pycon.blogspot.com

31–40 of 107 posts

Re: PyCon US 2021 Recordings are Available

#31
Been waiting for these!

There's a lightning talk from day 1 about the new Flask that explained some of the performance improvements, which actually answers a question I've had since its release.

Also really enjoyed the talk on the new profiler Scalene, I would love to try it out ASAP.

Looking forward to the rest.

Re: PyCon US 2021 Recordings are Available

#32

Question about youtube: Youtube video thumbnails abbreviates long video titles to "..." For example: TALK / Mariatta Wijaya / Oops! I Became an Open.. Is there a way to fix this?

The playlist is easier, but if you like the grid view, pasting the following into the browser console seems to work:

  style = document.createElement('style'); style.innerText = 'html:not(.style-scope)[typography] { --yt-link-line-height: 4rem; }\nytd-grid-video-renderer #video-title.yt-simple-endpoint.ytd-grid-video-renderer { -webkit-line-clamp: 10!important }'; document.getElementsByTagName("head")[0].appendChild(style);

Re: PyCon US 2021 Recordings are Available

#34

Earlier quoted context omitted.

The thing with Python types is that they are “type hints” and not true types, hints is the keyword. There’s also two type checker implementations. As they are hints it means you can still pass in wrong values in some situations and what types check on one implementation may not type check with the other implementation. So the types are superficial only in Python. The paper “Python 3 types in the wild” at https://news…

> As they are hints it means you can still pass in wrong values in some situations and what types check on one implementation may not type check with the other implementation. So the types are superficial only in Python. Could you elaborate. When can you pass in wrong values? The type checkers aren't always precisely the same (some do inference, mypy doesn't), but the cases where they disagree are usually because one…

I believe GP means that they are not checked at runtime. But I don't think that matters much in case of finding bugs, because you run mypy and it will scream that you are assigning wrong type.

I use it whenever I can and it helped me find many bugs in the code (especially not checking if value is None through the Optional). It also makes refactoring your code in IDEs that understand types (like PyCharm) much much easier.

Re: PyCon US 2021 Recordings are Available

#35

Earlier quoted context omitted.

The thing with Python types is that they are “type hints” and not true types, hints is the keyword. There’s also two type checker implementations. As they are hints it means you can still pass in wrong values in some situations and what types check on one implementation may not type check with the other implementation. So the types are superficial only in Python. The paper “Python 3 types in the wild” at https://news…

> As they are hints it means you can still pass in wrong values in some situations and what types check on one implementation may not type check with the other implementation. So the types are superficial only in Python. Could you elaborate. When can you pass in wrong values? The type checkers aren't always precisely the same (some do inference, mypy doesn't), but the cases where they disagree are usually because one…

I had a situation I gave a method argument a type hint, I then called that method with a completely different type by mistake. The type checker didn’t pick up the error so I got a runtime exception where I’d expect a type checker to catch the issue.

I don’t have the specific example, it was something I observed not so long ago, said well that’s shit, fixed my code issue and moved on. Not being a huge fan of Python outside of small scripts and only using Python as told to use Python I took little interest in the detail as was a case of just get the job done and move on.

It’s been a while since I read the paper I shared but think that mentions it something similar if I remember correctly.

Re: PyCon US 2021 Recordings are Available

#36

After watching this 2018 talk on typing: https://www.youtube.com/watch?v=hWV8t494N88 and this one last year: https://www.youtube.com/watch?v=ST33zDM9vOE&t=68s and finally this one in 2021: https://www.youtube.com/watch?v=Lj_9TyT3V98 I think I'll finally start using type checking - it really seems to just eliminate a whole class of potential bugs; a class that is often not tested at that.

The thing with Python types is that they are “type hints” and not true types, hints is the keyword. There’s also two type checker implementations. As they are hints it means you can still pass in wrong values in some situations and what types check on one implementation may not type check with the other implementation. So the types are superficial only in Python. The paper “Python 3 types in the wild” at https://news…

You can have strict lint checks enforced with pre-commit hooks/ci checks. My current team I've been adding type checker tests (mypy + pyright) and for now as we're missing types I have type checkers on a nice rule of any prs you make must decrease the number of type errors (by 5, but up to you how harsh you want to be) in master to be merged forcing people to add more types. Once the type hints eventually hit 0 on our current strictness settings I'll gradually increase strictness requirements higher. Full strictness of no Any's anywhere including intermediates isn't really possible as a number of 3rd party packages lack types (tensorflow is especially sad with types). But we can get many of the strictness and that should cover a large number of basic bugs.

Re: PyCon US 2021 Recordings are Available

#37

After watching this 2018 talk on typing: https://www.youtube.com/watch?v=hWV8t494N88 and this one last year: https://www.youtube.com/watch?v=ST33zDM9vOE&t=68s and finally this one in 2021: https://www.youtube.com/watch?v=Lj_9TyT3V98 I think I'll finally start using type checking - it really seems to just eliminate a whole class of potential bugs; a class that is often not tested at that.

I personally don’t think Python type hints are particularly useful for solo projects, but are very useful for communicating the intent of my code to others.

Re: PyCon US 2021 Recordings are Available

#39
post #37

After watching this 2018 talk on typing: https://www.youtube.com/watch?v=hWV8t494N88 and this one last year: https://www.youtube.com/watch?v=ST33zDM9vOE&t=68s and finally this one in 2021: https://www.youtube.com/watch?v=Lj_9TyT3V98 I think I'll finally start using type checking - it really seems to just eliminate a whole class of potential bugs; a class that is often not tested at that.

I personally don’t think Python type hints are particularly useful for solo projects, but are very useful for communicating the intent of my code to others.

Sometimes, "others" is yourself in a few months trying to look at the code :)

If my project is something beyond a small script that I plan on working on on or off for a while, I do find that annotations definitely help. Also, it fuels IDE completions between functions if you annotate your input.

Re: PyCon US 2021 Recordings are Available

#40

Question about youtube: Youtube video thumbnails abbreviates long video titles to "..." For example: TALK / Mariatta Wijaya / Oops! I Became an Open.. Is there a way to fix this?

Not the best, but right click on one of the titles, inspect element, it should put you on a #video-title, you then just want to uncheck the -webkit-line-clamp and set a very high max-height like 999999px

Or just add the following to any CSS injecting extension:

#video-title { -webkit-line-clamp: 999 !important; max-height: 999999px !important; }

Post reply on HN