r/programming • • Jun 27 '18

Python 3.7.0 released

https://www.python.org/downloads/release/python-370/
2.0k Upvotes

383 comments sorted by

View all comments

Show parent comments

1

u/ThePantsThief Jun 28 '18

Yeah, but it's not a language feature is my point. It's harder to use because of it.

Example. Ever used Objective-C? They have an NSValue type you can use to box anything, but without special language features to help, it's cumbersome to use. Here's what it's like. It's probably not as bad in C++ with operator overloading and stuff like that, but this sort of thing is what I'm skeptical about with regards to bolted on features.

[NSValue valueWithBool:true];

[NSValue valueWithPointer:&myStruct];

value.intValue

Etc

(Disclaimer: they added a boxing operator to the language a few years ago, which helps a lot)

Anyway, I think the python additions will feel more polished to use than how I imagine std::any does.

1

u/[deleted] Jun 28 '18

Hmm isn't this just void* + enum on steroids?