Skip to content
murmot

Results for “python function reference type example code error site:docs.python.org 1”

  • docs.python.org

    Built-in Exceptions — Python 3.15.2 documentation

    1 day ago · CPython implementation detail: Most built-in exceptions are implemented in C for efficiency, see: Objects/exceptions.c. Some have custom memory layouts which makes it impossible to create a subclass that inherits from multiple exception types. The memory layout of a type is an implementation detail and might change between Python versions, leading to new conflicts in the future. Therefore, it ...

  • docs.python.org

    4. More Control Flow Tools — Python 3.15.2 documentation

    This example, as usual, demonstrates some new Python features: The return statement returns with a value from a function. return without an expression argument returns None. Falling off the end of a function also returns None.

  • docs.python.org

    15.17. ctypes — A foreign function library for Python...

    Note: Some code samples reference the ctypes c_int type. This type is an alias for the c_long type on 32-bit systems.The error code is used to automatically raise a WindowsError exception when the function call fails. Here are some examples for Windows.

  • docs.python.org

    5. Data Structures — Python 3.15.2 documentation

    Referencing the name a hereafter is an error (at least until another value is assigned to it).Lexicographical ordering for strings uses the Unicode code point number to order individual characters. Some examples of comparisons between sequences of the same type

  • docs.python.org

    Exception Handling — Python 3.15.2 documentation

    2 days ago · The functions described in this chapter will let you handle and raise Python exceptions. It is important to understand some of the basics of Python exception handling. It works somewhat like the PO...

  • docs.python.org

    9. Classes — Python 3.15.2 documentation

    A piece of Python code that expects a particular abstract data type can often be passed a class that emulates the methods of that data type instead. For instance, if you have a function that formats some data from a file object, you can define a class with methods read() and readline...

  • docs.python.org

    The Python Language Reference — Python 3.15.2 documentation

    1 day ago · The Python Language Reference ¶ This reference manual describes the syntax and core semantics of the language. It is terse, but attempts to be exact and complete. Elsewhere, the built-in object types and functions are described in Python built-ins reference. Standard library modules are described in The Python standard library.

  • docs.python.org

    8. Compound statements — Python 3.15.2 documentation

    1 day ago · The if, while and for statements implement traditional control flow constructs. try specifies exception handlers and/or cleanup code for a group of statements, while the with statement allows the execution of initialization and finalization code around a block of code. Function and class definitions are also syntactically compound statements.