Hacker Newsnew | past | comments | ask | show | jobs | submit | MaxMoney's commentslogin

I wouldn't recommend naming your function with a suffix that relates to a model. You are better off doing:

def generate_payload(crust, sauce, cheese, toppings):


In the past I've used a timestamp key for the org. Create a key like f"org_{org.pk}" that has a timestamp. Then append that timestamp to the `get_users_for_org`. Now all you have to do is invalidate the org timestamp to generate a rolling key (requires more memory).


whats wrong with functools.partial? I don't see that anywhere in the arguments.. all you say is "I find functools.partial unintuitive".. why? its a simple wrapper.


here's an example of one of the behaviors of functools.partial that I find unintuitive / undesirable:

https://gist.github.com/chrisgrimm/64bca66f14528cfda6d865cc2...


I've always thought that the closer the engineer is to the end user the better.


Ooof...not in my view. The last thing I need as a developer is to deal with non-technical people.


I suppose it depends on what product you have


Or what you do. UI/UX? Close as possible.


One of the worst, most difficult projects I ever worked on was where I was forced into direct interaction with a "customer". She was a nice enough lady in general, and knew her subject area, but she had no technical skills at all. We were paired up to improve a part of the UI and we struggled because she would ask for things that were technically impossible, and get upset when I told her we couldn't do it. It got so bad that she complained to my boss that I wasn't doing my job as her "support person". Fortunately, my boss cleared up her misconception and we finished the project. But her fundamental failure to understand the technical limitations of the hardware and software, as well as not seeing me as a partner, were a huge hurdle.


You can get away with a single hashed dict:

from types import SimpleNamespace

mydict = { "name": "moe", "age": 3, "test": {"name": "josh"} # wont work }

dotted = SimpleNamespace(*mydict)

print(dotted.name, dotted.age) # moe 3


If you don’t mind the heavier weight / newer version requirements, dataclasses from the standard lib also seem to solve this problem.


namedtuple is my usual goto for this but problem but I am glad to learn of SimpleNamespace


Exactly my thought...I wonder how the Box library differs.


it probably does nested dicts


Lichess is so much better. It's free. chess.com thinks its facebook and it looks really childish (they probably copied things from chesskid). They have like a billion developers (why? its chess.. and already done). Lichess is like 1 guy (who I think used to work for chesscom until the ceo was a dick or something)


haha no he never worked for chess.com, wonder where you heard that one :D

lichess is not one guy either, there's a whole community of developers, moderators etc.


i have sources. lots of old employee posts who quit also talking shit about the ceo


Lichess is much, much better. It's free. Chess.com is a bloated mess and it won't change.. they think they are facebook.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: