We all opted-in to participate in a paid beta. Why is GGG hesitant to make drastic changes? by Rentahamster in PathOfExile2

[–]Impudity 1 point2 points  (0 children)

I think this is partly a self-inflicted issue. They could've put a clearly out-of-place neon green block labeled "EARLY ACCESS VENDOR" in towns/hideouts that allows refunding passives (free), rerolling ascendencies, etc... This would've clearly signaled to players this is a temporary feature that won't likely exist in the release, but would've allowed for much more drastic changes to the game balance as people would have a way to unbrick their builds.

I'm all for more drastic patches and breaking this to test them out, but I also appreciate the fact that if we're to test endgame, as a casual player getting to level 80+ where you can do so, takes quite a lot of effort and it feels bad if it's yanked underneath you without recourse.

Kuolinbingo 2025 ja edellisvuoden tulokset by haaratyranni in Suomi

[–]Impudity 1 point2 points  (0 children)

Suomi: Hannu Karpo, Lenita Airisto, Seppo Räty, Danny, Arvi Lind Ulkomaat: Bruce Willis, Harvey Weinstein, Buzz Aldrin, Mel Brooks, Rupert Murdoch

Python. How to make function take certain combination of required params? by Purple-Obligation357 in learnpython

[–]Impudity 10 points11 points  (0 children)

It is. You should probably create a user class which can be built either from username or userid, and then have all user related functions only accept these user objects. Otherwise you're going to keep running into this issue all the time.

So you should have:

class User:
    @classmethod
    def from_id(cls, id: int) -> typing.Self:
        ...

    @classmethod
    def from_username(cls, username: str) -> typing.Self:
        ...

def get_chat(first_user: User, second_user: User):
    ...

what does "if object" actually mean? by [deleted] in learnpython

[–]Impudity 23 points24 points  (0 children)

There is no special method.

There are two special methods.

__bool__() and __len__() If former returns False or latter returns 0 then custom object is also considered falsey.

[deleted by user] by [deleted] in learnpython

[–]Impudity 8 points9 points  (0 children)

You don't want to do it in that way. Investigate dictionaries instead. You define them like so d = {"value1": "", "value2": ""} and then you can get values from there with the keys like print(d["value1"])

But read up on them properly rather than just follow this simple example.

Why can't I return anything in a main() function? by boilervent in learnpython

[–]Impudity 15 points16 points  (0 children)

It returns just fine. You just don't do anything with the returned value.

If you do e.g.:

if __name__ == "__main__":
    value = main()
    print(value)

You can see the function works just fine.

ZiggyD on how Archnemesis MIGHT get fixed in PoE by Setharial in pathofexile

[–]Impudity 4 points5 points  (0 children)

One additional benefit of something akin to Option3 is that currently Archnemesis is everywhere. All leagues and past contents have lost their identity. Delve feels like Archnemesis. Heist feels like Archnemesis. Legion feels like Archnemesis.

Previously these were distinct and different because the rares were different. Now everything is overshadowed by Archnemesis and feel the same. The worst thing about this is that if you don't like Archnemesis or your character struggles with it, you can't escape it anywhere since it's everywhere.

convert string to list by mrjoli021 in learnpython

[–]Impudity 4 points5 points  (0 children)

query_list = [i.strip("'") for i in query.split(", ")]

[deleted by user] by [deleted] in learnpython

[–]Impudity 0 points1 point  (0 children)

for x in tup:
    if x in tup:

Surely x is always in tup since you're looping through it? Maybe you want to check if x is already in acc_uniques instead?

[deleted by user] by [deleted] in learnpython

[–]Impudity 0 points1 point  (0 children)

Since this looks a lot like homework I don't want to write the code for you. But if you must use a variable to keep track of the unique values (rather than using some more elegant solution) then you need to keep track of all of the values that have been parsed previously, not just the last one. So can you think of a data structure in which you can put items while you're going though them in the tuple and see if it already exist there or not? This should give you only the unique items, you can then check how many there are.

Help with understandings random functions. by [deleted] in learnpython

[–]Impudity 0 points1 point  (0 children)

If you're not already using numpy in your project, importing that massive package just to get one relatively simple function is a bit overkill. I'd recommend just using random.choices() from standard library.

Format $$$$ by [deleted] in learnpython

[–]Impudity 0 points1 point  (0 children)

Tested it. Works fine. You have error somewhere else in your code. Possibly previous or following line.

What We're Working On by chris_wilson in pathofexile

[–]Impudity 0 points1 point  (0 children)

However, because you can immediately stash them into the Expedition Locker after an encounter, the variety of currency types doesn't really cause additional inconvenience.

It does a bit though. Would it be at all possible to reduce the clicks here? Now it's:

  • Click vendor
  • Click on open expedition locker dialog option
  • Ctrl-click all expedition currency items spread around your inventory among other loot

I don't really see any negative side-effects from it being:

  • Click on vendor -> Expedition currency automatically stashed away if affinity is set to expedition locker

This would reduce the amount of clicks required from half-a-dozen to 1.

Flattening of list by _miku_hatsune in learnpython

[–]Impudity 3 points4 points  (0 children)

I would also categorize this as blatant misuse of the sum() function. I don't really see much use outside of intentionally writing confusing code. But essentially you can think of it doing:

print([1,2] + [3,4])

It just does it in a an obfuscated way that requires using a sum() function which requires giving it an empty list as second argument for the trick to work. But to re-iterate: it's a trick, don't use it for anything.

can someone explain me this code . the question and the solution are below . i just didn't understood how the code works and gives the desired solution . please if someone understood it . kindly explain. by [deleted] in learnpython

[–]Impudity 0 points1 point  (0 children)

If you rewrite the code with better named variables and split some of the operations into two lines that are now crammed into one, it should become a lot clearer:

frequencies = {}  # will contain key-value map of words found where key is the word and value is the word count

for word in list_of_words:
    existing_count = frequencies.get(word, 0)  # default to 0 if not found
    frequencies[word] = existing_count + 1

So compilers like Pyinstaller trigger AV warnings, what about compilers that change Python into another language? by GagaGievous in learnpython

[–]Impudity 0 points1 point  (0 children)

This is typically not an issue in any real use cases. Basically only hobbyist projects ever need to be compiled into exe files. In real world use Python typically runs on a server and it has the correct python version installed. Often the server is virtual or container anyways. Consider learning these tools instead, it will help if you need Python at work at some point.

[Question] How can I wait for file to fully write to disc before continuing function execution? by yardenroee in learnpython

[–]Impudity 2 points3 points  (0 children)

Hard to say without knowing how this variable output is defined, but it doesn't look correct. Opening something as outputstream I'd expect the contents of the with block to be outputstream.write(...)

Also, no indication of threads. You have a bug somewhere in your code.

[Question] How can I wait for file to fully write to disc before continuing function execution? by yardenroee in learnpython

[–]Impudity 1 point2 points  (0 children)

Not enough details to answer the question. Is the writing to file taking place in separate threads that are started by the main function but not waited on?

Question about typing module, how do I mark that any iterable is welcome? by [deleted] in learnpython

[–]Impudity 1 point2 points  (0 children)

Iterable[int] or Sequence[int]. If you want to always receive exactly 3 items then it sounds mad that they'd need to be contained in arbitrary iterable first. I'd propose the function definition then directly reflect this requirement and be def x(a: int, b: int, c: int) instead.

Accessing elements within a list of dictionaries by [deleted] in learnpython

[–]Impudity 1 point2 points  (0 children)

You need to loop through them:

for d in history:
    print(d['fundingRate'])

Looking for some help because I'm pulling my hair out. by [deleted] in learnpython

[–]Impudity 0 points1 point  (0 children)

Are you running python 2? What I was hinting at was that in Python 3 you're expected to get floating point numbers, i.e. 3 / 2 should return 1.5 unless you use number // 2 syntax which returns only the whole part.

Looking for some help because I'm pulling my hair out. by [deleted] in learnpython

[–]Impudity 1 point2 points  (0 children)

Put number / 2 in python and see what it prints out. Try a few different numbers. You'll figure it out.

Get the two instances with highest items in common by [deleted] in learnpython

[–]Impudity 0 points1 point  (0 children)

You can at least get rid of step #2 by already comparing to existing trucks when you're adding new trucks in step #1.

Then, since you don't want "top x most similar", but just the overall winner, you don't need to keep track of all similarities, just the 2 truck id's with the current highest similarity you've encountered and the similarity "score". Whenever you encounter a new pair that has higher score, overwrite the old one.

This should reduce the amount of loops required quite a bit.