Everything wrong with python in two lines

Everything wrong with python in two lines
example = 'fuck'.upper
print(example)
>>>
print(example.upper())
>>>'FUCK'

Attached: 4chan thinks.jpg (568x3500, 266K)

wtf is this shit real?
>this somehow became one of the most popular languages

Upper is a method you tard, line one was essentially you just stating a function pointer.
Why are all the threads criticizing popular programming languages populated with people who clearly can't program or read the docs?

It shows how bad you are to:
- Read a doc
- Use a function
- Understanding messages on the screen
- And so on...

Attached: 1533597342306.jpg (539x636, 37K)

much easy
very intuitive
wow

This is also retarded though because you can do things like this
x = str.upper
map(x, list_of_strs)


In this case the function magically applies as you would expect. Example in OP should just be a function pointer to the upper function, not the upper function applied to a defined string.

Now following along tell me what should happen in the following example:
example = 'fuck'.upper
print(example)
>>>
list_of_strs = ['a', 'b', 'c']
print( list(map(example, list_of_strs)) )

It's not intuitive, it's documented. Stop expecting shit to spoonfeed you you fucking brainlet mongoloid

I thought you had a point, but turns out you are just retarded.

>>> example = 'fuck'.upper
>>> print(example)

>>> print(example.upper())
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'builtin_function_or_method' object has no attribute 'upper'
>>>


I'm not surprised some dickhead learning python cannot into function pointers.

obviously just a typo. It should be example().

Go rage over at faggot

>too much of a brainlet to know the difference between a reference to a function and the result of calling a function
>somehow this is python's fault

Attached: 1526955344163.jpg (800x450, 45K)

>set variable to a function
>call the function
>it returns a value
WOW PYTHON IS BROKEN

This

It's like that in literally every language.

Stop with the facts, OP is too busy sucking cock to care

Well not all of them, some languages make using method pointers and function pointers in general a pain in the ass.

No other language does this
var x = "abc".toUpperCase
x()
x('hello')


Also not one person responded to this

> what are vtables
Every language does this you tard.

> var example = "fuck".toUpperCase
> console.log(example)
< ƒ toUpperCase() { [native code] }
> console.log(example())
< Uncaught TypeError: String.prototype.toUpperCase called on null or undefined


Why would you pick Javascript you fucking neatnderthal. Javascript is actually retarded.

C++ does this, just in an ugly way.

>Example in OP should just be a function pointer to the upper function, not the upper function applied to a defined string.
Why?

>In this case the function magically applies as you would expect
Because that's how method pointers work you fucking autist, you supply them the "this" object as the first argument.
>Example in OP should just be a function pointer to the upper function
It is.

there's a lot wrong with python. but this isn't it you lowiq retard antlet

> It's yet another OP doesn't understand the fucking language thread

There are valid use cases for accessing a method directly without invoking it. For example, python heavily uses monkey patching for mocking objects in automated tests.

I agree with your example that the way builtin functions are implemented can be pretty retarded.
>>> 'asdf'.__class__

>>> str.__class__

>>> str.upper

>>> 'asdf'.upper


I don't like how the static 'str' object is the same type as a string instance. There is some magic fuckery going on in the background where even though they are the same class it knows that one is a static object defining a template for all string objects, but the other is a string instance.

wow, you're dumb. upper(x) is the same as x.upper() ... it's just syntactic sugar

>>>python

>Why are all the threads criticizing popular programming languages populated with people who clearly can't program or read the docs?
Because Jow Forums entered the state of eternal summer some time ago.

(You)

It's not even that. I'm a zoomer and I understand how to read docs and not shit up forums

The only thing I though was weird is how it for whatever is possible to call the function upper on the function itself instead of on the string.

But turns out that's not a thing either and OP simply lied.

>>> print(example.upper())
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'builtin_function_or_method' object has no attribute 'upper'
>>>


This code works as intended. It makes sense that you'd confuse properties and functions with no argument, but that's a thing in every language that has properties. Still better than not having properties.

Exactly, a zoomer, not an autistic child.

twitter is better

Why doesn't this work then

Attached: Screenshot_20181228-111751.png (1080x1554, 155K)

def FUCK():
print(“Fuck”)

Fuck()

You’re a math major huh

There are many things wrong with Python, you're a fucking idiot, and this isn't one of them.
In fact this is 100% reasonable, expected, and desired.

because you're a brainlet

bait

I’m 12

>Have a method that takes no arguments
>Pass it an argument
>Get an error
Wow, what a shit language.

You fucking retard upper is a function add "()" at the end
fuckin nigger

Of all the things wrong with Python, you managed to pick the one that's perfectly fine and only a retard would struggle to understand it. Go back to praising C in fizzbuzz threads.

B8

Yup this.
OP is an idiot used to writing in Basic

Nvm, figured it out. So it really is a bound function, not a raw method pointer. Interesting.
>print( list(map(example, list_of_strs)) )
Can't reproduce.

Attached: Screenshot_20181228-113521.png (1080x1243, 117K)

Come on OP don't be a tard
A method is always invoked by calling its name with () in the end
It's like crying that in lisp your sexp wasnt evaluated because it wasn't parenthesized
Or same shit in tcl with square brackets
Grow up and learn how the language you're using works, you monkey

How's it wrong, then?
If example is 'fuck'.upper, then clearly example() should be 'fuck'.upper(). Everything is working as it ought.

>>> example = 'fuck'.upper
>>> print(example)

>>> print(example())
FUCK
>>>

>I don't like how the static 'str' object is the same type as a string instance. There is some magic fuckery going on in the background where even though they are the same class it knows that one is a static object defining a template for all string objects, but the other is a string instance.
str is a class, 'string' is an instance. This makes perfect sense.
>>> class A():
... def __init__(self, x):
... self.x = x
... def f(self):
... return self.x
...
>>> A.f

>>> A().f
>>> A('x').f

>>> type('string')

>>> type(str)

>>> type(A)

Ignore the >>> A().f line, there by mistake

Which site are you using in your screenshot for python evaluation? Or is it some IDE?

What about something non retarded like upper("fuck") instead of the fucking OOP or other new garbage programming style that is pushing a shitty syntax unreadable.

CL-USER> (string-upcase "fuck")
"FUCK"

How retarded can someone be? Line 1 is a pointer to the function and line 2 actually CALLS the function.

I know good languages do it right.

are you fucking blind?
x.upper
vs
x.upper()

Bring back the Blobs you pajeet fucks!

Which language is this?

common lisp i guess

the first message literally tells you what you did wrong you tard

>put function that relies on the this value to be a string in a variable
>doesn't call the function with the required this value
>the error is JS's fault
Seeing how you can't even spell it right, you are the neanderthal

>I don't know programming
The post

Common Lisp

you are literally wrong
irb(main):001:0> example = 'fuck'.upcase
=> "FUCK"
irb(main):002:0> puts example
FUCK
=> nil
irb(main):003:0>

Attached: 1526265053856.jpg (600x800, 99K)

But that's simply not true. I get the exact output as this guy: