"Python String Emptiness Test"

=> What's the most self-explanatory and safest way of checking if a Python string is empty?

Not a simple question, unfortunately, and no universal answer.

@r000t @x_cli Only if it's actually a string :)

object of type 'NoneType' has no len()

@x_cli @bcl Damn, never thought about someone passing an object that's straight up lying....

But testing for the string type solves a lot of that... maybe? Can you lie about that, too?


@r000t @x_cli It's a common problem in python. None is just so easy to use.

· · Web · 0 · 0 · 0
Sign in to participate in the conversation
Infosec Exchange

A Mastodon instance for info/cyber security-minded people.