Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the keyword "license" used for in python?

Tags:

python

I just went to use "license" as a variable name and it became highlighted to indicate that it was a reserved word, what is "license" used for?

like image 955
Justin Avatar asked Feb 01 '14 20:02

Justin


People also ask

What license does Python use?

Python software and documentation are licensed under the PSF License Agreement. Starting with Python 3.8. 6, examples, recipes, and other code in the documentation are dual licensed under the PSF License Agreement and the Zero-Clause BSD license.

What is the use of keywords in Python?

Keywords are some predefined and reserved words in python that have special meanings. Keywords are used to define the syntax of the coding. The keyword cannot be used as an identifier, function, and variable name. All the keywords in python are written in lower case except True and False.

Do you need a license for Python?

Python is developed under an OSI-approved open source license, making it freely usable and distributable, even for commercial use. Python's license is administered by the Python Software Foundation.

What is the use of keyword argument in Python?

Keyword arguments (or named arguments) are values that, when passed into a function, are identifiable by specific parameter names. A keyword argument is preceded by a parameter and the assignment operator, = . Keyword arguments can be likened to dictionaries in that they map a value to a keyword.


2 Answers

It's not a keyword, it's a constant added by the site module (some others are copyright and credits). If you want to know what it does, try:

print license
>>> Type license() to see the full license text

then if you type

license()

output will be:

A. HISTORY OF THE SOFTWARE

Python was created in the early 1990s by Guido van Rossum at Stichting Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands as a successor of a language called ABC. Guido remains Python's principal author, although it includes many contributions from others.

In 1995, Guido continued his work on Python at the Corporation for National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) in Reston, Virginia where he released several versions of the software.

In May 2000, Guido and the Python core development team moved to BeOpen.com to form the BeOpen PythonLabs team. In October of the same year, the PythonLabs team moved to Digital Creations (now Zope Corporation, see http://www.zope.com). In 2001, the Python Software Foundation (PSF, see http://www.python.org/psf/) was formed, a non-profit organization created specifically to own Python-related Intellectual Property. Zope Corporation is a sponsoring member of the PSF.

All Python releases are Open Source (see http://www.opensource.org for Hit Return for more, or q (and Return) to quit:

like image 167
Christian Tapia Avatar answered Sep 20 '22 22:09

Christian Tapia


license is one of the built-in constants added by the site module.

It's use is entirely within the interactive interpreter:

>>> license
See http://www.python.org/2.7/license.html

Other such objects are credits and copyright, plus the quit() and exit() functions.

If you are curious as to its implementation, see the setcopyright() function source.

like image 26
Martijn Pieters Avatar answered Sep 18 '22 22:09

Martijn Pieters