** Operator

S

Sathyaish

I tried it on the interpreter and it looks like it is the "to the power
of" operator symbol/function. Can you please point me to the formal
definition of this operator in the docs?
 
C

Christoph Zwerschke

Alex said:

I think this should be also mentioned in the Built-In Functions section
of the Library Reference. Probably most users do not read the Language
Reference (since the main menu says it's "for language lawyers" and yes,
it is not really fun to read).

In the explanation about pow() at
http://docs.python.org/lib/built-in-funcs.html, the notation 10**2 is
suddenly used, without explaining that it is equivalent to pow(10,2). I
think this could be improved in the docs.

-- Christoph
 
Z

Ziga Seilnacht

Christoph said:
I think this should be also mentioned in the Built-In Functions section
of the Library Reference. Probably most users do not read the Language
Reference (since the main menu says it's "for language lawyers" and yes,
it is not really fun to read).

In the explanation about pow() at
http://docs.python.org/lib/built-in-funcs.html, the notation 10**2 is
suddenly used, without explaining that it is equivalent to pow(10,2). I
think this could be improved in the docs.

-- Christoph

It is:
http://docs.python.org/lib/typesnumeric.html

Ziga
 
C

Christoph Zwerschke

Ziga said:

You're right, it's mentioned there in section 2.3.4, but the explanation
of pow() is already in section 2.1 prior to that.

So it would be nice if the paragraph explaining pow() would mention that
you can also write x**y for pow(x,y). And/or the example given in the
paragraph should say pow(10,2) instead of 10**2. Otherwise it's a bit
confusing for somebody who reads in chronological order and doesn't know
about the ** syntax (many other languages write x^y instead of x**y).

-- Christoph
 
K

Kent Johnson

Christoph said:
You're right, it's mentioned there in section 2.3.4, but the explanation
of pow() is already in section 2.1 prior to that.

So it would be nice if the paragraph explaining pow() would mention that
you can also write x**y for pow(x,y). And/or the example given in the
paragraph should say pow(10,2) instead of 10**2. Otherwise it's a bit
confusing for somebody who reads in chronological order and doesn't know
about the ** syntax (many other languages write x^y instead of x**y).

The way to make this change happen is to submit a bug report with your
suggested change. See the link at the bottom of the above page to find
out how.

Kent
 
C

Christoph Zwerschke

Kent said:
The way to make this change happen is to submit a bug report with your
suggested change. See the link at the bottom of the above page to find
out how.

I know, but I wanted to see at least one person assenting before doing
so. Anyway, I took your words as assent and filed a bug report now ;-)

-- Christoph
 
R

Ron Adam

Christoph said:
I think this should be also mentioned in the Built-In Functions section
of the Library Reference. Probably most users do not read the Language
Reference (since the main menu says it's "for language lawyers" and yes,
it is not really fun to read).

I agree and think the "for language lawyers" should be changed to
something that encourages people to read it instead of encouraging them
to avoid it. Maybe:

"The Python language structure for everyone".

If it's hard to read and understand, then that can and should be fixed.

It probably should be moved to a position before the library reference
manual and after the tutorial. Looking over the language reference
manual will help in understanding the library reference manual I think.

Cheers,
Ron
 
C

Christoph Zwerschke

Christoph said:
I know, but I wanted to see at least one person assenting before doing
so. Anyway, I took your words as assent and filed a bug report now ;-)

.... which was promptly rejected. Seems like the Gods of Python don't
want newbies to understand the manuals too easily, so they can have
their fun ranting why they did not RTFM, when they come here and ask
silly questions. ;-)

-- Christoph
 
C

Christoph Zwerschke

Ron said:
I agree and think the "for language lawyers" should be changed to
something that encourages people to read it instead of encouraging them
to avoid it. Maybe:

"The Python language structure for everyone".

If it's hard to read and understand, then that can and should be fixed.

Hm, actually that was not my point. I think the writers of the Language
Reference already did a very good job. The precise and "authoritative"
language reference covering all the subtleties and special cases will
never be fun to read. You would rather learn the use of the keywords and
the basic rules and magic attributes of the language from a good
tutorial or handbook, and look up the Language Reference really
seldomly. You can program quite well in Python without ever having
looked into the official Language Reference. Newbies should not think
they need to read it in order to start programming.

However, it is different with the Lib Reference. This is used on a daily
basis, you will often look into it, Python users are accustomed to it,
and it should invite readers to really browse and read and learn more
about the power of the batteries included. My point was that since users
are more accustomed to and prefer to use the Lib reference as their
first source of information rather than the Language reference, it
should not be reluctant to mention some things which strictly speaking
belong to the Language Reference. In some cases, it can also point to
the Lanugage Reference for the details (and it does so already).

-- Christoph
 
C

Christoph Zwerschke

Christoph said:
... which was promptly rejected.

.... but now it has been checked in by somebody else anyway. The Python
gods sometimes move in mysterious ways ;-)

-- Christoph
 
T

Terry Reedy

... but now it has been checked in by somebody else anyway. The Python
gods sometimes move in mysterious ways ;-)

The tracker item reviewers are people, including me, with different
knowledge, viewpoints and experiences, who sometimes disagree.
 
G

Georg Brandl

Terry said:
The tracker item reviewers are people, including me, with different
knowledge, viewpoints and experiences, who sometimes disagree.

Had I seen the tracker item and/or read this thread to the end before I made
that checkin, I probably wouldn't have made it... ;)

Georg
 
C

Christoph Zwerschke

Georg said:
Had I seen the tracker item and/or read this thread to the end before I made
that checkin, I probably wouldn't have made it... ;)

But then we would have never known that the Python gods are only people ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,291
Messages
2,571,453
Members
48,132
Latest member
AnneHarpur

Latest Threads

Top