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


Groups > comp.lang.python > #80421

Re: What is description attribute in python?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail
From Deepfriedice <Deepfriedice@openmailbox.org>
Newsgroups comp.lang.python
Subject Re: What is description attribute in python?
Date Sun, 09 Nov 2014 21:08:15 +1000
Organization Aioe.org NNTP Server
Lines 19
Message-ID <m3nhuu$n3u$1@speranza.aioe.org> (permalink)
References <abfcf629-9c5a-4db0-a7bb-dd10e9bba098@googlegroups.com> <545f48fc$0$13005$c3e8da3$5496439d@news.astraweb.com>
NNTP-Posting-Host mvotIFr1QC+Lj4vpBsY8eA.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.lang.python:80421

Show key headers only | View raw


On 09/11/14 20:59, Steven D'Aprano wrote:
> It's an attribute called "description". You would need to read the
> documentation for curs to know what it does.
>
> What is curs? Where does it come from?

It looks like a cursor from an SQL DB library.
For example, sqlite3 in the standard library provides a 
Cursor.description attribute:

https://docs.python.org/3/library/sqlite3.html#sqlite3.Cursor.description
 > This read-only attribute provides the column names of the last query. 
 > To remain compatible with the Python DB API, it returns a 7-tuple for 
 > each column where the last six items of each tuple are None.
 >
 > It is set for SELECT statements without any matching rows as well.

You'll have to read the documentation from the library you're using to 
determine what it actually does.

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


Thread

What is description attribute in python? satishmlmlml@gmail.com - 2014-11-09 02:42 -0800
  Re: What is description attribute in python? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-09 21:59 +1100
    Re: What is description attribute in python? satishmlmlml@gmail.com - 2014-11-09 03:05 -0800
      Re: What is description attribute in python? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-11-09 14:13 +0000
    Re: What is description attribute in python? Deepfriedice <Deepfriedice@openmailbox.org> - 2014-11-09 21:08 +1000
  Re: What is description attribute in python? Tim Chase <python.list@tim.thechases.com> - 2014-11-09 04:59 -0600

csiph-web