Post A7WC9HFwh8F3jo0LWi by cy@fedicy.allowed.org
 (DIR) More posts by cy@fedicy.allowed.org
 (DIR) Post #A7U4k9IqxmabtSCj2G by Creideiki@mastodon.social
       2021-05-21T09:00:50Z
       
       1 likes, 0 repeats
       
       Arrrgh, #Python. I was wondering why my timestamps were parsed wrong. I was using the datetime.strptime() format code %Z, documented as "Time zone name (empty string if the object is naive)".But what it *actually* does is check that it is given a valid time zone name, then throw that information away and return a naive datetime object anyway.If you want to use time zone information, use "+HHMM" and parse it with "%z". Alternatively, throw Python into the fiery pits of Hell where it belongs.
       
 (DIR) Post #A7U66BVPYSKF389JwG by cy@fedicy.allowed.org
       2021-05-21T19:57:09.456841Z
       
       0 likes, 0 repeats
       
       @Creideiki What I hate is this stupid elitism about calling datetime objects “naive.” If it has no timezone, it’s UTC, ferchrissake.I treat timezones like a UI property, that gets removed under the hood to make everything UTC. But then python makes naive datetime objects for no reason.python:An aware object is used to represent a specific moment in time that is not open to interpretation. A naive object does not contain enough information to unambiguously locate itself relative to other date/time objects.  Naive objects are easy to understand and to work with, at the cost of ignoring some aspects of reality.also python: classmethod datetime.utcnow()   Return the current UTC date and time, with tzinfo None. This is like now(), but returns the current UTC date and time, as a naive datetime object FOR NO REASON HURRDERP
       
 (DIR) Post #A7ULEIfkI91quDJLay by Creideiki@mastodon.social
       2021-05-21T20:29:26Z
       
       1 likes, 0 repeats
       
       @cy What really annoys me is this:Python:A string without an encoding has no meaning. We'll spend a decade making unpopular incompatible changes to the language to enforce this. Yes, we know that every sane encoding at least treats 7-bit ASCII the same. No, you cannot take advantage of that, even if you know your toy problem will stay within that range.Also Python:Time zones are just, like, your opinion, man. Have time stamps without time zones. No worries. We'll figure something out.
       
 (DIR) Post #A7UPitHBADgyvzf7tg by cy@fedicy.allowed.org
       2021-05-21T23:37:02.628886Z
       
       0 likes, 0 repeats
       
       @Creideiki What they should say is “with a tzinfo object, your datetime has a specific timezone. Without one, it is always GMT. There is no option for naive datetime structures because they are meaningless and stupid.”
       
 (DIR) Post #A7UcaNSQsZSBL3CGzA by BalooUriza@social.tulsa.ok.us
       2021-05-22T01:24:21Z
       
       1 likes, 0 repeats
       
       @cy Even consistently following the current user's environment to determine the timezone would be an improvement.  Odds are the user has set their default timezone for *damn good* reason.@Creideiki
       
 (DIR) Post #A7Ucab5CDlBXb2Qui8 by Agris@tailswish.industries
       2021-05-22T01:30:07.155399Z
       
       0 likes, 0 repeats
       
       @BalooUriza @cy @Creideiki Python is full of naive and arrogant assumptions like this. One of the biggest and most glaring one is that print includes a \n because "that's what most people want" according to Guido, and if you don't you gotta add a whole bunch of extra crap at the end specifying don't append a \n or use sys.stdio.out instead of just simply, adding a \n at the end if you want like any other language.And don't even get me started on Python 3.8.8 (default, May 12 2021, 22:10:02) [GCC 10.2.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>> 3.1+4.17.199999999999999
       
 (DIR) Post #A7UcabXYWJs10zhYum by BalooUriza@social.tulsa.ok.us
       2021-05-22T01:32:48Z
       
       1 likes, 0 repeats
       
       @Agris Yeah, I try to avoid Python for this reason.  If something I need is written in Python, whatever, I'll deal.  But if it breaks because of stupid assumptions, I'm generally disinclined to die on the hill of fixing it.@cy @Creideiki
       
 (DIR) Post #A7Uck1Is6R7vWZK56e by cy@fedicy.allowed.org
       2021-05-22T02:02:55.068433Z
       
       0 likes, 0 repeats
       
       @BalooUriza I avoid python because I figure if a complex text editor program running on a supercomputer can’t figure out what the indentation level is supposed to be, then I don’t know how the hell an idiot like me is supposed to do it.Yeah, C is way easier. …don’t judge me.
       
 (DIR) Post #A7Uw8wAXItVducKXZ2 by BalooUriza@social.tulsa.ok.us
       2021-05-22T03:49:44Z
       
       1 likes, 0 repeats
       
       @cy Meh, Ill work with kind of a lot as long as Kate or EMACS will highlight the syntax for me because otherwise I lose context.But, I definitely prefer C.
       
 (DIR) Post #A7V7WuYM3tvjLY6bUO by Creideiki@mastodon.social
       2021-05-22T06:59:39Z
       
       1 likes, 0 repeats
       
       @BalooUriza @cy C is fine. Its ubiquity means that everyone's at least picked up enough of it to get by through cultural osmosis, and its weird corners are well known by now.But I would really be happy if I could find someone willing to pay me to write Ruby. Unfortunately, all everyone wants is Python.
       
 (DIR) Post #A7V7WuyaUMuieuNYNU by cy@fedicy.allowed.org
       2021-05-22T07:47:53.853742Z
       
       0 likes, 0 repeats
       
       @Creideiki @BalooUriza Ruby’s alright, but I don’t find it any easier to read or write than C. About the only advantage Ruby has is context capturing callbacks, which C totally can do, but gcc uses some weird self modifying code technique with a compiler warning you can’t disable saying “This won’t work without allowing hackers to eat your babies!”Anyway besides that, everything I do in ruby, I just end up writing in C instead. So that might be why people aren’t eager to hire ruby writers. Python however has some fantastic namespace support, which they won’t add to C because they just light up their cigar seasoned with the tears of forsaken children, and tell you to write C++ instead.
       
 (DIR) Post #A7WC9GMzzQI0zOISsi by Creideiki@mastodon.social
       2021-05-22T09:22:25Z
       
       1 likes, 0 repeats
       
       @cy @BalooUriza I find the main benefits of Ruby to be:1) The language encourages a coding style that I find extremely easy to read and write. Higher-order functions, method chaining, and the safe traversal operator just naturally lead to really nice clean code (especially with my LISP hat on).
       
 (DIR) Post #A7WC9Gp0JIguOFOpX6 by Creideiki@mastodon.social
       2021-05-22T09:22:46Z
       
       1 likes, 0 repeats
       
       @cy @BalooUriza 2) The run-time introspection and dynamicism facilities are simple and supported as first-class features. Want to call a function based on its string name, change the behaviour of a built-in class, or mock an interface for testing? All extremely simple and well-supported. Try to do the same in Python and you're quickly bogged down in implementation details, weird syntax and nonstandard libraries.
       
 (DIR) Post #A7WC9HFwh8F3jo0LWi by cy@fedicy.allowed.org
       2021-05-22T20:14:21.370495Z
       
       0 likes, 0 repeats
       
       @Creideiki @BalooUriza Mostly I just want to know what the program is doing at any given point in time. Also C has no real concept of a built-in, since there’s no impossible to debug language switching interface going between builtin and “pure” language functions. At least, not if you stick with open source.Anyway I’m not arguing that Python is better than Ruby. I just think the namespace support in Python is fantastic. I wish I could import modules in C with a custom prefix to avoid name conflicts.