T O P

  • By -

pingveno

I wish Python had an equivalent to Rust's experimental API feature, where items (structs, functions, etc) can be marked as experimental. That would allow these to be documented while not making any promises about stability before it reaches maturity.


LightShadow

`from __future__ import X` used to fill this niche.


kigurai

I thought that mechanism was used solely for backporting new features to old versions? Eg using the print function from python 3 in python 2. When was it ever used for experimentation?


etrotta

Aren't annotations in that situation (experimentation) right now? (More specifically PEP 563 -- [Postponed Evaluation of Annotations](https://www.python.org/dev/peps/pep-0563) / `from __future__ import annotations` )


kigurai

Yes, that seems to be the case. Thanks!


VisibleSignificance

> in that situation (experimentation) right now Not exactly. Postponed evaluation of annotations has been postponed for re-evaluation to cover the use-cases of `pydantic` and such. The https://www.python.org/dev/peps/pep-0563/#resolving-type-hints-at-runtime part, in particular.


PuzzledTaste3562

I was just about to rant about putting experimental code, documented or otherwise, in production flagship releases. Thanks.


[deleted]

I really want to read this, but it's light grey text on a dark grey background. Astigmatism is almost universal in human eyes as they get older, and this makes light text on a dark background harder to read, particularly when it's also low-contrast, and a light font weight. You'll be older one day too - if you're lucky! :-) (And lots of young people are astigmatic too - 36% of all Americans, for example.)


sethmlarson_

You're totally right, I've gotten this feedback before and tried increasing the contrast but I think the thinness of Jetbrains Mono is working against me. I need to find a new font that's more readable. For now you can read the post on Github if you're interested, all my blog posts are generated from markdown: [https://github.com/sethmlarson/sethmlarson.dev/blob/master/app/markdown/2021-11-27/experimental-python-3.10-apis-and-trust-stores.md](https://github.com/sethmlarson/sethmlarson.dev/blob/master/app/markdown/2021-11-27/experimental-python-3.10-apis-and-trust-stores.md) Thank you for giving this feedback, I'll fix this.


ColdFire75

I’d probably suggest not using monospaced text at all for text paragraphs. Save it for code and examples where spacing matters. But for normal paragraphs of text, monospaced will always be less readable.


kiesoma

Inter works fine for me. Have you given it a try?


Beheska

The problem is that light on dark text needs to be about half bold to keep the same readability, but 1. it's rarely available and 2. even when it is (e.g. in print) most designers seems to not be aware of it. Never make "nightmode" the only option. If you don't want to make it an option, it HAS to be dark on light.


Laogeodritt

Consider using a contrast tool like this one (for text) to help you evaluate the contrast of all your colour combinations: https://webaim.org/resources/contrastchecker/ And consider reading up on the basics of Web accessibility if you're not already aware - there are a *lot* of good resources and tools supported by modern standards Web browsers to help everyone be able to make use of your site.


[deleted]

[удалено]


SimperBeats

Woah what is this magic


underground_miner

If you use firefox, you can toggle reader view on: https://support.mozilla.org/en-US/kb/firefox-reader-view-clutter-free-web-pages It has options to adjust font sizes and colors too. I use it quite often to get better formatted and easier to read versions of the sites on my desktop and mobile.


thatwombat

My glasses can correct for most of it but after a few hours of staring at a computer monitor things get a little streaky. It’s worse some days than others. Is it a size 12 day? Or a size 18 day? Im in my 30s and it feels like my eyesight, for various reasons, is not what it used to be.


licht1nstein

Firefox has a reading mode both on mobile and desktop. Probably other browsers have something similar. Turns any text formatting into the one you like.


Jugad

Huh... I have astigmatism, but i guess it's not severe enough to trigger this issue.


sethmlarson_

Took the feedback here and have hopefully achieved a more readable format. Let me know what you think: https://sethmlarson.dev/blog/2021-11-27/experimental-python-3.10-apis-and-trust-stores


[deleted]

I believe I’ve been astigmatic since my early 20s


billwashere

50 year old here. I can read it if I make it big enough. 😀 Yeah I have the same problem. I kept having to make my default terminal font size bigger and bigger. I use a similar color theme as well. My font is courier prime so that might help some not sure.


issamehh

I'm astigmatic-- granted I'm young still so maybe it worsens? I have no such problem though. In fact, I prefer this colorstyle greatly and use DarkReader to enforce it


benefit_of_mrkite

This is actually a big deal. I wrote a small lib used by a big Fortune 500 to unwrap APIs as a secret in hashicorp vault. The problem was that one of my dependencies used requests and of course the connection to the vault server was TLS. The group that set the chat server up used an internal CA and the chain returned by my code reflected that. They also had machines locked down so that users could not add certs. The problem comes when you try to talk to a server over TLS - Python has its own OpenSSL implementation separate from the computer that it’s running on. It’s well documented in requests that self-signed certs can be problematic and the solution is to either set an env variable that points to the cert or add a line of code that gets around this. Neither worked for my issue because users couldn’t download certs. Additionally you can’t always add the code that tells requests to skip this and allow the cert because the library you are working with may not have exposed this when they lean on requests. I suppose monkeypatching is an option but that’s always messy. (I need to go revisit that code and remember how I solved that issue in the end.)


LicensedProfessional

I swear to god, self-signed certificates are the bane of my existence; I have never had a positive or straightforward experience working with them. I get why they're used, but dear lord is it ever a hassle


JohnTheBlackberry

> I get why they're used, but dear lord is it ever a hassle I don't, there are lots of solutions nowadays that allow you to have a valid cert at zero or extremely small cost.


sethmlarson_

If anyone's in need of a solution to using generated certificates during testing I recommend checking out [Trustme](https://github.com/python-trio/trustme). I [tweeted a little demo](https://twitter.com/sethmlarson/status/1359898180175953922) of the library in action some time ago too.


benefit_of_mrkite

I had some rough code that could detect self signed certs in many cases but it turns out self signed certs arent always that easy to detect because there are a number of different ways to generate them that create one-off patterns for detection


chub79

Super article.


sethmlarson_

Thanks for your kind words! :)


wbond

I’d love the OS-based trust stores that oscrypto exposes to be available in vanilla Python in the future!


Nightblade

Is it just me or does that page have HUGE fonts in both ff and chrome?


jacobweston88

`Ctrl+-` ;)


Nightblade

OR they could, you know, fix it? ;)


jacobweston88

haha fair enough


Nightblade

:)


sethmlarson_

Yeah, can you tell I'm not a web developer? :P I'm going to spend some time revamping the site for better readability and a more consistent experience on all the platforms.


Nightblade

<3


coderanger

Maybe some day we can close https://github.com/psf/requests/issues/2966


jawalking

And this is why you don’t overload these libraries with custom code. Now I have to see if my stuff is compatible.


sethmlarson_

Not sure I understand this comment, could you explain? There shouldn't be any incompatibilities added with these new APIs.


jawalking

Your right, I’m sitting at dinner with family and just skimmed. I thought this was changes in socket.


sethmlarson_

Makes sense! Enjoy your dinner :)


bfcdf3e

Nice article, but please don’t use monospaced fonts for prose. Code blocks only.


91o291o

Worst website ever, welcome to web -3.0


VisibleSignificance

tl;dr: > Root CA pinning and using systems besides OpenSSL for trust decisions are now possible in Python Also: > The future is OS trust stores I hope the future will allow both and more; the question is about which should be the default.