User Controls

Today a twitter nigger told me python's ternary operator is too edgy for him.

  1. #1
    Sophie Pedophile Tech Support
    So i told him.


    leave() if upset == True else stay()
  2. #2
    So i told him.


    leave() if upset == True else stay()
    ​

  3. #3
    mmQ Lisa Turtle
    The following users say it would be alright if the author of this post didn't die in a fire!
  4. #4

    triggered
  5. #5
    gadzooks Dark Matter [keratinize my mild-tasting blossoming]
    Originally posted by Sophie So i told him.


    leave() if upset == True else stay()

    To be honest, I find terniary operators in JavaScript to be difficult to write and interpret.

    But yeah, with python, as with everything else in python, it is just much more human readable.
  6. #6
    gadzooks Dark Matter [keratinize my mild-tasting blossoming]
    lol necro'd post.
  7. #7
    gadzooks Dark Matter [keratinize my mild-tasting blossoming]
    Oh man, and don't get me started on how awesome list/dict comprehensions are in python.

    OMG.
  8. #8
    gadzooks Dark Matter [keratinize my mild-tasting blossoming]
    Like I just realized how easy it would be, using python, to, say, find the post with the most Thanks, using so little code:

    most_thanked_post = sorted([sorted([(post, post.thanks) for post in subforum if post.thanks > 0*], key = lambda x: x[1])[-1] for subforum in forum], key = lambda x: x[1])[-1]

    At least I think that would work.

    Then again, I wouldn't consider anybody a complete moron for not being able to interpret that immediately, even as a skilled/experienced developer, BUT, it just is really kinda cool that you can technically do all that in one line.

    * Stricken out because technically not necessary.

    EDIT: For the record, I tested it, and it works (using a collection of mock posts with a thanks attribute (an integer representing how many it has received), divided into subforums).
  9. #9
    gadzooks Dark Matter [keratinize my mild-tasting blossoming]
    Y u no take interest in programming threads NIS?

    Who else besides Lanny, Sophie, and myself are programmers here?

    And not necessarily as a job, but even enthusiasts/hobbyists?
  10. #10
    RisiR † 29 Autism
    SpectraL is the greatest hacker of all time. filtration and apt (RIP) are legit, though.
    The following users say it would be alright if the author of this post didn't die in a fire!
  11. #11
    RisiR † 29 Autism
    Ohh and aldra of course. He's wicked.
  12. #12
    Technologist victim of incest
    Originally posted by RisiR † SpectraL is the greatest hacker of all time. filtration and apt (RIP) are legit, though.


    Apt died? Don’t tell me he committed suicide.
  13. #13
    RisiR † 29 Autism
    Probably not.
  14. #14
    Technologist victim of incest
    Probably not dead, or probably not suicide, or both? He certainly hasn’t been around much.
  15. #15
    RisiR † 29 Autism
    Probably both.
  16. #16
    Technologist victim of incest
    Cool, you little shit!
  17. #17
    gadzooks Dark Matter [keratinize my mild-tasting blossoming]
    So we have Sudo and we have apt.

    Do we have any posters by the name of install or update?
  18. #18
    Sudo Black Hole [my hereto riemannian peach]
    Originally posted by gadzooks So we have Sudo and we have apt.

    Do we have any posters by the name of install or update?

    my next alt will be get

    I don't really program, I know a decent amount of python because it's kinda intuitive but a buddy of mine is supposed to make me a website in 2 weeks. He fucking better because he owes me money the little faggot. I don't really trust any of you to do it and you probably shouldn't trust me.

    Anyways, can anyone here curl?
  19. #19
    RisiR † 29 Autism


    The caption is literally what I think when the crack runs out.
    The following users say it would be alright if the author of this post didn't die in a fire!
  20. #20
    gadzooks Dark Matter [keratinize my mild-tasting blossoming]
    Originally posted by Sudo Anyways, can anyone here curl?

    Like, download files in Ubuntu?

    Or slide disc-shaped rocks down a lane of ice while your teammates sweep their brooms feverishly in a (typically vain) attempt to try and influence the trajectory of the disc-shaped rock so that it localizes within a set of concentric circles?
Jump to Top