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


Groups > comp.lang.python > #80421

Re: What is description attribute in python?

From Deepfriedice <Deepfriedice@openmailbox.org>
Newsgroups comp.lang.python
Subject Re: What is description attribute in python?
Date 2014-11-09 21:08 +1000
Organization Aioe.org NNTP Server
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>

Show all headers | 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