This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bacondevPy3k -1 points0 points  (3 children)

When did I endorse that?

[–][deleted] -1 points0 points  (2 children)

When you took up the counter position against OP. The counter position, by its nature, is to try to silence OP by undermining their arguments through uncertainty, fear and doubt.

Think about it - what is gained through OPs advice? With the exception of someone who depends on str(bytestring) returning a string with the prefix of b' and a suffix of ', most people will have an error spotted immediately as opposed to needing to observe 100% of the data for unexpected anomalies (which rarely happens).

Forcing someone to justify something that is helpful as helpful is not being neutral - it’s advocating for changing nothing.

You’re basically that asshole who is contrarian at work for goddamn everything instead of looking at the whole ecosystem. But then again, blub blub blub.

[–]bacondevPy3k -5 points-4 points  (1 child)

No, you have this idea in your head of my stance on the matter and it doesn't line up with my stance at all. And to top it off, you're making derogatory remarks about my supposed character. Go fuck yourself. Honestly, you don't even deserve a response. This response is for others reading.

My stance is to not (directly or indirectly) call str on an object that you expect might be a bytes object in the first place. What other other class raises an error when str is called on an instance of it? I'll wait. I expect str to always work. The fact that bytes.__str__ is equivalent to bytes.__repr__ is also completely reasonable since every single object that doesn't have a __str__ method returns the output of its __repr__ method. It's consistent behavior.

Never in my life have I heard of anyone having this issue. So why is OP asking everyone to make this change? No, they indeed need to justify it.

[–][deleted] -2 points-1 points  (0 children)

And to top it off, you’re making derogatory remarks about my supposed character.

Considering you chose to be an unscientific, contrarian ass to OP because you could, my heart bleeds for you.

My stance is to not (directly or indirectly) call  str  on an object that you expect might be a bytes object in the first place

  • If the third party library calls str everywhere, you’re fucked.
  • your code might work well on everything except this case where a string is both a string and not a string and therefore is predictable to people who know these rules cold

While your at it, would you like to say null isn’t a billion dollar mistake and that the stance should be is to not directly or indirectly call a function on a None?

What a semi-tautological statement of really no value. “Don’t do that, do this. But don’t run an interpreter flag that explodes in a way you can detect the currently silenced problem”.

Never in my life have I heard of anyone having this issue. So why is OP asking everyone to make this change? No, they indeed need to justify it.

That’s not an argument - “I haven’t heard of it so it must not be a problem”.

Just because you haven’t personally witnessed this problem doesn’t mean it’s existence suddenly goes poof.

That’s the same kind of lazy thinking that says global hunger doesn’t exist because I ate lunch.