News for hackers. Stuff that matters.

eirki

Re:The different uses of Python type hints on Sunday April 16, 2023 @05:24AM (#35588474)
Re:The different uses of Python type hints on Sunday April 16, 2023 @05:20AM (#35588463)
FastApi very recently added support for Annotated, and now recommends using that over default arguments.

https://fastapi.tiangolo.com/release-notes/#0950

Re:Pytest Tips and Tricks on Wednesday March 22, 2023 @02:04AM (#35257388)
I absolutely agree about fixtures-as-arguments thing. Ward does this a lot better, using default values for the fixture factory. There's a long issue on ideas to implement something like that as a pytest plugin (https://github.com/pytest-dev/pytest/issues/3834), but it seems the resulting plugin relies on something of a hack.
Different time period, but definitely check out History of the Twentieth Century.

https://podcasts.apple.com/us/podcast/the-history-of-the-twe...

Re:How did I run that code again? Tools to help recall on Friday January 28, 2022 @10:04AM (#30115468)
I also switched to just recently. Nice and simple syntax, and a very satisfying verb:

  just push
  just test
Re:IPython 8.0 on Wednesday January 12, 2022 @12:50PM (#29910331)
Also chiming in to say thanks for the good work! This looks like an amazing release - I practically jumped in excitement when I saw the fish style autocomplete.
Re:The Data Classes Decorator on Sunday December 12, 2021 @03:22PM (#29533233)
Disabling mutation prevents you from changing attributes after instantiation, no?
Re:The Data Classes Decorator on Sunday December 12, 2021 @12:29PM (#29531529)
I just wish I could disable the type coercion. E.g. 1 becomes "1" if the attribute is annotated str.
Re:Show HN: My proposal for a new keyboard layout on Tuesday November 16, 2021 @01:01AM (#29237398)
Does it not lack a proper æ?
Re:The Decline of Django on Friday October 15, 2021 @12:27PM (#28879582)
I think the comparison between VS Code and Chrome is spot on. Monoculture in the text editor/IDE space is a very real risk right now.
If 10% are located in and around one location and the rest are spread around the world, then that would definitely count as 'heavily concentrated' in my book
Re:An Iraqi who saved Norway from oil (2009) on Thursday October 07, 2021 @06:06AM (#28784329)
> For instance Australia has a lot more private wealth saved up than Norway. At a lower GINI coefficient as well!

This is demonstrably false: https://data.oecd.org/chart/6tTs

Re:Show HN: Heroku Alternative for Python/Django apps on Thursday September 09, 2021 @08:55AM (#28469135)
This is my experience as well. $10 for each running process (server, worker, database) adds up very fast.
Re:Benefits of Not Using an IDE on Saturday August 21, 2021 @11:15AM (#28257654)
Absolutely agree. The myriad of overlapping tools were the biggest problem for me when learning javascript.
Re:Julia: Faster than Fortran, cleaner than Numpy on Sunday June 20, 2021 @02:35PM (#27572714)
Genuine question: Is Julia used for anything other than mathematics yet? Is there any sign of the Julia community expanding beyond science, maths, machine learning etc?
Re:Ward: Modern Test Framework for Python on Sunday May 16, 2021 @11:04AM (#27174182)
And some linters will complain if there is a collision between the names of a parameter and a function.
Re:Ward: Modern Test Framework for Python on Sunday May 16, 2021 @10:52AM (#27174116)
Absolutely love the idea of using default params to identify fixtures. That part of pytest has always rubbed me the wrong way.
Re:The Lives of Napoleon on Monday May 10, 2021 @10:01AM (#27106054)
Also: The Age of Napoleon. https://ageofnapoleon.com
Re:Beginner’s guide to mechanical keyboards on Friday April 30, 2021 @11:13AM (#26994464)
This is very good advice. It's often so tempting to get on that threadmill after making the first purchase.
Re:Best practices for writing SQL queries on Saturday April 10, 2021 @12:47PM (#26762830)
> Avoid

  SELECT
    title,
    last_name,
    first_name
  FROM books
    LEFT JOIN authors
    ON books.author_id = authors.id

> Prefer

  SELECT
    b.title,
    a.last_name,
    a.first_name
  FROM books AS b
    LEFT JOIN authors AS a
    ON b.author_id = a.id
Couldn't disagree more. One letter abbreviations hurt readability IMO.
It is also marginally faster, I think.
Re:Vivaldi 3.6 Introduces Two-Level Tab Stacks on Thursday January 28, 2021 @09:15AM (#25941998)
Alternate anectdata: I switched to Vivaldi a year or two ago and have had no problems with crashes.
Re:Metal monolith found by helicopter crew in Utah desert on Wednesday November 25, 2020 @07:10AM (#25208374)
Reminds me of the "House of Special Purpose"

https://en.wikipedia.org/w/index.php?title=House_of_Special_...

Re:Structuring Your Project on Sunday December 08, 2019 @03:12AM (#21734883)
Mypy sometimes uses init files to understand internal imports.
There are a couple of apps out there! Although my experience was that I didn't really have a need for the data when all was said and done. Maybe I should have picked up knitting..
Re:It Shouldn't Be This Hard to Responsibly Fly a Drone on Sunday September 08, 2019 @02:20PM (#20912300)
Not exactly. NIMBY "carries the connotation that such residents are only opposing the development because it is close to them and that they would tolerate or support it if it were built farther away." (Wikipedia)

Whereas drones, people just don't like them at all.

I agree with your second point (self-driving cars might make more efficient use of roads), but I don't see how cheaper taxis is going to reduce road congestion?
Re:Things to use in Python 3 on Wednesday May 15, 2019 @06:32AM (#19918036)
Mypy uses the init files to resolve absolute imports.
Re:Still in love with Rust on Thursday November 22, 2018 @03:57AM (#18508776)
Black (The uncompromising Python code formatter) is all the rage atm.

https://github.com/ambv/black

Older »