• 5 Posts
  • 188 Comments
Joined 1 year ago
cake
Cake day: March 1st, 2024

help-circle
  • another interesting thing is optimizing runtime using mypyc. This is how our dev toolchain is so quick.

    mypy, flake8, isort, … these kinda packages

    Have never tried using mypyc would appreciate anyone sharing their experience with mypyc or other Python package compilers.


  • logging_stricttoPythonProgram hangs instead of exiting
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    5 days ago

    That’s what code reviews feel like. Don’t take it personally. Sugar coating advice is a skill when working in groups.

    Evidently i’m not, so got that code review advice the less than tender way.

    Everyone one else was not critical and let these avoidable coding mistakes slide. That doesn’t fill me with confidence. Should strive to spend more time testing code bases to eventually be able to see and avoid these kinda coding mistakes.

    If anyone feels the need to set me on the road to becoming a lovable teddy bear full of positivity and group comradery, jawboning alone is too kind, feel free to put me in the hot chair by reviewing packages have written and published.

    Have ordered the packages according to the value you’d gain by learning them.

    logging-strict

    wreck

    pytest-logging-strict

    sphinx-external-toc-strict

    drain-swamp and drain-swamp-action


  • Can see both the pros and cons.

    Looking at existing packages we actually use, it’s a mixed bag. When helping other projects, have not run into the situation where had to use ruff. Do see some uptake. It’s not like a light switch there will be multiple commits before the ruff configuration is right. But i’m sure the configuration is simplier than the rocket science that is: black, flake8, isort, pre-compile, tox configurations.

    Overtime expect Rust to bleed into the Python toolchain. The excuse to resist this is there is not enough time in the day for Python let alone other coding languages especially low level languages like Rust and integration of those low level languages and Python. Sounds like a ton of work unless intending to write Rust modules to optimize speed of complex Python apps.


  • So web scraping speed is at issue? I believe Python has beautifulsoup for web scrapping.

    Unless it’s for a learning experience, would recommend to not reinvent the wheel. Have been there done that too many times.

    I feel like the village idiot cuz not properly learning that lesson.





  • logging_stricttoPythonProgram hangs instead of exiting
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    6 days ago

    Having multiple return statements in one function is a mistake. There shall ever be only one, unless that’s unworkable due to tons of checks.

    Cringe! That’s like watching bad movies for the joy of really really bad movie moments. Watch Dead Snow II THEN Dead Snow I. Both are cringe. Former good cringe later really really bad cringe. Do not watch in chronological order.

    A return statement within a while loop. Is that good or bad cringe?

    Code with multiple return in one function/method screams noob. Especially when its completely unnecessary and avoidable. The return statement in random locations is a close 2nd.

    The return statement in a while loop is just eyebrow raising. Like trying to write cringe, but forgot the threadpool, with GIL enabled, within the while on crack cocaine loop.






  • logging_stricttoPythonProgram hangs instead of exiting
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    6 days ago

    What duh eh does standard idiom mean?

    In computer programming, a programming idiom, code idiom or simply idiom is a code fragment having a semantic role[1] which recurs frequently across software projects. It often expresses a special feature of a recurring construct in one or more programming languages, frameworks or libraries. This definition is rooted in the linguistic definition of “idiom”.

    https://en.wikipedia.org/wiki/Programming_idiom

    So this term is vague and abstract. Really not a specific term or grouping of related things.

    The actual terminology

    That standard idiom is called, process guard or simply guard. Learn about this term when doing anything involving multiprocessing.

    The if __name__ == “__main__”: guard is important when working with multiprocessing in Python. This prevents the creation of duplicate processes when the module is imported.

    https://labex.io/tutorials/python-how-to-pass-arguments-in-python-multiprocessing-430780

    So it’s totally not for what its being described as. Or that’s an oversimplification with a loss of vital details of it’s actual purpose.

    It could be worse

    When don’t know the name for something, Call it stuff!. Ya know, when really suack at naming things, be unrepentant! Stuff is as bad of a term i could come up with. Means didn’t know how to describe it to accurately relate what it is or does, without being vulgar; out of fear the typos author left an Easter egg which is best left lie.

    Used this term once, for a SQLAlchemy non-request based router implementation, the Session (term already taken) i call SessionStuff. Doesn’t that just scream competence and authoritative implementation?

    What do you do for a job? Urrrh … stuff?

    Regretted immediately and still do. Cuz session seems to have three different contexts / meanings.

    Oh shit! Used the term, stuff. That’s code prefer to not even read. That’s a thing of nightmares that haunts our collective waking moments.




  • Oh no a stray None! Take cover …

    Robust codebase should never fail from a stray None

    Chaos testing is specifically geared towards bullet proofing code against unexpected param types including None.

    The only exception is for private support function for type specific checking functions. Where it’s obviously only for one type ever.

    We live in clownworld, i’m a clown and keep the company of shit throwing monkeys.



  • Assuming an equivalent package is produced, what’s the maintenance cost (factoring in coder availability) difference between the Python vs faster language implementations?

    ^^ therein lies the rub

    Reminds of the expression, premature optimization is the root of all evil

    if not swimming in funding, might be a darwinic move to choose the faster language and have to code everything yourself from scratch


  • logging_stricttoOpensourcePublic Money, Public Code
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    16 days ago

    They want to prevent coders from dictating terms. It’s about perceived control/power over coders and ensuring whatever power coders wield is dispelled thru legalese spells.

    Have written lots of open source as well as packages which are not published. The amount of contributions measured in issues/PRs/funding has been the same. Absolutely none.

    Lost any incentive to care about debating licenses’ purity.


  • logging_stricttoPythonPyPi tariff
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    19 days ago

    Social engineering malware

    Will save the world by foreshadowning the pypi.org delisting announcement

    Great example of malware that uses social engineering to deceive and only later realize those good intentions were quite harmful.

    One step away from requiring a PoW algo to fund package authors. Which is great unless running on a crap laptop from the stone ages. Then it becomes a barrier to entry or simply broken UX.

    Don’t like to hear this, but at some point in time this package will be delisted from pypi.org