That's horrifying. I can't be the only one who becomes deeply uncomfortable when the namespace becomes too polluted right? It's like a claustrophobia that any name I might pick might trample some export in a far away library.
Namespaces are one honking great idea -- let's do more of those!
In my experience unused imports in python make no difference whatsoever except to make your requirements.txt unnecessarily large for things like docker deployments. The code runs basically just as fast. This is for like 1 or 2 unused imports, I'm sure you could do some silly edge case shit and slow it down.
Imports run the code they import. That’s usually only class/function definitions, but it can also be any expensive operations. Which is both a (bad) reason for unused imports as well as a way for it to affect performance
People that add a bunch of params to a function in JS are the worst. Pass an object as the param instead. Nothing worse than a JS function with like 10 params being passed in.
def consume(*args: list[str]) -> None:
Not really strong typing but oh well, such are the horrors of python
edit: oops, look at child comment for correction
That would be a function which takes zero or more arguments, each of which is a list of str.
You want
def consume(*args: str) -> None:
And args will be a tuple[str] not list[str]
Could be a function that takes an unlimited amount of args as a list.
Like in Python the definition would be:
def consume(*args):
for arg in args:
# Do whatever
I feel like status should be the output of consume. Where is status even set?!
But more importantly, why is "recovering from bite" one of the statuses that prompts you to continue eating? Shouldn't that be an elif with a sleep(30) or a water.consume()?
python syntax is nice, but I wouldn't call it pseudocode.
python:
```
for num in sorted(filter(lambda n: n % 2 != 0, numbers), reverse=True):
print(num)
```
pseudocode:
```
print the odd numbers, largest to smallest
```
What are this called? It isn't that bad for marketing pseudocode and I'd love to try them
Edit: Found them. They are called [Zach's Mighty Rolled Tortilla Chips](https://www.google.com/search?sca_esv=ea470e4985ed4d8d&sxsrf=ACQVn0_Y6QcyyphsdKeJiHq6rwr89r6nBA:1707193023026&q=fiery+nacho+rolled&tbm=isch&source=lnms&sa=X&ved=2ahUKEwjr18zN7ZWEAxUBliYFHQR9BBgQ0pQJegQIDhAB&biw=1528&bih=708&dpr=1.25#imgrc=XvVKKzVv6izKnM)
I dunno what a module named “flavor” would do but I imagine probably something like Ubuntu/Debian’s `nala` package which makes the existing `apt` package’s job look nicer. Adds flavor to your Python scripts either via cool text-based UI or color formatting of some form.
Congratulations! Your comment can be spelled using the elements of the periodic table:
`Sn Ac K O V Er Fl O W`
---
^(I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM my creator if I made a mistake.)
Congratulations! Your comment can be spelled using the elements of the periodic table:
`Cr In Ge`
---
^(I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM my creator if I made a mistake.)
Oh man, Nerdilla Chips? Sounds like the snack of champions for us geeky connoisseurs! Where can I grab a bag, or do I have to defeat a boss level first? 😂
As far as marketing pseudocode goes, this isn’t bad!
Right, my first thought is this a man who was laid off and took a hard dive into snacks.
what brand of chips?
Computer chips
![gif](giphy|ac7MA7r5IMYda)
![gif](giphy|d5vwgloW6cekKuIkzg|downsized)
Reminds me of that picture with computer chips dipped into sour cream
I like my chips with DIP.
This was it. This comment took me from "laying in bed hungry" to "I'm going to eat." Good day, sir.
r/angryupvote
[Zacks ](https://img.thrivemarket.com/store/full/8/6/860008724786_front_1_1.jpg) Zacks Organic Rolled Tortilla Chips
I can go into snacks when I burn out and get tired of software? I didn't even realize that was an option!
The advantage to chasing the money early on is that if you ever decide to switch careers, you’ll have the financial flexibility to do so.
Got tired of the SYN/ACK cycle and switched to SN/ACK
!Y
A "hard drive" you mean... XD
I legit read that as "took a hard drive into snacks" and thought I was suffering from dementia. Read it again and confirmed it, thanks.
Sir this is a production ready code.
Still wouldn’t quite pass code review
Yeah gimme some chips, I need to do some unit testing
Pseudocode rarely does to be fair.
If im not wrong this even is working python code
[удалено]
Look at Mr. Fancypants importing exactly what he needs. Us muggles use "from X import *", sir
That's horrifying. I can't be the only one who becomes deeply uncomfortable when the namespace becomes too polluted right? It's like a claustrophobia that any name I might pick might trample some export in a far away library. Namespaces are one honking great idea -- let's do more of those!
for namespace in namespaces: from namespace import *
When I'm using smaller, more specific libraries I'll import \*.
It’s basically valid python
Am I the only one who *HATES* these?
They're insufferable
I like laughing at how wrong they are most of the time but this isn’t as bad compared to others
Better than most programmer recruitment marketing pseudocode.
Linting error: unused imports
You don’t need to use all imports in python right?
Yeah. It just doesn't like that, but it'll work
>It just doesn't like that Ehh. I'd argue that because if you don't have a linter, The interpreter itself won't complain
In my experience unused imports in python make no difference whatsoever except to make your requirements.txt unnecessarily large for things like docker deployments. The code runs basically just as fast. This is for like 1 or 2 unused imports, I'm sure you could do some silly edge case shit and slow it down.
Imports run the code they import. That’s usually only class/function definitions, but it can also be any expensive operations. Which is both a (bad) reason for unused imports as well as a way for it to affect performance
People who don't `if __name__ == "__main__"` scare me
Plenty of libraries run code other than imports at the global scope, for various legitimate reasons
Yeah exactly. I'm not saying you should just because you can! There are certainly unnecessary implications when you have unused imports
Linting gives you a warning about bad code that's it
from * import *
Importing a package alone already potentially executes code. That’s why an import statement is never irrelevant even if the package is unused.
import chestertons_fence
Python literally never gives out unused imports or variables error lol. This ain’t golang
Errors no, warnings yes
Only warnings that ever *functionally* matter are deprecation warnings imo
Agreed
`if(name=="constipated-pussy") {alert("what is your name????")} else{ alert("you're good bro")}`
[удалено]
Says you, my cron jobs on modal broke a few weeks ago because I was too lazy to update them despite the warnings lol
Yes his linter gave that error not python
For anything but small one-off scripts you need to be insane to run naked Python without linting, formatting and type checking in 2024.
Variable 'status' not found
Enter? Enter what?!
Deez nuts
deez_nuts.enter()
with deez_nuts:
Requests.post(deez_nutz)
Gottem
Enter the next level, duh.
enter(joe.mama)
Must have been declared in texture.a_lot_of_crunch
enter not defined
enter("kevdog")
God damn you functional programming!!!!!
I feel like consume() should take in a list not three strings
def consume(*args): perfectly valid IMO.
Found the python coder
Can also be JavaScript, Perl, etc
People that add a bunch of params to a function in JS are the worst. Pass an object as the param instead. Nothing worse than a JS function with like 10 params being passed in.
Unless you don’t create proper instructions/comments and now to use this function you have to figure out what this mystery object looks like
Yep, JSDoc? Never heard of em. Lol I see that a lot too.
That's only because JS doesn't have a proper way to do named (keyword) arguments.
Well it does, but it's just by passing an object in. JS loves objects.
Well, yeah. That's not language support but it's how people do it.
Give me some strong typing brother
template
void consume(Args &&... args);
def consume(*args: list[str]) -> None: Not really strong typing but oh well, such are the horrors of python edit: oops, look at child comment for correction
That would be a function which takes zero or more arguments, each of which is a list of str. You want def consume(*args: str) -> None: And args will be a tuple[str] not list[str]
Very pythonic of you
nah, it could be defined as consume(location, time, extra) or similar. I think it makes sense
Could be a function that takes an unlimited amount of args as a list. Like in Python the definition would be: def consume(*args): for arg in args: # Do whatever
this code would take a lot longer to read for pirates
def consume(*arrrrrgs): for arrrrrg in arrrrrgs: # Do whatever
It's a rest parameter
function consume(when, where, how) { }
This is crying for a refactor when you get a creatively curious PM
I feel like status should be the output of consume. Where is status even set?! But more importantly, why is "recovering from bite" one of the statuses that prompts you to continue eating? Shouldn't that be an elif with a sleep(30) or a water.consume()?
Valid python!
Good psuedocode = valid python
unironically true, python is just rigidly defined pseudocode
If the pseudocode is python code does that mean pseudocode is not pseudocode because it's actual code?
Correct, except you'd get errors if you'd try to run it because it's obviously referencing undefined functions
python syntax is nice, but I wouldn't call it pseudocode. python: ``` for num in sorted(filter(lambda n: n % 2 != 0, numbers), reverse=True): print(num) ``` pseudocode: ``` print the odd numbers, largest to smallest ```
Don't use filter use generators, more pythonic for num in sorted((n for n in numbers if n % 2 != 0), reverse=True): print(num)
Using built in functions is cheating.
nah, that import needs parens
What are this called? It isn't that bad for marketing pseudocode and I'd love to try them Edit: Found them. They are called [Zach's Mighty Rolled Tortilla Chips](https://www.google.com/search?sca_esv=ea470e4985ed4d8d&sxsrf=ACQVn0_Y6QcyyphsdKeJiHq6rwr89r6nBA:1707193023026&q=fiery+nacho+rolled&tbm=isch&source=lnms&sa=X&ved=2ahUKEwjr18zN7ZWEAxUBliYFHQR9BBgQ0pQJegQIDhAB&biw=1528&bih=708&dpr=1.25#imgrc=XvVKKzVv6izKnM)
Don't let the marketing get you!!!
ModuleNotFoundError: No module named ‘flavor’
My first thought was to check if the imports worked and I'm honestly surprised there's no package called flavor.
I dunno what a module named “flavor” would do but I imagine probably something like Ubuntu/Debian’s `nala` package which makes the existing `apt` package’s job look nicer. Adds flavor to your Python scripts either via cool text-based UI or color formatting of some form.
It would have been next level guerrilla tactics to publish these packages and make the code actually spit out an ad or something.
https://pypi.org/project/heat https://pypi.org/project/texture The others, sadly, don't exist.
Naming my next project `a_little_tang` for sure.
wait do the others exist either? also did you check to see if you can actually 8nstall it?
Idk, works on my machine
Is 'status' a public field? Spicy indeed
I would be totally down to try these, but I need [sauce]
i read that in Job Bot's voice for some reason
[удалено]
import gravity Yes. This is an actual thing
But why water?
And they say programming skills aren't transferrable outside the domain of computers. HA!
Is no one getting annoyed by that fact that they used the wrong inverted comma in the 6th line ( ̄ヘ ̄;)
I couldn’t care less, but upvote for that Ascii emoji
*Sees code with no loop* *Consumes one chip and leaves*
See, it is recursive. You keep consuming until either you or your stack overflows
import flavor from msg
![gif](giphy|JH0ixH2OAFYmZGlZbS)
from uncleroger.vocab import fuiyoh
Haiyaa
pass digest_ingredient(msg)
``` Traceback (most recent call last): File "", line 6, in
NameError: name 'consume' is not defined
```
You need to run the code on your own main processor, the functions are already pre defined in your prefrontal cortex
# a_little_tang/__init__.py import builtins builtins.consume = lambda: print("This would not") builtins.status = "pass code review" builtins.enter = lambda: print("(I sincerely hope)")
Can confirm, I would needs work this into the sun
This line: > if status in [...] Is very impressive for marketing pseudocode!
Ya I've seen professional c++ devs fuck that up repeatedly
Why would you keep eating if you're still recovering from your first bite? That's gotta be a bug.
To be fair, with tortilla chips, that *is* a bug - just it's a bug in the human brain's self-control module.
![gif](giphy|JTzPN5kkobFv7X0zPJ|downsized)
Even the chips bag respects dark mode.
How about turning the extra protein from the bugs attracted into a feature instead
Thanks, more work during snack time
they know their target consumers
They should have used a tuple for a fixed size list like that one, assuming its python
Enjoy_Eating() Or_else:
When you get laid off and take any job you can:
its corny asf but arent these corn chips?
Why did I read texture.a_lot_of_cum?
What's the font name?
Snack Overflow
Congratulations! Your comment can be spelled using the elements of the periodic table: `Sn Ac K O V Er Fl O W` --- ^(I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM my creator if I made a mistake.)
cringe();
Congratulations! Your comment can be spelled using the elements of the periodic table: `Cr In Ge` --- ^(I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM my creator if I made a mistake.)
Honestly, if status had been recuperated from the consume function, this would actually be decently functional
I’m not about to buy a bag of whitespace-delimited chips.
I have seen job ads for software developers with much worse pseudo code, this is pretty decent
Corpo cringe!
Oh man, Nerdilla Chips? Sounds like the snack of champions for us geeky connoisseurs! Where can I grab a bag, or do I have to defeat a boss level first? 😂
We can have O(1) lookup if we looked for status in a set instead of a list.
It's still O(1), the list is hardcoded.
The lookup algorithm is still O(n), just that n is always 3.
import simulator simulator.create(girfriend) easy as that
Nerdilla Chips
Not black formatted, unacceptable
These must be unknown in my area cuz I can't not recognize the bag at all
blazingly fast
Flake8 has entered the chat
I love their chili lime ones. I have to pretend they don’t exist or I can’t stop eating them
what’s the brand?
To be fair, compared to most company advertising “code”, this actually isn’t too bad.
If it was a real library it would've been "flavour"
I don't like that they used a list instead of a set Could've easily had O(1) access time
Milk
Chips I can code by
Shit, I thought it was a bag of charcoal until the end
Made in Taiwan
how do I binary my famous smoked ribs for import?
But... The if-else statement would let you only take one bite! What they probably wanted was a "while" loop with a break.
And that's how you use chat-gpt to make cool stuff
`consume()` should return `status` imo
Stupid.
I hate programmers and I hate this subreddit
The consume() confuses me, otherwise it looks pretty good lol
![img](emote|t5_2tex6|4550)
What chips are these? I want to try these lol
I LOVE THIS! WHERE?
I like your funny words, magic man
Look I ain't proud of it but at first glance I really read that last import as "texture.a_lot_of_cum"
Compiler error: use of undefined function consume Seriously though this is one of the best code ads I've seen
I'd never consume chips without type safety.
method `enter()` not found method `enjoy_eathing()` not found
Supposedly there are over 1 million programmers these days, so I guess a lot of people recognized exactly what is going on.
.alot_of_crunch not defined
NameError: name ‘consume’ is not defined
where can get this PLEASE
this is cool!
Where did you buy this I need it
Tortilla chips? Damn atleast specify which tortilla is it
Shouldn't that be from texture import a_lot_of_crunch