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


Groups > comp.lang.python > #20539

question about function pointer

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <dllizheng@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.055
X-Spam-Evidence '*H*': 0.89; '*S*': 0.00; 'python': 0.08; 'none):': 0.09; 'def': 0.13; 'subject:function': 0.16; 'syntaxerror:': 0.16; 'syntax': 0.16; 'subject:question': 0.16; 'invalid': 0.28; 'print': 0.29; 'error': 0.30; 'message-id:@gmail.com': 0.31; 'file': 0.34; 'curious': 0.34; 'to:addr:python-list': 0.35; 'received:209.85.160': 0.36; 'to:name:python-list': 0.37; 'charset :us-ascii': 0.37; 'received:google.com': 0.37; 'happens': 0.38; 'received:209.85': 0.38; 'received:192': 0.38; 'received:209.85.160.46': 0.39; 'received:mail- pw0-f46.google.com': 0.39; 'received:209': 0.39; 'to:addr:python.org': 0.40; 'type': 0.61; 'header:Message-Id:1': 0.62; 'below': 0.62
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:content-type:content-transfer-encoding:subject:date:message-id :to:mime-version:x-mailer; bh=vhW4WMfhDY1/yD/Ojo0VSg7PHoh9X+OA4IWbBRS9UmU=; b=b6eNDoQmhG17ABXhpOGbM3YEM6I/ECIkrgmjPMeLL8SKM7jA4R/Nm4T9ht/FHEEtWe xS0TCz5cF/8aHnGVCXIV8UQwUbs4UldtvmpFv3scZn94d8KjAk7EjZjltg8SjAGg51L1 F0+7ZaFjEW96GQ/6qW9Ze+h1h5eKEkAuc34Eo=
From Zheng Li <dllizheng@gmail.com>
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Subject question about function pointer
Date Fri, 17 Feb 2012 16:53:00 +0900
To python-list <python-list@python.org>
Mime-Version 1.0 (Apple Message framework v1257)
X-Mailer Apple Mail (2.1257)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5911.1329465188.27778.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1329465188 news.xs4all.nl 6982 [2001:888:2000:d::a6]:42729
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:20539

Show key headers only | View raw


def method1(a = None):
	print a

i can call it by
method1(*(), **{'a' : 1})

I am just curious why it works and how it works?
and what do *() and **{'a' : 1} mean?

when I type *() in python shell, error below happens

  File "<stdin>", line 1
    *()
    ^
SyntaxError: invalid syntax

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


Thread

question about function pointer Zheng Li <dllizheng@gmail.com> - 2012-02-17 16:53 +0900
  Re: question about function pointer Nobody <nobody@nowhere.com> - 2012-02-17 09:55 +0000
    Re: question about function pointer 88888 Dihedral <dihedral88888@googlemail.com> - 2012-02-17 05:20 -0800

csiph-web