HackerTrans
TopNewTrendsCommentsPastAskShowJobs

jengland

no profile record

Submissions

Ask HN: Is there a good PyCharm setup for Pyright?

5 points·by jengland·3 anni fa·0 comments

comments

jengland
·4 mesi fa·discuss
uv has almost 2x the number of monthly downloads Poetry has.

- https://pypistats.org/packages/poetry - https://pypistats.org/packages/uv

In the 2024 Python developer survey, 18% of the ecosystem used Poetry. When I opened this manifold question[0], I'm pretty sure uv was about half of Poetry downloads.

Estimating from these numbers, probably about 30% of the ecosystem is using `uv` now. We'll get better numbers when the 2025 Python developer survey is published.

Also see this: https://biggo.com/news/202510140723_uv-overtakes-pip-in-ci-u...

[0]: https://manifold.markets/JeremiahEngland/will-uv-surpass-poe...
jengland
·3 anni fa·discuss
In my opinion Vitalik's post[0] about it was much more thoughtful and interesting.

[0]: https://vitalik.eth.limo/general/2023/07/24/biometric.html
jengland
·3 anni fa·discuss
I prompted GPT-4 with this and I think it solved it. The first time it assumed the words were generated with random letters and solved it like a math textbook problem. Then I prompted it with this:

Ok, I see you calculated the probably using randomly generated "words" from the letters of the English alphabet. I am interested in the actual probably of two real words in English that are 5 letters wrong share the first three characters.

I am a Python developer, so I will understand it if you give me a Python script.

I gave me this which looks right to me:

  import nltk
  from collections import defaultdict
  
  nltk.download('words')
  from nltk.corpus import words
  
  # Get the English words
  english_words = words.words()
  
  # Filter the words to get only five-letter words
  five_letter_words = [word for word in english_words if len(word) == 5]
  
  # Create a dictionary to store the count of words with the same first three letters
  words_dict = defaultdict(int)
  
  # Count the words with the same first three letters
  for word in five_letter_words:
      key = word[:3]
      words_dict[key] += 1
  
  # Calculate the number of pairs with the same first three letters
  same_first_three_letter_pairs = sum((count * (count - 1)) // 2 for count in words_dict.values())
  
  # Calculate the total number of pairs from the five-letter words list
  total_pairs = (len(five_letter_words) * (len(five_letter_words) - 1)) // 2
  
  # Calculate the probability
  probability = same_first_three_letter_pairs / total_pairs
  
  print(f"Probability: {probability:.4f} or {probability * 100:.2f}%")