From: "Guido van Rossum" <guido@python.org> > [Tim] > > I'm not sure why, but there's a widespread intransigent belief that > > it's somehow purer to say "del" for freeing memory that happened to > > hold an object. > > I'm the origin of this convention; it was part of Python 0.0. > Switching from [m]alloc/free to new/del was *not* to differentiate > between mere blobs of memory and objects; it was to indicate that > these macros and functions were a layer on top of malloc/free. > (Originally, they merely changed the signature around a bit.) > > The new/del names are partly borrowed from C++, where new and delete > are the memory (de)allocation operators as well as the object > (de)allocation operators. Yes, but in C++, when they're used as operators, they *always* do object construction/destruction as well. In fact, in some forms (placement new) its possible to get just the construction/destruction behavior without any allocation/deallocation. I think Tim is on the right track. -Dave
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4