473,574 Members | 2,260 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what's the deal of "_" in Python?

Can someone give me some pointers to the related docs? Thanks.

-Yun
Jul 18 '05 #1
4 1595
Yun Mao wrote:
Can someone give me some pointers to the related docs? Thanks.


It's a variable name. See http://docs.python.org/ref/identifiers.html

If you were hoping of a more elaborate answer, please refer to
http://groups.google.ca/groups?threa...0uni-berlin.de
and also give just a *little* more detail in your next question,
so we don't have to mindread about which use of "_" you are
talking about. It's used as a standalone variable name, as a
prefix in several different ways, sometimes as a substitute for
self, and so on. Which do you mean?

-Peter
Jul 18 '05 #2
phansen wrote:
Yun Mao wrote:
Can someone give me some pointers to the related docs? Thanks.

It's a variable name. See http://docs.python.org/ref/identifiers.html


....and is special in interactive mode. See
http://docs.python.org/ref/id-classes.html
Erik
Jul 18 '05 #3
The python interpreter understands "_" as a reference to the last value it
computed, exactly analogous to "%" in the maple interpreter if you're familiar
with that. I think it's also used as a (loop-) variable name with the
implication that the variable will never be referenced. (Personally I like to
use the name "anonymous" for that purpose.)
Jul 18 '05 #4
Erik Heneryd <er**@heneryd.c om> wrote:
phansen wrote:
Yun Mao wrote:
Can someone give me some pointers to the related docs? Thanks.

It's a variable name. See http://docs.python.org/ref/identifiers.html


...and is special in interactive mode. See
http://docs.python.org/ref/id-classes.html


....and is used in the gettext module for internationaliz ation (as a
function name, in that case).
Alex
Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1487
by: Moe A | last post by:
Hi, i need to list dependencies for my package & was wondering in what python release could you start making 'in <string>' calls with more than one char..eg: "JESUS" in bible instead of
6
16931
by: Ken Varn | last post by:
Sometimes when I try to close my managed C++ application, the following dialog displays in Win 2000 Pro: The title of the dialog is "Server Busy". The message is "This action cannot be completed because the other program is busy. Choose 'Switch to' to activate the busy program and correct the problem." I don't know why this is...
28
2975
by: john_sips_tea | last post by:
Just tried Ruby over the past two days. I won't bore you with the reasons I didn't like it, however one thing really struck me about it that I think we (the Python community) can learn from. Ruby has ... an issue with docs. That is to say, there are almost none. Well, actually, there are some. For example, the "PickAxe" book (google it),...
5
2092
by: Why Tea | last post by:
How do I find out what python modules are installed on a Solaris platform? I tried to import numarray, but python couldn't find it. /Why Tea
9
4017
by: Dullme | last post by:
i can hardly know what is the code for this. I have researched palindromes, but unfortunately, I only have read about integers not for characters..I need some help..
7
1887
by: Chris | last post by:
I have an database containing lots of numerical data. I want to write a browser based interface that will allow selection of various key parameters and yield tables, plots and/or printouts of the data according to the selections. Ultimately I want this to run on an intranet so that others can get access via their browsers. The application...
0
7801
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7719
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
6450
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5616
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5299
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3739
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3749
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.