Re: Where is the documentation for ','?

2016-09-17 Thread Steve D'Aprano
On Sat, 17 Sep 2016 12:05 pm, Peng Yu wrote:

> Hi,
> 
> I'm wondering where is the documentation for ',' as in the following
> usage.
> 
> x = 1
> y = 2
> x, y = y, x
> 
> I tried help(','). But there are too many ',' in it and I don't see in
> which section ',' is documented. Could anybody let me know? Thanks.


As well as the other suggestions you have been given, try "Sequence
Unpacking".



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Where is the documentation for ','?

2016-09-16 Thread eryk sun
On Sat, Sep 17, 2016 at 2:05 AM, Peng Yu <pengyu...@gmail.com> wrote:
>
> I'm wondering where is the documentation for ',' as in the following usage.
>
> x = 1
> y = 2
> x, y = y, x
>
> I tried help(','). But there are too many ',' in it and I don't see in
> which section ',' is documented. Could anybody let me know? Thanks.

See help('ASSIGNMENT') where the "target list is a comma-separated
list of targets". See also help('TUPLELITERALS') and
help('SEQUENCES').
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Where is the documentation for ','?

2016-09-16 Thread Terry Reedy

On 9/16/2016 10:05 PM, Peng Yu wrote:

Hi,

I'm wondering where is the documentation for ',' as in the following usage.

x = 1
y = 2
x, y = y, x

I tried help(','). But there are too many ',' in it and I don't see in
which section ',' is documented. Could anybody let me know? Thanks.


It should be indexed on
https://docs.python.org/3/genindex-Symbols.html
but is not.  I will try to remember to fix it.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: Where is the documentation for ','?

2016-09-16 Thread Ben Finney
Peng Yu  writes:

> help(tuple) gives me this

Yes. That's the API definition for the ‘tuple’ type.

You were advised to search the documentation, not the interactive
help. You'll find the descriptions of “tuple” and even “tuple unpacking”
are what you want.

-- 
 \ “When I turned two I was really anxious, because I'd doubled my |
  `\   age in a year. I thought, if this keeps up, by the time I'm six |
_o__)  I'll be ninety.” —Steven Wright |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Where is the documentation for ','?

2016-09-16 Thread Nathan Ernst
The grammar and what it represents is defined at
https://docs.python.org/3/reference/expressions.html#expression-lists

Regards

On Sep 16, 2016 9:59 PM, "Peng Yu"  wrote:

> OK. But it is documented somewhere in python doc?
>
> On Fri, Sep 16, 2016 at 9:48 PM, Lawrence D’Oliveiro
>  wrote:
> > On Saturday, September 17, 2016 at 2:05:49 PM UTC+12, Peng Yu wrote:
> >> x, y = y, x
> >
> > It’s just syntactic sugar for
> >
> > (x, y) = (y, x)
> > --
> > https://mail.python.org/mailman/listinfo/python-list
>
>
>
> --
> Regards,
> Peng
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Where is the documentation for ','?

2016-09-16 Thread Peng Yu
OK. But it is documented somewhere in python doc?

On Fri, Sep 16, 2016 at 9:48 PM, Lawrence D’Oliveiro
 wrote:
> On Saturday, September 17, 2016 at 2:05:49 PM UTC+12, Peng Yu wrote:
>> x, y = y, x
>
> It’s just syntactic sugar for
>
> (x, y) = (y, x)
> --
> https://mail.python.org/mailman/listinfo/python-list



-- 
Regards,
Peng
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Where is the documentation for ','?

2016-09-16 Thread Lawrence D’Oliveiro
On Saturday, September 17, 2016 at 2:05:49 PM UTC+12, Peng Yu wrote:
> x, y = y, x

It’s just syntactic sugar for

(x, y) = (y, x)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Where is the documentation for ','?

2016-09-16 Thread Peng Yu
help(tuple) gives me this, which does not mention ',' either.

Help on class tuple in module __builtin__:

class tuple(object)
 |  tuple() -> empty tuple
 |  tuple(iterable) -> tuple initialized from iterable's items
 |
 |  If the argument is a tuple, the return value is the same object.
 |
 |  Methods defined here:
 |
 |  __add__(...)
 |  x.__add__(y) <==> x+y
 |
 |  __contains__(...)
 |  x.__contains__(y) <==> y in x
 |
 |  __eq__(...)
 |  x.__eq__(y) <==> x==y
 |
 |  __ge__(...)
 |  x.__ge__(y) <==> x>=y
 |
 |  __getattribute__(...)
 |  x.__getattribute__('name') <==> x.name
 |
 |  __getitem__(...)
 |  x.__getitem__(y) <==> x[y]
 |
 |  __getnewargs__(...)
 |
 |  __getslice__(...)
 |  x.__getslice__(i, j) <==> x[i:j]
 |
 |  Use of negative indices is not supported.
 |
 |  __gt__(...)
 |  x.__gt__(y) <==> x>y
 |
 |  __hash__(...)
 |  x.__hash__() <==> hash(x)
 |
 |  __iter__(...)
 |  x.__iter__() <==> iter(x)
 |
 |  __le__(...)
 |  x.__le__(y) <==> x<=y
 |
 |  __len__(...)
 |  x.__len__() <==> len(x)
 |
 |  __lt__(...)
 |  x.__lt__(y) <==> x x*n
 |
 |  __ne__(...)
 |  x.__ne__(y) <==> x!=y
 |
 |  __repr__(...)
 |  x.__repr__() <==> repr(x)
 |
 |  __rmul__(...)
 |  x.__rmul__(n) <==> n*x
 |
 |  count(...)
 |  T.count(value) -> integer -- return number of occurrences of value
 |
 |  index(...)
 |  T.index(value, [start, [stop]]) -> integer -- return first
index of value.
 |  Raises ValueError if the value is not present.
 |
 |  --
 |  Data and other attributes defined here:
 |
 |  __new__ = 
 |  T.__new__(S, ...) -> a new object with type S, a subtype of T



On Fri, Sep 16, 2016 at 9:13 PM, MRAB <pyt...@mrabarnett.plus.com> wrote:
> On 2016-09-17 03:05, Peng Yu wrote:
>>
>> Hi,
>>
>> I'm wondering where is the documentation for ',' as in the following
>> usage.
>>
>> x = 1
>> y = 2
>> x, y = y, x
>>
>> I tried help(','). But there are too many ',' in it and I don't see in
>> which section ',' is documented. Could anybody let me know? Thanks.
>>
> Search for 'tuple' instead.
> --
> https://mail.python.org/mailman/listinfo/python-list



-- 
Regards,
Peng
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Where is the documentation for ','?

2016-09-16 Thread MRAB

On 2016-09-17 03:05, Peng Yu wrote:

Hi,

I'm wondering where is the documentation for ',' as in the following usage.

x = 1
y = 2
x, y = y, x

I tried help(','). But there are too many ',' in it and I don't see in
which section ',' is documented. Could anybody let me know? Thanks.


Search for 'tuple' instead.
--
https://mail.python.org/mailman/listinfo/python-list


Where is the documentation for ','?

2016-09-16 Thread Peng Yu
Hi,

I'm wondering where is the documentation for ',' as in the following usage.

x = 1
y = 2
x, y = y, x

I tried help(','). But there are too many ',' in it and I don't see in
which section ',' is documented. Could anybody let me know? Thanks.

-- 
Regards,
Peng
-- 
https://mail.python.org/mailman/listinfo/python-list


Where is the documentation for psycopg2?

2008-07-29 Thread kj



Hi.  I can't find any documentation for psycopg2.

I'm a noob, so I'm sure I'm just not looking in the right place...

Anybody know where it is?

TIA!

kynn

-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Where is the documentation for psycopg2?

2008-07-29 Thread Matthew Woodcraft
kj  [EMAIL PROTECTED] wrote:
 Hi.  I can't find any documentation for psycopg2.

 I'm a noob, so I'm sure I'm just not looking in the right place...
 
 Anybody know where it is?

For basic use, psycopg2 follows the dbapi, which is described in
http://www.python.org/dev/peps/pep-0249/

Additional features are described in doc/extensions.rst in the psycopg2
tarball.

This leaves a gap for documentation of the basic features which the
dbapi doesn't nail down (in particular, connecting to a database in the
first place). I don't think there is any proper documentation covering
this, but the scripts in examples/ (particularly simple.py) should make
it reasonably clear.

-M-
--
http://mail.python.org/mailman/listinfo/python-list


Re: Where is the documentation for psycopg2?

2008-07-29 Thread kj
In [EMAIL PROTECTED] Matthew Woodcraft [EMAIL PROTECTED] writes:

kj  [EMAIL PROTECTED] wrote:
 Hi.  I can't find any documentation for psycopg2.

 I'm a noob, so I'm sure I'm just not looking in the right place...
 
 Anybody know where it is?

For basic use, psycopg2 follows the dbapi, which is described in
http://www.python.org/dev/peps/pep-0249/

Additional features are described in doc/extensions.rst in the psycopg2
tarball.

This leaves a gap for documentation of the basic features which the
dbapi doesn't nail down (in particular, connecting to a database in the
first place). I don't think there is any proper documentation covering
this, but the scripts in examples/ (particularly simple.py) should make
it reasonably clear.

That's very helpful.  I would have never found it on my own.  Thanks!

kynn
-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
--
http://mail.python.org/mailman/listinfo/python-list