Misplaced Pages

AsciiDoc

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

AsciiDoc is a human-readable document format, semantically equivalent to DocBook XML , but using plain-text mark-up conventions. AsciiDoc documents can be created using any text editor and read “as-is”, or rendered to HTML or any other format supported by a DocBook tool-chain, i.e. PDF , TeX , Unix manpages , e-books , slide presentations, etc. Common file extensions for AsciiDoc files are txt (as encouraged by AsciiDoc's creator) and adoc .

#107892

45-508: AsciiDoc was created in 2002 by Stuart Rackham , who published tools (‘asciidoc’ and ‘a2x’), written in the Python programming language to convert plain-text, ‘human readable’ files to commonly used published document formats. A Ruby implementation called ‘Asciidoctor’, released in 2013, is in use by GitHub and GitLab . This implementation is also available in the Java ecosystem using JRuby and in

90-505: A . However, maintaining the validity of this equation means that while the result of a%b is, as expected, in the half-open interval [0, b ), where b is a positive integer, it has to lie in the interval ( b , 0] when b is negative. Python provides a round function for rounding a float to the nearest integer. For tie-breaking , Python 3 uses round to even : round(1.5) and round(2.5) both produce 2 . Versions before 3 used round-away-from-zero : round(0.5)

135-419: A certain type. Python does not support tail call optimization or first-class continuations , and, according to Van Rossum, it never will. However, better support for coroutine -like functionality is provided by extending Python's generators . Before 2.5, generators were lazy iterators ; data was passed unidirectionally out of the generator. From Python 2.5 on, it is possible to pass data back into

180-644: A combination of reference counting and a cycle-detecting garbage collector for memory management . It uses dynamic name resolution ( late binding ), which binds method and variable names during program execution. Its design offers some support for functional programming in the Lisp tradition. It has filter , map and reduce functions; list comprehensions , dictionaries , sets, and generator expressions. The standard library has two modules ( itertools and functools ) that implement functional tools borrowed from Haskell and Standard ML . Its core philosophy

225-570: A customer's point of view. Different lifetime examples include toys from fast food chains (weeks or months), mobile phones (3 years) and cars (10 years). Product support during EOL varies by product. For hardware with an expected lifetime of 10 years after production ends, the support includes spare parts, technical support and service. Spare-part lifetimes are price-driven due to increasing production costs, as high-volume production sites are often closed when series production ends. Manufacturers may also continue to offer parts and services even when it

270-420: A decrease in indentation signifies the end of the current block. Thus, the program's visual structure accurately represents its semantic structure. This feature is sometimes termed the off-side rule . Some other languages use indentation this way; but in most, indentation has no semantic meaning. The recommended indent size is four spaces. Python's statements include: The assignment statement ( = ) binds

315-510: A generator function; and from version 3.3, it can be passed through multiple stack levels. Python's expressions include: In Python, a distinction between expressions and statements is rigidly enforced, in contrast to languages such as Common Lisp , Scheme , or Ruby . This leads to duplicating some functionality. For example: Statements cannot be a part of an expression—so list and other comprehensions or lambda expressions , all being expressions, cannot contain statements. A particular case

360-428: A large body of existing code could not easily be forward-ported to Python 3. No further security patches or other improvements will be released for it. While Python 2.7 and older versions are officially unsupported, a different unofficial Python implementation, PyPy , continues to support Python 2, i.e. "2.7.18+" (plus 3.10), with the plus meaning (at least some) " backported security updates". Python 3.0

405-445: A matrix‑multiplication operator @ . These operators work like in traditional math; with the same precedence rules , the operators infix ( + and - can also be unary to represent positive and negative numbers respectively). The division between integers produces floating-point results. The behavior of division has changed significantly over time: In Python terms, / is true division (or simply division ), and //

450-402: A name as a reference to a separate, dynamically allocated object . Variables may subsequently be rebound at any time to any object. In Python, a variable name is a generic reference holder without a fixed data type ; however, it always refers to some object with a type. This is called dynamic typing —in contrast to statically-typed languages, where each variable may contain only a value of

495-461: A new and improved interactive interpreter ( REPL ), featuring multi-line editing and color support; an incremental garbage collector (producing shorter pauses for collection in programs with a lot of objects, and addition to the improved speed in 3.11 and 3.12), and an experimental just-in-time (JIT) compiler (such features, can/needs to be enabled specifically for the increase in speed), and an experimental free-threaded build mode, which disables

SECTION 10

#1732887101108

540-411: A standard format for distributing Python Binaries. Python 3.15 will "Make UTF-8 mode default", the mode exists in all current Python versions, but currently needs to be opted into. UTF-8 is already used, by default, on Windows (and elsewhere), for most things, but e.g. to open files it's not and enabling also makes code fully cross-platform, i.e. use UTF-8 for everything on all platforms. Python

585-633: A string literal, with no certainty as to which one a programmer should use. Alex Martelli , a Fellow at the Python Software Foundation and Python book author, wrote: "To describe something as 'clever' is not considered a compliment in the Python culture." Python's developers usually strive to avoid premature optimization and reject patches to non-critical parts of the CPython reference implementation that would offer marginal increases in speed at

630-585: Is 1.0 , round(-0.5) is −1.0 . Python allows Boolean expressions with multiple equality relations in a manner that is consistent with general use in mathematics. For example, the expression a < b < c tests whether a is less than b and b is less than c . C-derived languages interpret this expression differently: in C, the expression would first evaluate a < b , resulting in 0 or 1, and that result would then be compared with c . Python uses arbitrary-precision arithmetic for all integer operations. The Decimal type/class in

675-403: Is floor division. / before version 3.0 is classic division . Rounding towards negative infinity, though different from most languages, adds consistency. For instance, it means that the equation ( a + b ) // b == a // b + 1 is always true. It also means that the equation b * ( a // b ) + a % b == a is valid for both positive and negative values of

720-522: Is a multi-paradigm programming language . Object-oriented programming and structured programming are fully supported, and many of their features support functional programming and aspect-oriented programming (including metaprogramming and metaobjects ). Many other paradigms are supported via extensions, including design by contract and logic programming . Python is known as a glue language , able to work very well with many other languages with ease of access. Python uses dynamic typing and

765-637: Is an on-line encyclopedia, available in English and many other languages. You can install package-name using the gem command: Metals commonly used include: Python programming language Python is a high-level , general-purpose programming language . Its design philosophy emphasizes code readability with the use of significant indentation . Python is dynamically typed and garbage-collected . It supports multiple programming paradigms , including structured (particularly procedural ), object-oriented and functional programming . It

810-492: Is compiled, and possibly semantics are slightly changed. Python's developers aim for it to be fun to use. This is reflected in its name—a tribute to the British comedy group Monty Python —and in occasionally playful approaches to tutorials and reference materials, such as the use of the terms "spam" and "eggs" (a reference to a Monty Python sketch ) in examples, instead of the often-used "foo" and "bar" . A common neologism in

855-532: Is meant to be an easily readable language. Its formatting is visually uncluttered and often uses English keywords where other languages use punctuation. Unlike many other languages, it does not use curly brackets to delimit blocks, and semicolons after statements are allowed but rarely used. It has fewer syntactic exceptions and special cases than C or Pascal . Python uses whitespace indentation, rather than curly brackets or keywords, to delimit blocks . An increase in indentation comes after certain statements;

900-482: Is not installable on Windows Me or any prior versions of Windows. Depending on the vendor, end-of-life may differ from end of service life, which has the added distinction that a vendor of systems or software will no longer provide maintenance, troubleshooting or other support. Such software that is abandoned service-wise by the original developers is also called abandonware . Sometimes, software vendors hand over software on end-of-life, end-of-sale or end-of-service to

945-411: Is not of a suitable type. Despite being dynamically typed , Python is strongly typed , forbidding operations that are not well-defined (for example, adding a number to a string) rather than silently attempting to make sense of them. Python allows programmers to define their own types using classes , most often used for object-oriented programming . New instances of classes are constructed by calling

SECTION 20

#1732887101108

990-682: Is not profitable, to demonstrate good faith and to retain a reputation of durability. Minimum service lifetimes are also mandated by law for some products in some jurisdictions. Alternatively, some producers may discontinue maintenance of a product in order to force customers to upgrade to newer products. In the computing arena, the concept of end-of-life has significance in the production, supportability and purchase of software and hardware products. For example, Microsoft marked Windows 98 for end-of-life on June 30, 2006. Software produced after that date may not work for it. Microsoft's product Office 2007 (released on November 30, 2006), for instance,

1035-502: Is often described as a "batteries included" language due to its comprehensive standard library . Guido van Rossum began working on Python in the late 1980s as a successor to the ABC programming language and first released it in 1991 as Python 0.9.0. Python 2.0 was released in 2000. Python 3.0, released in 2008, was a major revision not completely backward-compatible with earlier versions. Python 2.7.18, released in 2020,

1080-434: Is self-titled "BDFL-emeritus"). In January 2019, active Python core developers elected a five-member Steering Council to lead the project. Python 2.0 was released on 16 October 2000, with many major new features such as list comprehensions , cycle-detecting garbage collection, reference counting , and Unicode support. Python 2.7's end-of-life was initially set for 2015, then postponed to 2020 out of concern that

1125-610: Is slow, inconsistent and buggy [and it has] has many corner cases and oddities. Code that works around those may need to be changed. Code that uses locals() for simple templating, or print debugging, will continue to work correctly." Some (more) standard library modules and many deprecated classes, functions and methods, will be removed in Python 3.15 or 3.16. Python 3.14 is now in alpha 2; regarding possible change to annotations: "In Python 3.14, from __future__ import annotations will continue to work as it did before, converting annotations into strings." PEP 711 proposes PyBI:

1170-543: Is summarized in the Zen of Python (PEP 20), which includes aphorisms such as: However, Python features regularly violate these principles and have received criticism for adding unnecessary language bloat. Responses to these criticisms are that the Zen of Python is a guideline rather than a rule. The addition of some new features had been so controversial that Guido van Rossum resigned as Benevolent Dictator for Life following vitriol over

1215-460: Is that an assignment statement such as a = 1 cannot form part of the conditional expression of a conditional statement. Methods on objects are functions attached to the object's class; the syntax instance . method ( argument ) is, for normal methods and functions, syntactic sugar for Class . method ( instance , argument ) . Python methods have an explicit self parameter to access instance data , in contrast to

1260-680: Is the oldest supported version of Python (albeit in the 'security support' phase), due to Python 3.8 reaching end-of-life . Starting with 3.13, it and later versions have 2 years of full support (up from one and a half), followed by 3 years of security support (for same total support as before). Security updates were expedited in 2021 (and again twice in 2022, and more fixed in 2023 and in September 2024 for Python 3.12.6 down to 3.8.20), since all Python versions were insecure (including 2.7 ) because of security issues leading to possible remote code execution and web-cache poisoning . Python 3.10 added

1305-548: The decimal module provides decimal floating-point numbers to a pre-defined arbitrary precision and several rounding modes. The Fraction class in the fractions module provides arbitrary precision for rational numbers . Due to Python's extensive mathematics library, and the third-party library NumPy that further extends the native capabilities, it is frequently used as a scientific scripting language to aid in problems such as numerical data processing and manipulation. "Hello, World!" program : Program to calculate

1350-570: The | union type operator and the match and case keywords (for structural pattern matching statements). 3.11 expanded exception handling functionality. Python 3.12 added the new keyword type . Notable changes in 3.11 from 3.10 include increased program execution speed and improved error reporting. Python 3.11 claims to be between 10 and 60% faster than Python 3.10, and Python 3.12 adds another 5% on top of that. It also has improved error messages (again improved in 3.14), and many other changes. Python 3.13 introduces more syntax for types,

1395-571: The Amoeba operating system. Its implementation began in December ;1989. Van Rossum shouldered sole responsibility for the project, as the lead developer, until 12 July 2018, when he announced his "permanent vacation" from his responsibilities as Python's " benevolent dictator for life " (BDFL), a title the Python community bestowed upon him to reflect his long-term commitment as the project's chief decision-maker (he has since come out of retirement and

AsciiDoc - Misplaced Pages Continue

1440-640: The JavaScript ecosystem using Opal.js. Some of O'Reilly Media 's books and e-books are authored using AsciiDoc mark-up. Most of the Git project documentation is written in AsciiDoc. The AsciiDoc format is currently under standardization procedure by the Eclipse Foundation . The following shows text using AsciiDoc mark-up, and a rendering similar to that produced by an AsciiDoc processor: J. Smith Misplaced Pages

1485-421: The factorial of a positive integer: End-of-life product An end-of-life product ( EOL product ) is a product at the end of the product lifecycle , which prevents users from receiving updates, indicating that the product is at the end of its useful life (from the vendor's point of view). At this stage, a vendor stops the marketing , selling, or provisioning of parts, services, or software updates for

1530-487: The global interpreter lock (GIL), allowing threads to run more concurrently, that latter feature enabled with python3.13t or python3.13t.exe . Python 3.13 introduces some change in behavior, i.e. new "well-defined semantics", fixing bugs (plus many removals of deprecated classes, functions and methods, and removed some of the ;API and outdated modules): "The [old] implementation of locals() and frame.f_locals

1575-403: The Python community is pythonic , which has a wide range of meanings related to program style. "Pythonic" code may use Python idioms well, be natural or show fluency in the language, or conform with Python's minimalist philosophy and emphasis on readability. Code that is difficult to understand or reads like a rough transcription from another programming language is called unpythonic . Python

1620-497: The addition of the assignment expression operator in Python 3.8. Nevertheless, rather than building all of its functionality into its core, Python was designed to be highly extensible via modules. This compact modularity has made it particularly popular as a means of adding programmable interfaces to existing applications. Van Rossum's vision of a small core language with a large standard library and easily extensible interpreter stemmed from his frustrations with ABC , which espoused

1665-475: The class (for example, SpamClass () or EggsClass () ), and the classes are instances of the metaclass type (itself an instance of itself), allowing metaprogramming and reflection . Before version 3.0, Python had two kinds of classes (both using the same syntax): old-style and new-style ; current Python versions only support the semantics of the new style. Python supports optional type annotations . These annotations are not enforced by

1710-399: The cost of clarity. Execution speed can be improved by moving speed-critical functions to extension modules written in languages such as C, or by using a just-in-time compiler like PyPy . It is also possible to cross-compile to other languages , but it either doesn't provide the full speed-up that might be expected, since Python is a very dynamic language , or a restricted subset of Python

1755-609: The implicit self (or this ) in some other object-oriented programming languages (e.g., C++ , Java , Objective-C , Ruby ). Python also provides methods, often called dunder methods (due to their names beginning and ending with double-underscores), to allow user-defined classes to modify how they are handled by native operations including length, comparison, in arithmetic operations and type conversion. Python uses duck typing and has typed objects but untyped variable names. Type constraints are not checked at compile time ; rather, operations on an object may fail, signifying that it

1800-507: The language, but may be used by external tools such as mypy to catch errors. Mypy also supports a Python compiler called mypyc, which leverages type annotations for optimization. 1.33333 Python has the usual symbols for arithmetic operators ( + , - , * , / ), the floor division operator // and the modulo operation % (where the remainder can be negative, e.g. 4 % -3 == -2 ). It also has ** for exponentiation , e.g. 5**3 == 125 and 9**0.5 == 3.0 , and

1845-458: The opposite approach. Python claims to strive for a simpler, less-cluttered syntax and grammar while giving developers a choice in their coding methodology. In contrast to Perl 's " there is more than one way to do it " motto, Python embraces a "there should be one—and preferably only one—obvious way to do it." philosophy. In practice, however, Python provides many ways to achieve the same task. There are, for example, at least three ways to format

AsciiDoc - Misplaced Pages Continue

1890-427: The product. The vendor may simply intend to limit or end support for the product. In the specific case of product sales, a vendor may employ the more specific term " end-of-sale " (" EOS "). All users can continue to access discontinued products, but cannot receive security updates and technical support. The time-frame after the last production date depends on the product and relates to the expected product lifetime from

1935-494: The user community, to allow them to provide service and further upgrades themselves. Notable examples are the web browser Netscape Communicator , which was released in 1998 by Netscape Communications under an open-source license to the public, and the office suite StarOffice , which was released by Sun Microsystems in October 2000 as OpenOffice.org ( LibreOffice forked from this). Sometimes, software communities continue

1980-506: Was released on 3 December 2008, with some new semantics and changed syntax. At least every Python release since (now unsupported) 3.5 has added some syntax to the language, and a few later releases have dropped outdated modules, or changed semantics, at least in a minor way. Since 7 October 2024 , Python 3.13 is the latest stable release, and it and, for few more months, 3.12 are the only releases with active support including for bugfixes (as opposed to just for security) and Python 3.9,

2025-506: Was the last release of Python 2. Python consistently ranks as one of the most popular programming languages, and has gained widespread use in the machine learning community. Python was conceived in the late 1980s by Guido van Rossum at Centrum Wiskunde & Informatica (CWI) in the Netherlands as a successor to the ABC programming language, which was inspired by SETL , capable of exception handling and interfacing with

#107892