The fuck?

Found this in a project on Github

Attached: Screen Shot 2018-10-09 at 15.20.45.png (778x342, 56K)

Other urls found in this thread:

github.com/opensemanticsearch/open-semantic-etl/blob/master/src/opensemanticetl/etl_rss.py
twitter.com/SFWRedditImages

Attached: 1486431272926.png (402x443, 72K)

it may be enough that this pass CoC check.

I think it might be a joke on the verbosity of that code. Otherwise God help us.

It sets things to verbose or quiet if they're set in options.
If the user doesn't set them the options might hold values like NaN or unspecified or whateverthefuck. It also won't set those things to strings or integers even if the user tries to trick it into it.

So this is the power of dynamically typed languages, amazing.

Smart user

ok, but surely there's a less verbose way of doing achieving the exact same thing.

Python already provides those features in the standard library, and there are better ways to implement it anyway.

if isinstance(foo, bool), bool(foo)

You would absolutely laugh at my Matlab script too as I just do bodging the stuffs to get my target variable.

just declare them with a default value lol

Attached: 1505741832521.jpg (293x251, 26K)

Yikes!

>ITT newfags who think they know better

if options.verbose != None:
verbose, etl_delete.verbose, etl_web.verbose, etl_rss.verbose = options.verbose

python doesn't allow undefined fields right?
if options.verbose should be enough

>python
>"x == boolean"
>not "x is boolean"
>not using isinstance instead
Yikes

no. if you do that, you're only checking if it's True.

what's wrong with that, exactly?

well then your program can only be set to verbose mode.

so.......................................... maybe................................................................................... set the flag to False?

Huh? If the list is empty or None, it returns false.

... and your code will not react because it's not checking for False.

If it's false, then it does nothing. it just skips and does not set the variables accordingly.

if not options.verbose:

Attached: 1500000000114.png (108x169, 29K)

so you're going to do two conditional statements? that's even worse than OP.

There are correct ways to check if a var is defined or make sure that it is a boolean. Unless you think it's a good idea to check for every possible integer value to determine if a something is an integer. Given that Python doesn't have a limit on the size of an int, this is extra retarded. Objectively, the code is retarded. I would fire who wrote it for incompetence.

what OP is just checking if it's True or False, so a bool
just if type(options.verbose) == bool:
all wrong

RETARD

Attached: .jpg (800x800, 392K)

I'm learning/practicing Python and having a panic attack right now.
>Implying people always remember a language specific mumbo jumbo that is unique and you use it once a year,
>rather than do a working solution that doesn't appeal to programming nasiz like you.

Picture related: you and the op.
You scare away people who could program and invite pajeets. Also python build in functions are slower than the "classic" solutions that work with every programming language
.

Attached: Image1.png (680x680, 2.01M)

Does it work?
>yes
So who gives a shit?

what is the point of this thread if we can't nitpick her code

the joy of dynamic typing, I guess. in a land where options.verbose can be of any type you better make sure it's a bool lol

Link to repo ?

seriously though, I'm plowing through the process of learning programming right now and I've noticed a lot of this. In some situations, there is a VERY CLEAR right and wrong way to do things. But in others, it seems like it doesn't fucking matter. So why do people make a huge fit about it?
>muh readibility
>muh reusability
If you can't read it, get some fucking glasses.

>her

Nobody's forcing you to listen to them, but you can definitely improve if you at least consider someone else's criticism.
Unless you're really sensitive why does it matter if people nitpick code?
Sorry, I looked and it's a him :(
github.com/opensemanticsearch/open-semantic-etl/blob/master/src/opensemanticetl/etl_rss.py

Ah yes, because imperative languages are so different from each other.
No, fuck off. Programming isn't your hug box. What you want is your code be as efficient (while still being maintainable) as possible and the code in OP's is neither.
>You scare away people who could program and invite pajeets.
From where I stand it's literally the opposite because they're scaring your lazy ass away. The difference between you and a pajeet is that they aren't wimps.

What a worthless language.

Attached: 1531820736889.png (371x470, 355K)

!!(options.verbose || false)

you're all fucking worthless, go back to your shit compsci console apps

>But in others, it seems like it doesn't fucking matter
This is how you end up wasting an afternoon hunting down an obscure bug.

>protip: options.verbose can also be Nothing

should be:

if options.verbose is not None:

nah. a None check must be explicit

>Nothing
nice VB you got there.

retards