Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Pissthon Algebra

Name: Anonymous 2022-10-31 18:14

So you think [1,2]*2 = [2,3]?
Think harder you dumb nigger!
Because in Python [1,2]*2 == [1,2,1,2]

Name: Anonymous 2022-10-31 18:30

And if you're super retarded and believe that xs[0:4:1] is just xs[4:0:-1] reversed, then think twice, because Pissthon is not your african mathematics where everything is symmetric.

So if xs[0:7:1] = [1, 2, 3, 4, 5, 6, 7], then xs[7:0:-1] = [7, 6, 5, 4, 3, 2]!
"But wait! How can I get [7, 6, 5, 4, 3, 2, 1]" - a mental midget will ask in vain, missing the obvious fact that Pukethon provides no way to reverse a list with a [start:stop] range.

Name: Anonymous 2022-10-31 19:05

Same logic applies to numeric ranges, therefore range(0,10,-2) != range(10,0,-2)


There is also a reverse() method for lists, but xs.reverse() will return None.... "wait! but where is the reversed list went to?!!" -- a stupid nigga will wonder. I have bad news for you...

Name: Anonymous 2022-10-31 19:44

"Wait! Wait! I can do reversed(xs)!!!!" -- a retard might think, before discovering that 'listreverseiterator' object has no attribute '__getitem__'


Now, seeing word "iterator", any person with IQ above room temperature will stop trying to use Pissthon for anything productive....

Name: Anonymous 2022-11-01 7:54

For a while I thought Pissthon was some mathematician who made an obscure algebraic system, and I was trying to figure out why 1*2 = 2 but 2*2 = 3.

And if you're super retarded and believe that xs[0:4:1] is just xs[4:0:-1] reversed, then think twice, because Pissthon is not your african mathematics where everything is symmetric.

The only justification for this design I could find (start inclusive, end exclusive) is that it allows [:3] to select the first 3 characters, and [3:] to select everything but the first 3.

"But wait! How can I get [7, 6, 5, 4, 3, 2, 1]" - a mental midget will ask in vain, missing the obvious fact that Pukethon provides no way to reverse a list with a [start:stop] range.

That is not correct. When splicing lists over their entire length, you should either not specify end at all, or use None (in case you are using a variable to control it). For example:

xs = [1, 2, 3, 4, 5, 6, 7]
xs[0::1] -> [1, 2, 3, 4, 5, 6, 7]
xs[0:None:1] -> [1, 2, 3, 4, 5, 6, 7]
xs[6::-1] -> [7, 6, 5, 4, 3, 2, 1]
xs[6:None:-1] -> [7, 6, 5, 4, 3, 2, 1]


In fact, depending on whether the step is positive or negative, python seems to assume appropriate values for start and end automatically, thus enabling you to write the following

xs[::1] -> [1, 2, 3, 4, 5, 6, 7]
xs[::-1] -> [7, 6, 5, 4, 3, 2, 1]


Same logic applies to numeric ranges, therefore range(0,10,-2) != range(10,0,-2)

Well, of course it does. You do understand that arrays are zero indexed, yes? Making the end exclusive makes iterating over arrays more intuitive.

Now, I do realize this is a humorous post, and it's assuming the persona of an outraged moron for comedic effect (and it's quite funny, I rate it 3/5), but I thought I'd clear up possible misunderstandings it might cause to the reader who takes it seriously.

Name: Anonymous 2022-11-01 14:33

>>5
When splicing lists over their entire length, you should either not specify end at all, or use None

In other words, you need to either employ a special syntax, or add None to your continuum line. Congrats! You now have a both None and 0!! Fabulous mathematics, Guido!

Sidenote: Nil/None/Void/Etc... was never intended to be used as an integer, but instead to mean absence of value, like in an unfilled form or a database entry.

Name: Anonymous 2022-11-01 15:10

In C we have 0 as false value in conditionals, 0 as no error occurred return value in functions, AND 0 as true value in the shell.

In other words, you need to either employ a special syntax, or invert your idea of Boolean algebra. Congrats! You now have a 0 mean both true and false!! Fabulous logic, Bell Labs!

Sidenote: 0/1/2/Etc... were never intended to be used as booleans or characters, but instead to mean numbers, like a date of birth or post number.

Name: L. A. Calculus !!kfD0mPkXmx6 2022-11-02 0:23

>>7
MAYBE DA REAL PROBLEM IS YAINT RED DA STANDARD YA FUCKEN STAK BOI RETOID.

DO U KNO WAT GARBAGE VALUES ARE? WELL WEN U RETOIN FROM MAIN DAT'S WHERE YA STICK EM, YA STAK BOI RETOID. DAT'S ALL DOSE EXIT CODES R. GARBAGE VALUES. DEY DON'T MEAN ANYTHING. DEY NEVER MEANT TO MEAN ANYTHING. DAT'S Y DA POSITIVE RETOIN VALUES R ERRONEOUS. DEY SIT ON DA PHONE ALL DAY TELLIN UR GIRLFRIEND'S GIRLFRIENDS WAT U DID WRONG TODAY. GARBAGE VALUES.

Name: L. A. Calculus !!kfD0mPkXmx6 2022-11-02 0:32

>>7
YEA I KNOW UR TYPE. USIN DA RESULT OF PREDICATES IN ARITHMETIC EXPRESSIONS TO HAVE UR KOOL SHORT CODE SHORTCUTS. IT'S CATS LIKE U WHO PERVOITED DA LANGUAGE DAT DEANIS RICKY LOVED. YA FUCKEN BITBOI RETOID.

Name: Anonymous 2022-11-02 5:55

0.1+0.2 =/= 0.3
mind blown

Name: Anonymous 2022-11-02 10:39

>>7
C is basically a syntax for machine code, which works exclusively with integers. The reason C uses integers for bools is twofold. First hardware doesn't support booleans. Second, boolean algebra is a subset of integer algebra, so it make sense to use 1 and 0 for them, since it doesn't lead to inconsistencies.

Python on the other hand is a high level language, and None is used in a context where an integer is expected, while not being a part of integers. It looks ugly in practice and even uglier theoretically. Like everything in Python is just a part of bad language design by a person who thought that reference counting GC is a good idea and that variable assignment is the same as variable declaration.

Name: Anonymous 2022-11-02 12:08

>>11
There is nothing wrong with using None for absence of value, since this is literally what it stands for. As far as I understand, None maps closely to NIL in something like Common Lisp, where it can stand either for false, or nothing [assume default] (for example, end arguments to STRING=).

I do agree that it looks ugly, but in practice, you would not write it this way; I wrote it explicitly to explain what is really going on. In practice, you would conditionally assign None or an integer to a variable, and use the variable as an index:

xs = [1, 2, 3, 4, 5, 6, 7]
a = 0
xs[:a:-1] -> [7, 6, 5, 4, 3, 2]
a = None
xs[:a:-1] -> [7, 6, 5, 4, 3, 2, 1]


I'm also not a fan of python, but I think this is a minor wart compared to the tower of crap it's built on. To name a few turds:

  • The entire python2 to python3 migration circus
  • Changes breaking backward compatibility between versions in general
  • FIOC
  • Program refuses to run if you mix tabs and spaces
  • Explicit self, and poorly designed OOP in general
  • Lack of goto by design

It can't decide between being a language for quick and dirty scripting, and a language for serious programming, and it ends up crippling it on both fronts.
I do understand where you are coming from with this though. Pile up enough minor, unintuitive annoyances like that, and van Possum might end up dying in a horrible fashion, at the hands of somebody who's had enough, before Python4 is released.

Name: Anonymous 2022-11-02 12:25

>>12
Common Lisp doesn't use NIL for integer arithmetic.

Name: Anonymous 2022-11-02 12:27

Name: Anonymous 2022-11-02 12:29

>>14
"In the Python examples, we can see that numerical issues freely arise with an inconsistent application of the semantics of its type coercion. While 1/3 in Python is treated as a call to divide 1 by 3, yielding a float, the inclusion of rationals inside a complex number, though clearly permissible, implicitly coerces them from rationals into floats or ints, even in cases where this is incorrect. "

TLDR: Pissthon's place is in a landfill.

Name: Anonymous 2022-11-02 12:42

>>13
Neither does python. I think you missed my point. Just like end argument to STRING= can accept either an integer or a NIL value (the so called bounding index designator), python's slice (https://docs.python.org/3/library/functions.html#slice) can likewise take either an integer, or None, in which case it takes on some default behavior defined inside the function.
>>14
This... doesn't have anything to do with what I said.

Name: Anonymous 2022-11-02 13:54

>>16
That is why Sussman and Steele created Scheme.

Name: Anonymous 2022-11-03 15:03

"it would be better to fix the language than fix the user" — Larry Wall

Name: Anonymous 2022-11-03 15:05

"Well, my description of Perl is something that looks like it came out of the wrong end of a dog. I think Larry Wall has a lot of nerve talking about language design - Perl is an abomination as a language." — L. Peter Deutsch

Name: Anonymous 2022-11-04 1:04

>>19
NORTON? AHAHAHAHAAHAHAHAHAHAHAHAHAHAHAHAHAHAAHAHAHAAHHAHAHAAHAHAHA

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List