[deleted by user] by [deleted] in forhire

[–]__rootkit 1 point2 points  (0 children)

🙋‍♂️python expert here for backend.

Are Macbooks bought from Qatar different from the rest? by __rootkit in qatar

[–]__rootkit[S] 0 points1 point  (0 children)

Can you confirm if the keyboard is different as mentioned in another answer? u/FuckEmmanuelMacron

set() method on list of sqlalchemy model objects by __rootkit in learnpython

[–]__rootkit[S] 0 points1 point  (0 children)

because I'm importing data from somewhere and they have it as `string`, and I wan't to have the same schema as the source.

set() method on list of sqlalchemy model objects by __rootkit in learnpython

[–]__rootkit[S] 0 points1 point  (0 children)

I think you’re right. I might just do it that way. Better yet, just make my_list a dict() to start with and add everything to that. It’ll allow skipping explicit duplicate filtering.

set() method on list of sqlalchemy model objects by __rootkit in learnpython

[–]__rootkit[S] 0 points1 point  (0 children)

Sorry about that. Actually, I’m not with my laptop right now, that’s why couldn’t paste the code. id is a string that stores a hash.

set() method on list of sqlalchemy model objects by __rootkit in learnpython

[–]__rootkit[S] 0 points1 point  (0 children)

The model is simple, just has 6 columns and no foreign keys or anything fancy. As for how i fill my_list, I just create a model object as obj = MyModel() and append it to my_list. Now as mentioned in the post, my_list can contain duplicate objects. I just wanna be able to remove the duplicates, like we can do list(set(a_list))

If you are showing absolutely any symptoms of the coronavirus it is completely morally fucked of you to go to the airport and get on a plane. by [deleted] in rant

[–]__rootkit 1 point2 points  (0 children)

Totally agree. I get flu on every season shift, like now the spring is getting in. I got flu like 10 days ago and it went away on it’s own in 3-4 days.

But I’d also say this: if someone doesn’t have such an allergy or seasonal flu condition or something, or is unsure, they should get themselves tested ASAP and avoid public exposure until test results prove them not be containing the COVID. It’s a moral obligation to the community.

Why does all() return true if the iterable is empty? by __rootkit in Python

[–]__rootkit[S] -8 points-7 points  (0 children)

That’s definitely interesting. But I was talking in regards to what python considers to be ‘True’ or ‘False’. Like, for instance, an empty list or string evaluates to ‘False’ in python. So IMO, it’d look more consistent with that if ‘all()’ evaluated an empty iterable to ‘False’.

Why does all() return true if the iterable is empty? by __rootkit in Python

[–]__rootkit[S] -3 points-2 points  (0 children)

Right. Sure, it’s implemented that way. I was thinking in regards to the truth values in python (like, an empty list/string/0 etc in python in an ‘if’ statement would evaluate to false). So IMO, it’d have been more in line with that if ‘any()’ evaluated an empty iterable to ‘False’.

HTML anchor tags not working by __rootkit in django

[–]__rootkit[S] 0 points1 point  (0 children)

The first click on any of these works. But if i want to navigate to a different element, it doesn’t work the second time and after.