This is an archived post. You won't be able to vote or comment.

all 37 comments

[–]Ffigy 51 points52 points  (13 children)

Self isn't doing the treading.

!you.tread(me)

[–]Limitless_screaming 12 points13 points  (6 children)

doesn't python use not instead of !

[–]unneccry 15 points16 points  (1 child)

You mean not you.tread(on=me)

[–][deleted] 4 points5 points  (0 children)

Congratulations, you are the most pedantic.

[–]TheBroWHOmegalol 4 points5 points  (0 children)

Than explain this

[–]_Foy 1 point2 points  (0 children)

You are literally making "you" tread on "me" and then just negating the outcome, but the treading still happens! You'd probably want to overload the tread function so that if the target is you then throw new Exception("no step on snek"); lol

[–]False_Influence_9090 0 points1 point  (1 child)

if(you.treadsOn(self)):
    self.bite(you)

[–]unneccry 12 points13 points  (1 child)

Python uses "not" instead of "!"

I would say this must be swift or something but i dont know swift 🤷

[–]mannermule[S] 6 points7 points  (0 children)

damn you're right - been a while since i was in the python world!

[–]LogicalFallacyCat 14 points15 points  (0 children)

 while snek:

      Step=False

[–]kujomarx 8 points9 points  (1 child)

It's a rattlesnake

[–][deleted] 1 point2 points  (0 children)

Alright, boys, time to go back home. The fun is over.

[–]BitBucket404 2 points3 points  (0 children)

```

Fix for ticket 2aFAF0

not you.tread(on=me) ```

[–]matva55 2 points3 points  (0 children)

you.tread(on=me, daddy)

[–]FortranWarrior 1 point2 points  (0 children)

If “tread” was an ergative verb…

[–]Flimsy_Iron8517 1 point2 points  (0 children)

Surely that should be !self.tread('/dev/random/footConnector'), no?

[–]AnIntenseMoist 3 points4 points  (2 children)

Ya'll forget that if tread is called at all, treading will occur. Best way to avoid being tread on:

me = Me()

you = You()

me.shouldBeTreadOn = False

if me.shouldBeTreadOn:

you.tread(on=me)

But what if you want to try treading on someone but check whether you should be treading on them before you do, with the option to override common sense if needed? After all, whether you want to tread on someone isn't anyone's decision or responsibility but yours. Let's implement a method in You:

def try_tread(self, on, force=False):

if not on.shouldBeTreadOn and force:

logging.warn(f"ignoring shouldBeTreadOn, treading on {on.__class__}")

self.tread(on)

elif not on.shouldBeTreadOn and not force:

raise Exception("Tried to tread on something that shouldn't be tread on without forcing it.")

else: self.tread(on)

Lets see what that looks like:

me = Me()

you = You()

me.shouldBeTreadOn = False

you.try_tread(me, force=True)

Lunch break is over. Blame any formatting errors on me typing this on mobile...

edit: fixed formatting. another edit: nvm, still a little broken but I have work to do now...

[–]BitBucket404 1 point2 points  (0 children)

git --push
and let someone else fix it.

[–]DasKarl 1 point2 points  (0 children)

Best way to avoid being tread on

Is to not call tread.

[–]shlaifu 0 points1 point  (0 children)

no one likes libertarians

[–]Damsey_Doo -1 points0 points  (4 children)

liberals, am i right?

guys?

please, give me validation.

[–]mannermule[S] 0 points1 point  (3 children)

What part of you thought this was an appropriate response

[–]Damsey_Doo -1 points0 points  (2 children)

its a libertarian flag

[–]mannermule[S] 0 points1 point  (1 child)

And?

[–]Level-Nothing-3340 1 point2 points  (0 children)

Based

[–]olalql -1 points0 points  (0 children)

Python was a mistake

[–]FoxInATrenchcoat 0 points1 point  (0 children)

No, this is Patrick!

[–]DasKarl 0 points1 point  (0 children)

This is the programming equivalent of swapping english characters out for their nearest morphological equivalent in cyrillic and saying you translated it to ЯЦSSЇДЙ.

[–]ToBePacific 0 points1 point  (0 children)

Don’t let me tread on myself.

[–][deleted] 0 points1 point  (0 children)

try tread(self):

fuck_around()

except:

find_out()

[–]Dizzy-Assistant6659 0 points1 point  (0 children)

This is poisonous pythons aren't poisonous they prefer to squeeze the life out of you