On a python developers' mailing list for the core developers, Python Committers, Benevolent Dictator for Life Guido van Rossum has announced that he is stepping down effective immediately and with out appointing a successor.
Now that PEP 572 is done, I don't ever want to have to fight so hard for a
PEP and find that so many people despise my decisions.I would like to remove myself entirely from the decision process. I'll
still be there for a while as an ordinary core dev, and I'll still be
available to mentor people -- possibly more available. But I'm basically
giving myself a permanent vacation from being BDFL, and you all will be on
your own.After all that's eventually going to happen regardless -- there's still
that bus lurking around the corner, and I'm not getting younger... (I'll
spare you the list of medical issues.)I am not going to appoint a successor.
[...] I'll still be here, but I'm trying to let you all figure something out for
yourselves. I'm tired, and need a very long break.
(Score: 2) by c0lo on Saturday July 14 2018, @02:18AM (5 children)
Basics, even with variadic params, is easy and many useful things can be done with the basics.
The things start to go quite horendous when you get into template metaprogramming - not everybody's piece of cake, but it's insanely powerful. And useful.
E.g. write a templated function implementing one behaviour if you detect at compile time the (class) parameter implements a method with given signature, and a different behaviour if it doesn't. Do it without relying on inheritance - because you can't always go and pad a 3rd party library with "marker interfaces" specific to your needs.
https://www.youtube.com/watch?v=aoFiw2jMy-0 https://soylentnews.org/~MichaelDavidCrawford
(Score: 2) by Knowledge Troll on Saturday July 14 2018, @03:18AM (4 children)
That's awesome, thank you for sharing. I have yet to put together any template that has a branch that relates to the template variable but I've been wondering about what that might be useful for. Right now I just use templates to pass types through into the function so it can do something smart with them and the most sophisticated thing I think I've done so far is use T where the object name would go when using the name as a constructor in a templated class that provides constructors as static methods for the class that extends it. I was really pleased that it worked and it gave some nice shine to my base object interface.
How do you do introspection in something like C++ at compile time to find out if a method signature exists on an object or not with out relying on the class hierarchy? Is that with typeinfo()? I didn't see an obvious way that would work in the documentation.
Again, thanks for sharing, I truly appreciate it.
(Score: 2) by c0lo on Saturday July 14 2018, @09:35AM (3 children)
If you haven't had any template metaprogramming experience, it will take you some time to get what's happening here. If this is the case:
- SFINAE [cppreference.com]
- see <type_traits> [cppreference.com]
Can you manage from here?
https://www.youtube.com/watch?v=aoFiw2jMy-0 https://soylentnews.org/~MichaelDavidCrawford
(Score: 2) by Knowledge Troll on Saturday July 14 2018, @03:55PM (2 children)
Wow thanks again! Yeah that's beautiful, I just need a pointer really. I talked a bit with a friend and he introduced me to the type traits but said he had never done specialization. Thanks again! I will now explode my head.
(Score: 0) by Anonymous Coward on Saturday July 14 2018, @05:35PM
> I just need a pointer really.
Here you go: std::unique_ptr
:D
(Score: 2) by c0lo on Saturday July 14 2018, @11:05PM
Ah, shit, there are a few place where I missed to < the <.
https://www.youtube.com/watch?v=aoFiw2jMy-0 https://soylentnews.org/~MichaelDavidCrawford