It appears people no longer know how to operate one of these. Absolutely no one knows what it is anymore (probably for the last 5 years). #mystery#object
Mystery object of the day. Not sure if this is for photography (filter of some sort?);or audio (pop screen?). UFO (Unidentified Found Object) -- UPDATE: Mystery (already) solved -- pop filter for a microphone. Well... part of one. (see https://infosec.exchange/@dko/112203637956510198) #Mystery#object
It's fine for #lists - but it's not the most "#Pythonic" way to do this, at least for lists. Like some other built-in objects, lists have a method .copy() which does what it says - returns a #copy of the #object. That's more obvious than using ...[:] when reading the code, so that tends to be the preferred way in Python.
Unfortunately, #tuples don't have .copy(). They do support [:]. 🤷
We need a visibility rating between unlisted and private that doesn’t show up on any timelines at all but can be viewable on your profile by anybody.
This would be used for anti-hellthreading purposes. Right now, my fork of Soapbox marks all replies as unlisted so that if a hellthread emerges, it doesn’t clog up everybody’s public timelines with garbage. But unlisted still shows up on personal timelines, like if you follow one of us.
Having a visibility between that doesn’t show up in any timelines at all but also isn’t exactly hidden could prove useful as an anti-hellthreading method. This is meant as brainstorming
@NEETzsche@lain@hj example 10 doesn't define any additional fields, if you extend a type. I am reading 4.1 here and my understanding is that defining your type context if you extend a type is a "must" condition
I think I had my best sleep in weeks. It wasn't solid, but I fell back to sleep, after a trip to the bathroom downstairs, that never happens. So, around 5am, I got up.
Still a sky full of stars though. Sunrise is two coffees away.
I was thinking of something, I'm curious about what you think?
#UnpopularOpinion I don't like instances that allow far more than 500 characters per toot. #ActivityPub is not a blog platform. I tend to just scroll over posts that are too long. I didn't come here to read long texts. I think that toots should be short messages. With links if need to more persistent and retrievable content. Toots are meant to be more like short-lived status updates. Which is why I auto delete toots after a few days, unless they get traction.
I remerber a #PEP for proposing to add a constant to #Python marking this absence of value for a parameter in a function call. This would fix cases where None is a valid value.
But I can't find this PEP. Does someone else remeber this?
We don't actually need a special constant for this; this is a pretty standard Python #idiom:
NOT_SET = object()
def f(a: int, b: int = NOT_SET):
if b is NOT_SET:
function called without second argument
...
NOT_SET is a bare object, which will never compare equal to anything else, and is a singleton so the natural test is #object#identity. It absolutely distinguishes between "no argument" and "caller happened to pass the #default value #explicitly".
Just learning #Python... it doesn't have constants? Really? And you're supposed to simulate them by using a naming convention? You're kidding me, right?
Not sure exactly what you're getting at; there are various approaches. If you want #symbolic#constants, use the enum module/base class, and you can have constants of any flavour you like, protected from assignment. It's in the standard library and highly recommended.
If, on the other hand, you're trying to protect the user from themselves, you can create an #object that represents a #value but which resists changing value - but you can't prevent the user assigning to a name.
Does anyone else use the first person for #python docstrings? I picked this up from reading #twisted source written by @glyph and @itamarst. My dialect of it: The #class is speaking about itself. It refers often to "my #instance" or "an instance of me" when speaking of an #oop#object rather than itself as a class. And methods are where it says "I do this" if that's what it does generally, like a leader speaking about what she did with the unspoken help of others carrying out that actual work.
Languages on the rise like Rust and Go are being quite vocal against inheritance and many engineers seem to agree. Why? And is it the fall of inheritance?
This results in "a" being a list with one item, itself. Thankfully the repr recognizes this as being an infinite recursion:
>>> a
[[...]]
>>> a[0]
[[...]]
So a[0] is in a, obviously?
>>> a[0] in a
True
But what about...
>>> a in a[0]
True
The "payload" is "[[]]" here for prettiness, but just needs to be a list of something, and could easily be "['foo']". But, philosophically, does 'foo' exist in the list? There's no way to "reach" it once evaluated...
It's a little #clearer what's going on here if you put it this way:
>>> b = []
>>> b.append(b)
>>> b
[[...]]
>>> b is b[0]
True
So all you've done is create a #list, and then #append (not extend) that list to itself. Since a and a[0] are the same #object, the in test will return True either way.
Meaning: which ones it will produce, which ones it will render fully, which ones it will render in degraded mode, and which ones it will ignore altogether?
The weld-parser crate wasn't happy with its name. Now, we must refer to it as weld-object. This crate has ambitions for its life!, like supporting Elf32, MachO, COFF, and more object formats, look at this little cheeky!
The Tragic Death of Inheritance (avivcarmi.com)
Languages on the rise like Rust and Go are being quite vocal against inheritance and many engineers seem to agree. Why? And is it the fall of inheritance?
What is Kbin’s identity?
I’m trying to get my head wrapped around the identity (or purpose) of Kbin....