@grumpy_developer isn't it just a site where you store your résumé? Why read it? :-)
@yogthos спасибо, посмотрю на досуге!
@yogthos тем не менее, идея о том, что этот тонкий телефончик будет давать доступ к любой информации, показывать реальное местонахождение и позволять делать групповые видеозвонки не приходила в голову даже самым смелым мечтателям. (Но консумеризм ужасен, это правда.)
@sophia hm... That sounds misleading. Of course you want to treat people differently. I can spontaneously bear-hug most of my male friends, but towards unsuspecting women that'd be disrespectful. In other words, using the same level of respect doesn't mean treating them in exactly the same way.
@art_codesmith as a former #Django contributor, I can confirm it. The original point of the ORM was to provide an abstraction over constructing SQL statements in different dialects. Turning table rows into object was an obvious convenience, but it never tried to be an actual ORM which abstracts the entire notion of storage for objects.
@voldmar есть, есть! Хотя, наверное, менее напряжённая, чем в Твиттере :-)
@NfNitLoop welcome to Northwest!
@Xyc0 because it's more clutter and more maintenance, generally.
@Xyc0 it's what join is. I'm not talking about how to solve the problem (you can just do path[1:]), my point is that you can describe this constraint in a docstring, but can't express it with types.
@Xyc0 this is from the actual code I'm working on right now: the function has to treat the path it gets ("/dir") to be contained under a mount point ("/mnt/drive"), so the full path is going to be "/mnt/drive/dir". Mentioning of the leading slash is important because you can't just `join` them:
Path("/mnt/drive") / "/dir"
will give you "/dir".
But my point is that the question "what kind of value the function expects" is way more complicated than just "what type it is".
@Xyc0 for that we have docstrings :-). And there you can express any notion, not just "it's a string", but also things like "a path relative to a mount point, always starting with a /". Try and express that with type hints :-)
@Xyc0 don't constrain the argument type to `str`, it'll work for `Path`s just as well.
(This is a good example of why I don't like this new trend of bringing types into Python, but that's a whole different story.)
Obscure #python bit of knowledge: os.scandir() accepts not only strings, but also its own dir entries, so you can do:
for entry in os.scandir('.'):
os.scandir(entry) # not entry.path
It just saved me from thinking about how to split up a long line :-)
Programmer, software architect, mentor.
Follow friends and discover new ones. Publish anything you want: links, pictures, text, video. This server is run by the main developers of the Mastodon project. Everyone is welcome as long as you follow our code of conduct!