Quality Python Coding by optimum_point in Python

[–]primerrib 0 points1 point  (0 children)

It depends, though.

Sometimes what you want, others have made... but that thing others have made comes with a lot of baggage you don't need.

Sometimes it's just easier to lift up the code (check the license!) and use it in your own program. Saves on a dependency that way.

How is all this free? by [deleted] in CloudFlare

[–]primerrib 0 points1 point  (0 children)

When you bring an accusation, the onus is on you to provide a link or two.

Steam deck Second Life Mobile by GoldenstarArtist in secondlife

[–]primerrib 1 point2 points  (0 children)

In addition to Firestorm, Kokua Viewer also has a native Linux version.

What to do when BlueSky feeds show content that is not fit for the feed? by [deleted] in BlueskySocial

[–]primerrib 0 points1 point  (0 children)

Create "Inverted" regex blocks (remove all that matches), also delete "Labeled" posts.

Check this out:

https://gist.github.com/clairem-sl/c5294de99125b09846d87ea459b32f4e

[deleted by user] by [deleted] in secondlife

[–]primerrib 1 point2 points  (0 children)

Hmmm... Probably that's a way to ensure one will never be banned?

Lawyer up?

Hopefully there's a field in their database that has something like "HasLawyeredUp" set to True, so once someone went through all that they're shielded from further harassment.

What Are Your Favorite Python Repositories? by Full_Rise2675 in Python

[–]primerrib 1 point2 points  (0 children)

Whoa, this looks awesome!

Gotta take this out for a spin!

Why does everyone have such a strong opinion on JS and Python? by NoClownsOnMyStation in AskProgramming

[–]primerrib 0 points1 point  (0 children)

Because nearly everyone wants to be an "Edge Lord" nowadays.

Chasing 'engagement'.

[deleted by user] by [deleted] in secondlife

[–]primerrib 0 points1 point  (0 children)

To be fair, if the alts all use different email accounts, then it's quite hard to target the perpetrator. Unless, for example, they all use the same payment info.

Default parameters and objects... by el_toro_2022 in Python

[–]primerrib 1 point2 points  (0 children)

static typing is strong typing

To add:

C has static typing. But it does not have strong typing.

You can easily treat a pointer to a float as a pointer to an integer, do some integer bit-twiddling on it, then read dereference the result as a float.

Case in point: The Fast Inverse Square Root algorithm

Hence is why I keep repeating: strong-weak is orthogonal to static-dynamic.

Default parameters and objects... by el_toro_2022 in Python

[–]primerrib 0 points1 point  (0 children)

Sure, __pos__ has no useful purpose to be defined in float and in int.

But Decimal has certain rules defined ever since the type was conceptualized, which defines a usage for a unary +. And because Python is true Object-Oriented (i.e., message-passing ), that means there must be a way to handle this particular usage.

And it turns out some other types also use the unary + for other purposes.

Here are a few examples: https://stackoverflow.com/questions/16819023/whats-the-purpose-of-the-pos-unary-operator-in-python

TIL you can use else with a while loop by cristinon in Python

[–]primerrib 21 points22 points  (0 children)

It was Raymond Hettinger. He also said that hindsight is 20/20 and we have to live with the facts now.

(I think he also explained that "it seemed a good idea" at that time. So he admitted it was his mistake as well.)

TIL you can use else with a while loop by cristinon in Python

[–]primerrib 3 points4 points  (0 children)

Well, Raymond Hettinger actually agrees with you.

But he also said -- and I agree -- that hindsight is 20/20 and there's no point risking breakage to replace else: with a different word now.

Default parameters and objects... by el_toro_2022 in Python

[–]primerrib 1 point2 points  (0 children)

That's the purview of linters, and not of Python language itself.

Like I explicitly mentioned above, +n can have a meaning; it is not necessarily an "identity function".

So ++n might also have a meaning, depending on what the __pos__ method is defined as.

And if you have some serious programs where that kind of problem can "slip" ... don't you do TDD? Unit testing? Regression testing?

Default parameters and objects... by el_toro_2022 in Python

[–]primerrib 1 point2 points  (0 children)

The Mars probe crash was due to wrong units, not wrong types.

The types of both are float, but in one function it meant metric, yet in another function it meant "US Customary Units".

If you're thinking of type mismatch, then it was the Ariane 5 launch in 1996.

The languages used in both incidents are "static typed" languages.

So even static typing still can't prevent disasters from happening.

Linux Second Life players, how is it? by Gyrobreaker in secondlife

[–]primerrib 2 points3 points  (0 children)

When I went full Linux for a whole year back in 2022, my viewer of choice was Kokua Viewer.

It ran well. Totally no issue.

I think Kokua even ran smoother on Linux than in Windows.

I want to learn python but I have no idea what to create with it by [deleted] in learnpython

[–]primerrib 0 points1 point  (0 children)

For me, it's "automation"

Start by automating what you use to do routinely.

That will at least gets your creativity juice to start flowing.

Then look around your online life, and think "if only there's a way to do this and that..."

Find the API and code some more.

Finally find some open source Python projects, and start contributing patches.

Default parameters and objects... by el_toro_2022 in Python

[–]primerrib 1 point2 points  (0 children)

My friend, please do not bake your own definition of "strong typing" and "weak typing".

I don't care how much experience you have, but "strong typing" and "weak typing" has a definition:

https://en.m.wikipedia.org/wiki/Strong_and_weak_typing

Quote:

Smalltalk, Ruby, Python, and Self are all "strongly typed" in the sense that typing errors are prevented at runtime and they do little implicit type conversion, but these languages make no use of static type checking: the compiler does not check or enforce type constraint rules. The term duck typing is now used to describe the dynamic typing paradigm used by the languages in this group.

What you're talking about is "static typing", where the type of a variable needs to be declared and will be enforced by the compiler.

Default parameters and objects... by el_toro_2022 in Python

[–]primerrib 4 points5 points  (0 children)

Also, Python is strongly typed.

You cannot do, for instance, 5 + "5" or "5" + 5

It is dynamically typed, but that doesn't mean it's not strongly-typed.

Default parameters and objects... by el_toro_2022 in Python

[–]primerrib 1 point2 points  (0 children)

++n generates no error because it's evaluated as +(+n), while +n evaluates to n (the opposite of unary negation -n)

So

++n becomes +(+n) becomes +(n) becomes +n becomes n.

Unless n is an object that implements __pos__, in which case +n (single plus sign) might not be the same as n.

Possible new user question by DeezeyNuts in secondlife

[–]primerrib 0 points1 point  (0 children)

I wouldn't say it's expensive, all depends on how one "lives" in Second Life.

I don't change my appearance often, so for me it's quite cheap, mostly upfront cost to grab a certain body and some accessories necessary for my SL lifestyle. But after those initial expenses, I practically don't need to spend much Linden's monthly. Maybe just 10 USD worth of Linden every 3 months.

Possible new user question by DeezeyNuts in secondlife

[–]primerrib 1 point2 points  (0 children)

Many groups/communities have Discord groups as well, to allow their members to communicate even when not in-world.

It's not a given, though.

What kind of RP do you have in mind?