Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #72960

Re: Uniform Function Call Syntax (UFCS)

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <pmiscml@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'feedback.': 0.04; 'importing': 0.05; 'class,': 0.07; 'encouraging': 0.07; 'statically': 0.07; 'imported': 0.09; 'indeed,': 0.09; 'len(x)': 0.09; 'subject:Function': 0.09; 'typed': 0.09; 'python': 0.11; 'language,': 0.12; '"from': 0.16; 'benefit.': 0.16; 'cleaner': 0.16; 'function"': 0.16; 'realising': 0.16; 'scope.': 0.16; 'syntax,': 0.16; 'for?': 0.16; 'language': 0.16; 'wrote:': 0.18; '(not': 0.18; 'code.': 0.18; 'looked': 0.18; 'bit': 0.19; 'module': 0.19; 'trying': 0.19; 'thoughts': 0.19; 'import': 0.22; 'adds': 0.24; 'necessary.': 0.24; 'propose': 0.24; 'paul': 0.24; '(or': 0.24; 'mention': 0.26; 'header:In-Reply- To:1': 0.27; 'idea': 0.28; 'function': 0.29; 'appear': 0.29; 'feature': 0.29; 'addressed.': 0.29; "doesn't": 0.30; 'bigger': 0.30; "i'm": 0.30; 'work.': 0.31; 'code': 0.31; 'faster,': 0.31; 'another': 0.32; 'call.': 0.33; 'could': 0.34; 'problem': 0.35; 'subject: (': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'there': 0.35; 'module.': 0.36; 'words,': 0.36; 'method': 0.36; 'charset:us-ascii': 0.36; 'thanks': 0.36; 'should': 0.36; 'wrong': 0.37; 'too': 0.37; 'easily': 0.37; 'to:addr:python-list': 0.38; 'rather': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'ian': 0.60; 'solve': 0.60; 'most': 0.60; 'firm': 0.61; 'reach': 0.63; 'address': 0.63; 'email addr:gmail.com': 0.63; 'such': 0.63; 'more': 0.64; 'obvious': 0.74; '(pdt)': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; bh=9zYauQV2emG44Uo3m7L9Y2fiMOIshCLycaueio0aitQ=; b=f/QWudI+StekyzMrWbuRY2kuIboKGkXy0XAapp+yz8DSoyh4bFL4EeARwVcAul3J6k cTPlXOKt/Zf3TXP12otn3Co5vMc4PZkUd07Bfmpp1Ag04OrGP82SYukeaK4o17ylD5fP LALLrC7wMK97oF+aRpfb3+kq7CALu08t1G0QBIWmvGR9GN3sMSfGwJOuhsgmeUMqjXzY fj9g8Uisk+fhOzLFXPsVS9rvb6BCy65lwupLaJ/LldxTkuta5fyNu7nXoIliWiBj0JDq 7T+DC3m9r7qRq0teSFcJ3I2G59iOBWwYtNv20ChR6+Qv0Yu86ytib+FquNwiJsokEOJr RGkg==
X-Received by 10.14.246.68 with SMTP id p44mr2801598eer.8.1402228335738; Sun, 08 Jun 2014 04:52:15 -0700 (PDT)
Date Sun, 8 Jun 2014 14:52:13 +0300
From Paul Sokolovsky <pmiscml@gmail.com>
To python-list@python.org
Subject Re: Uniform Function Call Syntax (UFCS)
In-Reply-To <7c2fd803-616d-4daa-b570-3c5de140a1da@googlegroups.com>
References <8b96ae27-20fa-4df9-807e-c806fed983c0@googlegroups.com> <mailman.10859.1402169265.18130.python-list@python.org> <7c2fd803-616d-4daa-b570-3c5de140a1da@googlegroups.com>
X-Mailer Claws Mail 3.10.0 (GTK+ 2.24.10; i686-pc-linux-gnu)
MIME-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.10875.1402228342.18130.python-list@python.org> (permalink)
Lines 51
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1402228342 news.xs4all.nl 2880 [2001:888:2000:d::a6]:49748
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:72960

Show key headers only | View raw


Hello,

On Sun, 8 Jun 2014 01:15:43 -0700 (PDT)
jongiddy <jongiddy@gmail.com> wrote:

> Thanks for the extensive feedback.  Here's my thoughts on how to
> address these issues.
> 
> On Saturday, 7 June 2014 20:20:48 UTC+1, Ian  wrote:
> > 
> > It's a nice feature in a statically typed language, but I'm not sure
> > how well it would work in a language as dynamic as Python.  There
> > are some questions that would need to be addressed.
> > 
> > 1) Where should the function (or perhaps callable) be looked for?
> > The most obvious place is the global scope.  I think it would be a
> > bit too far-reaching and inconsistent with other language features
> > to reach directly inside imported modules (not to mention that it
> > could easily get to be far too slow in a module with lots of
> > imports). As a result it would have to be imported using the "from
> > module import function" syntax, rather than the somewhat cleaner
> > "import module" syntax.
> > 
> > While there's nothing wrong with such imports, I'm not sure I like
> > the thought of the language encouraging them any more than
> > necessary.
> 
> It would only work on functions in scope. x.len() would only work if
> len(x) would work.

In other words, you propose you add yet another check for each function
call. But what many people has to say about Python is that it's "slow".
There should be lookout for how to make it faster, not yet slower.


[]

> 
> The bigger problem I find is reading other code that uses UFCS and
> not realising that a "method" is not actually a method of the class,
> but requires importing a module.  That can cause confusion when
> trying to use it in your own code.

Indeed, this UFCS idea adds inefficiency and confusion, but doesn't
appear to solve any reasonable problem or add any firm benefit.



-- 
Best regards,
 Paul                          mailto:pmiscml@gmail.com

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Uniform Function Call Syntax (UFCS) jongiddy <jongiddy@gmail.com> - 2014-06-06 23:45 -0700
  Re: Uniform Function Call Syntax (UFCS) Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-07 13:20 -0600
    Re: Uniform Function Call Syntax (UFCS) Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-06-08 13:27 +1200
      Re: Uniform Function Call Syntax (UFCS) jongiddy <jongiddy@gmail.com> - 2014-06-08 01:26 -0700
        Re: Uniform Function Call Syntax (UFCS) Paul Sokolovsky <pmiscml@gmail.com> - 2014-06-08 15:06 +0300
          Re: Uniform Function Call Syntax (UFCS) Marko Rauhamaa <marko@pacujo.net> - 2014-06-08 18:56 +0300
            Re: Uniform Function Call Syntax (UFCS) Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-08 10:38 -0600
            Re: Uniform Function Call Syntax (UFCS) Paul Sokolovsky <pmiscml@gmail.com> - 2014-06-08 19:40 +0300
            Re: Uniform Function Call Syntax (UFCS) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-06-09 04:33 +0000
              Re: Uniform Function Call Syntax (UFCS) Marko Rauhamaa <marko@pacujo.net> - 2014-06-09 09:25 +0300
                Re: Uniform Function Call Syntax (UFCS) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-06-09 09:09 +0000
                Re: Uniform Function Call Syntax (UFCS) Chris Angelico <rosuav@gmail.com> - 2014-06-09 19:13 +1000
                Re: Uniform Function Call Syntax (UFCS) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-06-09 13:37 +0000
                Re: Uniform Function Call Syntax (UFCS) Chris Angelico <rosuav@gmail.com> - 2014-06-10 01:08 +1000
          Re: Uniform Function Call Syntax (UFCS) jongiddy <jongiddy@gmail.com> - 2014-06-08 09:24 -0700
            Re: Uniform Function Call Syntax (UFCS) jongiddy <jongiddy@gmail.com> - 2014-06-08 09:34 -0700
            Re: Uniform Function Call Syntax (UFCS) Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-08 10:54 -0600
            Re: Uniform Function Call Syntax (UFCS) Chris Angelico <rosuav@gmail.com> - 2014-06-09 03:10 +1000
              Re: Uniform Function Call Syntax (UFCS) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-06-09 03:20 +0000
                Re: Uniform Function Call Syntax (UFCS) Chris Angelico <rosuav@gmail.com> - 2014-06-09 13:44 +1000
                Re: Uniform Function Call Syntax (UFCS) jongiddy <jongiddy@gmail.com> - 2014-06-08 23:38 -0700
                Re: Uniform Function Call Syntax (UFCS) Roy Smith <roy@panix.com> - 2014-06-08 23:45 -0400
      Re: Uniform Function Call Syntax (UFCS) jongiddy <jongiddy@gmail.com> - 2014-06-08 02:25 -0700
        Re: Uniform Function Call Syntax (UFCS) Roy Smith <roy@panix.com> - 2014-06-08 10:59 -0400
          Re: Uniform Function Call Syntax (UFCS) jongiddy <jongiddy@gmail.com> - 2014-06-08 08:39 -0700
            Re: Uniform Function Call Syntax (UFCS) Chris Angelico <rosuav@gmail.com> - 2014-06-09 02:48 +1000
              Re: Uniform Function Call Syntax (UFCS) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-06-09 03:53 +0000
                Re: Uniform Function Call Syntax (UFCS) Chris Angelico <rosuav@gmail.com> - 2014-06-09 14:53 +1000
                Re: Uniform Function Call Syntax (UFCS) Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-09 08:24 -0600
                Re: Uniform Function Call Syntax (UFCS) jongiddy <jongiddy@gmail.com> - 2014-06-09 23:43 -0700
            Re: Uniform Function Call Syntax (UFCS) Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-08 11:08 -0600
            Re: Uniform Function Call Syntax (UFCS) Chris Angelico <rosuav@gmail.com> - 2014-06-09 03:13 +1000
            Re: Uniform Function Call Syntax (UFCS) Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-08 11:24 -0600
              Re: Uniform Function Call Syntax (UFCS) jongiddy <jongiddy@gmail.com> - 2014-06-08 13:35 -0700
    Re: Uniform Function Call Syntax (UFCS) jongiddy <jongiddy@gmail.com> - 2014-06-08 01:15 -0700
      Re: Uniform Function Call Syntax (UFCS) Paul Sokolovsky <pmiscml@gmail.com> - 2014-06-08 14:52 +0300
      Re: Uniform Function Call Syntax (UFCS) Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-08 11:00 -0600

csiph-web