@orsinium@fosstodon.org
@orsinium@fosstodon.org avatar

orsinium

@orsinium@fosstodon.org

:python: #python :golang: #golang :elixir: #elixir :rust: #rust #security #foss

No politics.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

carlton, to python
@carlton@fosstodon.org avatar

Seems relevant today… my controversial maintainer's opinion is that dropping support for EOL versions does not count as a breaking change.

orsinium,
@orsinium@fosstodon.org avatar

@carlton People who don't care about upgrading , probably also don't care about upgrading libraries.

orsinium,
@orsinium@fosstodon.org avatar

@simeon @carlton it depends. We're in the process of upgrading django and dramatiq, and that's perhaps even harder than upgrading python.

jugmac00, to python
@jugmac00@fosstodon.org avatar
orsinium,
@orsinium@fosstodon.org avatar

@jugmac00 You can filter out warnings that you don't need:

https://docs.pytest.org/en/6.2.x/warnings.html

In my projects, I make all warnings to raise except for the ones that cannot be fixed. Without it, it's easy to miss important ones.

dabeaz, to random
@dabeaz@mastodon.social avatar

Wait, the "E" in IDE isn't "Enshittifier?"

orsinium,
@orsinium@fosstodon.org avatar

@dabeaz no, E in IDE is for .

alexelcu, to python
@alexelcu@social.alexn.org avatar

has batteries included in its stdlib, but when those batteries aren't enough people have to resort to installing pip + virtualenv + pyenv, alongside the OS's native packager, which they still need for native dependencies.

In , for writing all kinds of scripts, with all sorts of dependencies, all you need now is Scala CLI; which can also help with distributing your script as a JAR, or as a native executable:

https://scala-cli.virtuslab.org/

Checkmate, Atheists!

orsinium,
@orsinium@fosstodon.org avatar

@alexelcu the stdlib includes venv module that creates a virtual environment and installs pip in it from a bootstrap. So, in a sense, all you need is Python interpreter itself.

python3 -m venv .venv
.venv/bin/activate
pip install -r requirements.txt

I agree things are easier in many modern languages, but they aren't that gloom as you make it sound.

AstraKernel, to programming

While other languages

const SERVER_PORT = 80

Golang 😏:

const serverPort = 80

orsinium,
@orsinium@fosstodon.org avatar

@AstraKernel Nobody stops you from naming it SERVER_PORT, it just will mildly annoy some seasoned engineers.

Or name it sERVERpORT to annoy everyone.

grueproof, to random
@grueproof@fosstodon.org avatar

deleted_by_author

  • Loading...
  • orsinium,
    @orsinium@fosstodon.org avatar

    @grueproof I have "touch grass" in my daily schedule.

    danie10, to math
    @danie10@mastodon.social avatar

    In praise of Reverse Polish Notation (RPN) with Python or C

    For whatever reason, RPN didn’t really succeed in the general marketplace, and you might wonder why it was ever a thing. The biggest reason is that RPN is very easy to implement compared to working through proper algebraic, or infix, notation. In addition, in ...continues

    See https://gadgeteer.co.za/in-praise-of-reverse-polish-notation-rpn-with-python-or-c/

    orsinium,
    @orsinium@fosstodon.org avatar

    @danie10 There is also a / way to not treat math operations as anything special but regular functions. So, there is also no infix magic, no unexpected order of operations, no magic. But in addition to all these benefits it shares with RPN, it's also consistent with the rest of the language, and so doesn't require learning anything new. I think it's neat. Sometimes, less is more.

    voxpelli, (edited ) to random
    @voxpelli@mastodon.social avatar

    Reminder that the only safe dummy domains to use are:

    • example.com
    • example.net
    • example.org

    And nowadays there's also a safe dummy TLD: .example

    These are safe because they are reserved by IANA as as special-use domain names for documentation purposes on direction of IETF in RFC 2606 and RFC 6761.

    Any other domain can be registered and as such should never be used as a dummy domain for documentation or as eg. an example in default configs.

    See: https://en.wikipedia.org/wiki/Example.com

    orsinium,
    @orsinium@fosstodon.org avatar

    @voxpelli I see a lot of people in using evil.com, and I'm afraid that one day it will actually turn evil.

    treyhunner, to python
    @treyhunner@mastodon.social avatar

    The singleton design pattern involves making a class that has just a single instance.

    It's possible to make singletons in , though you may not need to.

    Python's module objects are often used for the same shared state that singletons offer.

    https://youtu.be/sppHANksoG4

    orsinium,
    @orsinium@fosstodon.org avatar

    @treyhunner What's interesting, built-ins have one real singleton: None. It has NoneType type but you can't create new instances of it. And you can't copy it. And overall, I tried hard, out of curiosity, to make another None, nothing worked. Maybe, only if to copy it somewhere on C-level.

    dabeaz, to random
    @dabeaz@mastodon.social avatar

    I've always thought that knowledge of tuples, lists, dicts, and sets was part of the lingua franca of Python, but I've increasingly had doubts. Maybe they've never been that. I don't know. Just a fleeting thought of the morning

    orsinium,
    @orsinium@fosstodon.org avatar

    @_KevinTrainor @faassen @dabeaz For me, using sets and operations on sets is natural. And then when I do, co-workers are surprised: "Wow, can Python do that O.o". And indeed, I've recently seen a Python introductory book that doesn't cover sets at all.

    orsinium, to python
    @orsinium@fosstodon.org avatar

    I just finished an overly-documented Rust-powered calculus interpreter:

    https://github.com/orsinium-labs/rlci

    4 years ago, I got into lambda calculus by watching 1 and implementing 2 on the Lambda Calculus workshop by @dabeaz, and I still think this is the most mind-blowing thing I know (on par with category theory). Learning was an excellent excuse to dive into it again.

    bitprophet, to rust
    @bitprophet@social.coop avatar

    Wondering why docs include unstable/nightly API members, or more specifically, why doc.rust-lang.org isn't (apparently?) broken down by version.

    It feels like if I was browsing Python's docs and it had random references to upcoming features or PEPs scattered throughout.

    Very annoying to have to doublecheck a given thing does/doesn't have that label. Do that many Rustaceans run the nightlies?

    orsinium,
    @orsinium@fosstodon.org avatar

    @bitprophet there are many bad things to say about Python docs, but they are certainly versioned. When you look docs for 3.10, it won't include any docs for 3.11. It might mention some upcoming PEPs, but for a reason. In particular, typing docs do that because with lazy annotations and typing_extensions you can use any typing features on any Python versions.

    orsinium, to python
    @orsinium@fosstodon.org avatar

    Started to measure the performance of threads vs async/await (with asyncio and uvloop) on TCP with expectation that async will win by far. I'm almost a week in it and at this point I'm not sure about anything.

    It's too early to draw conclusions, but looks like with a fast enough network, threads and async are about the same.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • everett
  • osvaldo12
  • magazineikmin
  • thenastyranch
  • rosin
  • normalnudes
  • Youngstown
  • Durango
  • slotface
  • ngwrru68w68
  • kavyap
  • DreamBathrooms
  • tester
  • InstantRegret
  • ethstaker
  • GTA5RPClips
  • tacticalgear
  • Leos
  • anitta
  • modclub
  • khanakhh
  • cubers
  • cisconetworking
  • megavids
  • provamag3
  • lostlight
  • All magazines