From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp5.mail.ru (smtp5.mail.ru [94.100.179.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id CF98D469719 for ; Mon, 16 Mar 2020 16:15:46 +0300 (MSK) Date: Mon, 16 Mar 2020 13:15:45 +0000 From: Nikita Pettik Message-ID: <20200316131545.GC14628@tarantool.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Subject: Re: [Tarantool-patches] [PATCH 1/2] tuple: hide internal functions from box.tuple.* List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: babinoleg@mail.ru, tarantool-patches@dev.tarantool.org On 15 Feb 19:08, Vladislav Shpilevoy wrote: > box.tuple.bless, .encode, and .is are internal. Their > behaviour is not documented, and they may omit some checks for the > sake of speed, and can crash if used without thinking. > > Nonetheless, despite they are not documented, curious users could > notice them in box.tuple.* output via autocompletion, for example. > And they could try to use them. This is not ok. > > box.tuple.bless() being called by a user leads either to a crash, > or to a leak (because it is basically tuple reference counter > increment). > > box.tuple.encode() is kind of a wrapper around msgpack, and users > should not touch it. It may change, may be removed. And is just > makes no sense except some rare cases in schema.lua. > > bless() and encode() were used in schema.lua only, so the patch > simply moves them to box.internal.tuple. > > box.tuple.is() is kept as is, because > - this is used in the tests a lot; > - it is totally safe; > - that function actually makes sense, and some users could have > already started using it. > > There is no a test, since nothing to test - bless() is not > available for users anymore (assuming no one is brave enough to > rely on box.internal). LGTM