Better HN
topnewbestaskshowjobs
Log inSign up

BiteCode_dev

24,628 karma · joined Oct 21, 2019 (7y ago) · 5,512 submissions

I write to save you time and effort when dealing with Python:

https://www.bitecode.dev/

Email: contact at bitecode.dev

Submissions

comment 3y ago · link · parent

If you recommend pyenv, it's game over, I will never been able to convince you otherwise.

Because it's a sure sign that you have not had to help a team of geographers in a school or quants in banks or small kids.

Your method will only work for a very small subset of python users, and you don't have met enough of them to even know what error they encounter.

It's ok, you are a skilled dev, you offer skilled devs advices.

But no, pyenv has too many ways to fail for the average python users. Espacially since the "py" command on windows and suffixed python on mac and linux works fine to deal with multiple versions.

If would be too long to debate each point so I won't. But I don't make those claims out of the will to be right or contradict people.

I worked with python since 2.4, in dozens in countries. In africa. In asia. In the silicon valley.

It gave me a huge sample to study.

comment 3y ago · link · parent

The first one, build from sources, is incredibly easy to get wrong.

You may end up with an incomplete python without proper tkinter, ssl or zip support. Sometimes it will look like it works, only to fail later down the line when you use some part of openssl that requests don't exercice often or when you install numpy/scipy wheels. Not to mention someone will do "make install" instead of "altinstall" and break their machine with a 3 letters mistake since apt or rpm python will get erased.

If you wonder how to setup a python venv, you should not compile anything (so no oyenv neiter). In the same way that if you wonder what oil to put in your car, you should not attempt to fix your breaks.

The fact you suggested it underlines my point that you are too experienced with the stack to give advices that would be useful for most confused devs in python. A C# dev that starts python just wants, and needs, one reliable happy path.

In fact, it's part of the problem. Paradox of choice, with too many solutions that won't fit the average user context.

Funnily, now that I get close to 20 years of python, I find myself going back to the beginner stuff.

comment 3y ago · link · parent

I would advice against all of those recommandations. It would be very long to explain point by point, but in short, my experience is that if someone is asking OP's question, they don't have the experience to deal with the modes of failure of what you are proposing

There is not a lot of things I'm very adament about.

Yet when it comes to python env setup, I have a strong opinion on the matter, built from seing hundreds of people failing at it in a thousand ways.

Looking for the best solution will not work.

You have to go to the minimal one that does the job, which have the least possible ways to fail. And still work in 5 years.

Most people like you, giving advices on HN, know too much about it to realize you solve lots of problems without even thinking when you perform your workflow.

But the average python user don't have this knowledge. They just want to get things done and have something that works.

I am very confident in these claims, although a HN comment is not the best format to demonstrate it.

I should write an article on it honestly at this point because so many devs are suffering for this.

A new team has been put in place to work on packaging officially in python. But the fruits will take years to mature.

comment 3y ago · link · parent

On mac and linux, python executables are suffixed, on windows, use the py command (hence using the official installer).

Once you have created the venv, it doesn't matter.

comment 3y ago · link · parent

Pyenv compiles python. This excludes it for pretty much every solution by default, as compiling can fail in so many weird ways.

Nobody wants to support something that can turn even the simplest ticket into a game of cluedo.

comment 3y ago · link · parent

After 10 years using all of them, in about 50 companies (as a freelancer) with various constraints, contexts, systems and skillsets involved, here are my definitive conclusions:

- stick to regular python installers from python.org if you can. Don't use homebrew, pyenv, conda, the windows store, asdf, etc. They have subtle and least subtle variations that will bite you.

- always use "-m" when you run a python tool, even in venv. This will let you be explicit about which python you use. On windows, use the "py" command to create the venv. No need for pyenv.

- if you are in linux, research how to install python seriously. If the command is simple, you probably got it wrong. E.g: Ubuntu has 3 packages to install, not one. People giving you a one true way are lying to you. Pyenv is a trap.

- learn to use basic venv and pip. Never do something outside of a venv, even for small scripts. You can have one big venv for all your small scripts. Don't even install black outside of a venv. You can get very far with just that. Forget about pipx.

- if you want to have better tooling, use pip-tools. Not pipenv. Not poetry. Not flint. Not pdm. Not anything else. They will fail you. Pip-tools is just good enough and just reliable enough. Embrace manual venv handling. It's not a big deal. Automated tools will betray you.

- learn to be comfortable with the PATH and the PYTHONPATH. No matter what you do, something may need tinkering.

- tox is indeed the best tool to test several envs, but people that need it are rare. Don't bother for now.

- if you want to build a package, use hatch. But you probably don't.

- if you have to use conda, don't use pip or venv at all. Don't use piptool, poetry or anything. Stay on pure conda land. It sucks, but the alternative of mixing them is worse.

comment 3y ago · link · parent

Exactly. People keep telling how much ubuntu sucks and how they are now using x.

But eventually, my mother is still using it after 10 years.

comment 3y ago · link · parent

That would be a great short movie.

You could also show the same person, 10 minutes prior, telling their locksmith they should say "main-key" instead of "master-key" because that's inappropriate, otherwise they won't call them for more gigs.

comment 3y ago · link · parent

Well, in Europe, if you want to know how much a user pays, you need to tie telemetry to their account containing personal information, which is forbidden by GPRD unless they give their explicit consent and they have a process to delete/rectify/download all of it.

Since most telemetry are optout and don't bother about giving users access to their data, they can't legally do it.

That's my point really: useful telemetry is really, really invasive. So just ask consent, and accept most users will tell you no.

If you chose what's convenient instead, you will not only have a mixed bag of data, but also you have decide to basically force yourself on people, in an age where a part of your userbase is getting upset over things like using the wrong pronoun on them.

I tell yes to Firefox and VLC to report on my usage. It tell no to Google and Microsoft. They want their cake and it it: behave badly, and then have we trust them.

comment 3y ago · link · parent

That's my point, if you want really useful information, you need identifiable users, and for that, you need consent.

So ask for it.

All data will be biased and incomplete anyway, so at least acquire it in an ethical manner.

comment 3y ago · link · parent

If it's the case, then take the hint.

I can't believe how much BS we have to hear about consensual sex these days to the point people are suggesting contract before making love, and yet the virtual signalers in the valley can't still see the problem with forcing people to be spied upon even when told to piss off.

Maybe too many new web framework turn over also burnt out their common sense?

comment 3y ago · link · parent

How does that work in Europe where all tracking must be opt-in thanks to GPRD?

comment 3y ago · link · parent

Unfortunately that's the conclusion that most managers will draw, without asking more questions.

But knowing that only 1% of users use this feature is not enough to make that decision:

- maybe 1% of your users only use it, but they are the ones that pay the most money

- or it's the most prolific users so it generates half of your content

- or it's a niche feature used by power users, but those users are the ones bringing other users, introducing you to companies and doing free support

- or it needs to be used by only 1% of the users by design, and it's enough to be useful (E.G: bug report form)

- or your report it wrong, it's one percent of all accounts, but 10% of actually active users

etc.

Most telemetry will not tell you that of course.

comment 3y ago · link · parent

Thanks.

The first one is French dubbed in russian. If you speak russian, I would recommend it as it as the slides clearly in view.

However, the second one, in English doesn't show most of the slides, and they are really necessary to get the full picture. However, it's a playlist, and there are better ones in there.

If you don't mind, I will update my comment to include one of them.

comment 3y ago · link · parent

Do you have a link?

comment 3y ago · link · parent

Jancovici's conference about how ecology and economy eventually boil down to fundamentals such as energy is eye opening:

https://www.youtube.com/watch?v=KtQBPhKSWu0&list=PLMDQXkItOZ...

The punchlines are wonderful. E.G: "The first law of thermodynamics will always win over political promises".

Highly recommended.

2237.

The “I can't believe it can sort” algorithm(arxiv.org ↗)

2 points · by BiteCode_dev · 3y ago · discuss

comment 3y ago · link · parent

It's been the case for python for a while and nothing bad happened. Nobody started to use accentuated variables. But I finally could put my name in comments without having to put a # coding header, which is nice.

comment 3y ago · link · parent

Yes, and it's a good thing. I want them to have a business model, because I want them to survive.

Not every project can be as amazing as debian and run strong for so many years on volonteers alone.

comment 3y ago · link · parent

Genepi production is pretty limited itself because of the heavy restrictions on the plant harvest, espacially since it grows mainly in the Alps. And the Mercantour rangers are not tolerant of people picking more than their share.

Source, I live there.

comment 3y ago · link · parent

That's basically what the Academie Francaise have been doing all along for French and why we have words like "courriel" instead of email in the dictionary despite the fact most people never use them.

comment 3y ago · link · parent

Most software is. I'd say 1% of what I've been paid to code was useful to humanity.

comment 3y ago · link · parent

No, we don't defend corporation, we hope people don't spread their energy on a 1000 useless outrages.

Attack the corporations, but focus your efforts.

Attacks are currently used to get many emotional responses and make people will engaged, but they don't make any body act or learn.

This is a waste.

Choose one topic, like "Apple use slave labors" or "Google spy on everyone", and keep at it for a few years.

The rest is just distraction and energy diffusion.

comment 3y ago · link · parent

I actually prefer "goto-less alternative 2". It's more verbose, but more explicit. No magic, I know exactly what happen. If you suddenly have more functions, you should have an array of functions with a clean_up_level variable.

Of course, you probably should not have a global state that some clean up function with a side effect deals with in the first place, but it's the c linux kernel so I assume there is something I don't know.

comment 3y ago · link · parent

Unless you access the database only and don't have the reports accessed through an end-user application, you usually have some language involved to call your SQL queries, normalize input, abstract them away, etc.

You do have to learn an additional API, but as a programmer, that's something I have to do every day anyway.

comment 3y ago · link · parent

You missed the last sentence of the comment.

Even with custom query, using escape hatch bring a lot to the table because you benefit from the ORM core handling system for configuration, serialization, pooling, etc.

Not to mention some core (like sqla core) in fact include a functional query language that is capable of representing low level sql in any form. In which case you benefit even more, and you can do your report perfectly.

comment 3y ago · link · parent

Can confirm. My .email is regularly reject even by my own country administration.

comment 3y ago · link · parent

In school yes, because it's a very peculiar microcosm. Outside it varies a lot.

comment 3y ago · link · parent

When you are on the spectrum, no, there isn't.

It's not about you. It's about others. And a lot of it about what things appear, not what they are.

That's not shocking to an autist. That's factual.

We don't mind factual, we mind intent.

Just like I don't mind what you state, I do mind the virtue signaling it attempts.

comment 3y ago · link · parent

Yes, but it's necessary.

Because just be yourself works well in Disney movies, but IRL, we have social norms and many reward/punishment systems depending on how much and often you deviate from them.

So you have to find a balance between being genuine and fitting in. Everybody does, but for some of us, it's more costly. Usually, the balance is achieved by having different groups in which you can adjust the cursor differently, like work, friends and family, if you are lucky.

1
747576
184