url stringlengths 11 2.25k | text stringlengths 88 50k | ts timestamp[s]date 2026-01-13 08:47:33 2026-01-13 09:30:40 |
|---|---|---|
https://calebporzio.com/video-livewire-personal-life-update | [Video] Livewire/personal life update | Caleb Porzio Caleb Porzio Posts • Creations • Talks • Tweets [Video] Livewire/personal life update Mar 2019 I’ve been dark for the past couple of weeks working on Livewire and hanging out with Family. I decided to just record my talking head to give you an update about where things are at. Enjoy! My Newsletter I send out an email every so often about cool stuff I'm working on or launching. If you dig, go ahead and sign up! | 2026-01-13T08:48:43 |
https://docs.suprsend.com/docs/broadcast-go | Broadcast - SuprSend, Notification infrastructure for Product teams Skip to main content SuprSend, Notification infrastructure for Product teams home page Search... ⌘ K Community Trust Center Platform Status Postman Collection Developer Resources Overview Updates and Versioning Versioning and Support Policy SDK Changelog Authentication API Keys and Secrets Service Token Best Practices for Key & Token Management MCP Overview BETA Quickstart Tool List Building with LLMs Security Security SDKs and APIs SDKs SDK Overview SuprSend Backend SDK Python SDK Node.js SDK Java SDK Go SDK Integrate Go SDK Manage Users Send and Track Events Trigger Workflow from API Tenants Lists Broadcast SuprSend Client SDK Management API REST API Postman Collection Features Validate Trigger Payload Type Safety Testing Testing the Template Test Mode Monitoring and Logging Logs Data Out Contact Us Get Started SuprSend, Notification infrastructure for Product teams home page Search... ⌘ K Ask AI Contact Us Get Started Get Started Search... Navigation Go SDK Broadcast Documentation API Reference Management API CLI Reference Developer Resources Changelog Documentation API Reference Management API CLI Reference Developer Resources Changelog Go SDK Broadcast OpenAI Open in ChatGPT Trigger broadcast notifications to a list of users with Go SDK. OpenAI Open in ChatGPT Pre-Requisites Create a list of users Payload Schema Request Sample Response Copy Ask AI package main import ( " context " " log " suprsend " github.com/suprsend/suprsend-go " ) func main () { // Initialize SDK opts := [] suprsend . ClientOption { // suprsend.WithDebug(true), } suprClient , err := suprsend . NewClient ( "_workspace_key_" , "_workspace_secret_" , opts ... ) if err != nil { log . Println ( err ) } ctx := context . Background () // ================= broadcast to a list broadcastIns := & suprsend . SubscriberListBroadcast { Body : map [ string ] interface {}{ "list_id" : "users-with-prepaid-vouchers-1" , "template" : "template slug" , "notification_category" : "category" , // broadcast channels. // if empty: broadcast will be tried on all available channels // if present: broadcast will be tried on passed channels only "channels" : [] string { "email" }, "delay" : "1m" , // check docs for delay format // "trigger_at": "", // check below for trigger_at format "data" : map [ string ] interface {}{ "first_name" : "User" , "spend_amount" : "$10" , "nested_key_example" : map [ string ] interface {}{ "nested_key1" : "some_value_1" , "nested_key2" : map [ string ] interface {}{ "nested_key3" : "some_value_3" , }, }, }, }, IdempotencyKey : "" , TenantId : "" , } res , err := suprClient . SubscriberLists . Broadcast ( ctx , broadcastIns ) if err != nil { log . Fatalln ( err ) } log . Println ( res ) } Broadcast body field description: Parameter Format Description list_id string list of users that you want to send broadcast messages. template string It is the template slug which can be found in Templates tab in SuprSend dashboard. notification_category system / transactional / promotional You can understand more about them in the Notification Category . channels (Optional) string[] User channels on which the broadcast messages to be sent. If not provided, it will trigger notifications on all available channels in user profile. Available channels: androidpush / iospush / inbox / email / whatsapp / sms Example:[“sms”, “inbox”] delay (Optional) XX d XX h XX m XX s or Number (in seconds) Broadcast will be halted for the time mentioned in delay, and become active once the delay period is over. Example: 1d2h3m4s / 60 trigger_at (Optional) date string in ISO 8601 Trigger broadcast on a specific date-time. Example: “2021-08-27T20:14:51.643Z” data (Optional) object variable data defined in templates Add file attachment (for email) To add one or more attachments to a notification (viz. Email), call add_attachment() on broadcast instance for each attachment file. Ensure that attachment url is valid and public, otherwise error will be raised. Since broadcast instance size can’t be > 100 KB, local file paths can’t be passed in event attachment. Request Copy Ask AI // If need to add attachment err = broadcastIns . AddAttachment ( "https://attachment-url" , & suprsend . AttachmentOption { IgnoreIfError : true }) if err != nil { log . Fatalln ( err ) } A single broadcast instance size (including attachment) must not exceed 100KB (100 x 1024 bytes). Was this page helpful? Yes No Suggest edits Raise issue Previous Authentication How to authenticate SuprSend Client SDKs using public API Keys & signed user tokens. Next ⌘ I x github linkedin youtube Powered by On this page Pre-Requisites Payload Schema Add file attachment (for email) | 2026-01-13T08:48:43 |
https://calebporzio.com/livewire-no-need-for-controllers-anymore | Livewire: No Need For Controllers Anymore! | Caleb Porzio Caleb Porzio Posts • Creations • Talks • Tweets Livewire: No Need For Controllers Anymore! Feb 2019 In the midst of some heavy work I’m doing on Livewire, I decided to stop for a minute and show you a quick feature I cranked out that I think is pretty cool. (If you haven't been following along and are confused what Livewire is, you can get caught up by reading my recent posts on it, starting with this one ) This feature gives you the option to cut out the middleman completely: your controllers. That’s right, conceivably, you could write an entire application now with only Livewire components and no controllers or route callbacks - crazy right? Check out the screencasts for the full scoop! Note: This is OLD content. Some of what I demo may no longer be available in the framework. The docs are the source of truth for the project: https://livewire-framework.com/docs/quickstart/ New routing syntax I worked really hard to make this feature feel as comfortable as possible. I tried leveraging all the ways you’re used to working with and configuring routes. Hope it shows through! IMPLICIT ROUTE MODEL BINDING BOOEEEYYY That’s right, you can now leverage all the route binding goodness Laravel gives to controllers, right inside your Livewire components! Good shtuff eh? Like I mentioned at the beginning of the post, I’ve been doing some deep work on Livewire’s core. I can’t wait to share the progress with you, but I want things to be in a better place before I do. Hang tight for more goodies coming at you soon! Peace! Caleb My Newsletter I send out an email every so often about cool stuff I'm working on or launching. If you dig, go ahead and sign up! | 2026-01-13T08:48:43 |
https://docs.python.org/3/reference/simple_stmts.html#continue | 7. Simple statements — Python 3.14.2 documentation Theme Auto Light Dark Table of Contents 7. Simple statements 7.1. Expression statements 7.2. Assignment statements 7.2.1. Augmented assignment statements 7.2.2. Annotated assignment statements 7.3. The assert statement 7.4. The pass statement 7.5. The del statement 7.6. The return statement 7.7. The yield statement 7.8. The raise statement 7.9. The break statement 7.10. The continue statement 7.11. The import statement 7.11.1. Future statements 7.12. The global statement 7.13. The nonlocal statement 7.14. The type statement Previous topic 6. Expressions Next topic 8. Compound statements This page Report a bug Show source Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Language Reference » 7. Simple statements | Theme Auto Light Dark | 7. Simple statements ¶ A simple statement is comprised within a single logical line. Several simple statements may occur on a single line separated by semicolons. The syntax for simple statements is: simple_stmt : expression_stmt | assert_stmt | assignment_stmt | augmented_assignment_stmt | annotated_assignment_stmt | pass_stmt | del_stmt | return_stmt | yield_stmt | raise_stmt | break_stmt | continue_stmt | import_stmt | future_stmt | global_stmt | nonlocal_stmt | type_stmt 7.1. Expression statements ¶ Expression statements are used (mostly interactively) to compute and write a value, or (usually) to call a procedure (a function that returns no meaningful result; in Python, procedures return the value None ). Other uses of expression statements are allowed and occasionally useful. The syntax for an expression statement is: expression_stmt : starred_expression An expression statement evaluates the expression list (which may be a single expression). In interactive mode, if the value is not None , it is converted to a string using the built-in repr() function and the resulting string is written to standard output on a line by itself (except if the result is None , so that procedure calls do not cause any output.) 7.2. Assignment statements ¶ Assignment statements are used to (re)bind names to values and to modify attributes or items of mutable objects: assignment_stmt : ( target_list "=" )+ ( starred_expression | yield_expression ) target_list : target ( "," target )* [ "," ] target : identifier | "(" [ target_list ] ")" | "[" [ target_list ] "]" | attributeref | subscription | slicing | "*" target (See section Primaries for the syntax definitions for attributeref , subscription , and slicing .) An assignment statement evaluates the expression list (remember that this can be a single expression or a comma-separated list, the latter yielding a tuple) and assigns the single resulting object to each of the target lists, from left to right. Assignment is defined recursively depending on the form of the target (list). When a target is part of a mutable object (an attribute reference, subscription or slicing), the mutable object must ultimately perform the assignment and decide about its validity, and may raise an exception if the assignment is unacceptable. The rules observed by various types and the exceptions raised are given with the definition of the object types (see section The standard type hierarchy ). Assignment of an object to a target list, optionally enclosed in parentheses or square brackets, is recursively defined as follows. If the target list is a single target with no trailing comma, optionally in parentheses, the object is assigned to that target. Else: If the target list contains one target prefixed with an asterisk, called a “starred” target: The object must be an iterable with at least as many items as there are targets in the target list, minus one. The first items of the iterable are assigned, from left to right, to the targets before the starred target. The final items of the iterable are assigned to the targets after the starred target. A list of the remaining items in the iterable is then assigned to the starred target (the list can be empty). Else: The object must be an iterable with the same number of items as there are targets in the target list, and the items are assigned, from left to right, to the corresponding targets. Assignment of an object to a single target is recursively defined as follows. If the target is an identifier (name): If the name does not occur in a global or nonlocal statement in the current code block: the name is bound to the object in the current local namespace. Otherwise: the name is bound to the object in the global namespace or the outer namespace determined by nonlocal , respectively. The name is rebound if it was already bound. This may cause the reference count for the object previously bound to the name to reach zero, causing the object to be deallocated and its destructor (if it has one) to be called. If the target is an attribute reference: The primary expression in the reference is evaluated. It should yield an object with assignable attributes; if this is not the case, TypeError is raised. That object is then asked to assign the assigned object to the given attribute; if it cannot perform the assignment, it raises an exception (usually but not necessarily AttributeError ). Note: If the object is a class instance and the attribute reference occurs on both sides of the assignment operator, the right-hand side expression, a.x can access either an instance attribute or (if no instance attribute exists) a class attribute. The left-hand side target a.x is always set as an instance attribute, creating it if necessary. Thus, the two occurrences of a.x do not necessarily refer to the same attribute: if the right-hand side expression refers to a class attribute, the left-hand side creates a new instance attribute as the target of the assignment: class Cls : x = 3 # class variable inst = Cls () inst . x = inst . x + 1 # writes inst.x as 4 leaving Cls.x as 3 This description does not necessarily apply to descriptor attributes, such as properties created with property() . If the target is a subscription: The primary expression in the reference is evaluated. It should yield either a mutable sequence object (such as a list) or a mapping object (such as a dictionary). Next, the subscript expression is evaluated. If the primary is a mutable sequence object (such as a list), the subscript must yield an integer. If it is negative, the sequence’s length is added to it. The resulting value must be a nonnegative integer less than the sequence’s length, and the sequence is asked to assign the assigned object to its item with that index. If the index is out of range, IndexError is raised (assignment to a subscripted sequence cannot add new items to a list). If the primary is a mapping object (such as a dictionary), the subscript must have a type compatible with the mapping’s key type, and the mapping is then asked to create a key/value pair which maps the subscript to the assigned object. This can either replace an existing key/value pair with the same key value, or insert a new key/value pair (if no key with the same value existed). For user-defined objects, the __setitem__() method is called with appropriate arguments. If the target is a slicing: The primary expression in the reference is evaluated. It should yield a mutable sequence object (such as a list). The assigned object should be a sequence object of the same type. Next, the lower and upper bound expressions are evaluated, insofar they are present; defaults are zero and the sequence’s length. The bounds should evaluate to integers. If either bound is negative, the sequence’s length is added to it. The resulting bounds are clipped to lie between zero and the sequence’s length, inclusive. Finally, the sequence object is asked to replace the slice with the items of the assigned sequence. The length of the slice may be different from the length of the assigned sequence, thus changing the length of the target sequence, if the target sequence allows it. CPython implementation detail: In the current implementation, the syntax for targets is taken to be the same as for expressions, and invalid syntax is rejected during the code generation phase, causing less detailed error messages. Although the definition of assignment implies that overlaps between the left-hand side and the right-hand side are ‘simultaneous’ (for example a, b = b, a swaps two variables), overlaps within the collection of assigned-to variables occur left-to-right, sometimes resulting in confusion. For instance, the following program prints [0, 2] : x = [ 0 , 1 ] i = 0 i , x [ i ] = 1 , 2 # i is updated, then x[i] is updated print ( x ) See also PEP 3132 - Extended Iterable Unpacking The specification for the *target feature. 7.2.1. Augmented assignment statements ¶ Augmented assignment is the combination, in a single statement, of a binary operation and an assignment statement: augmented_assignment_stmt : augtarget augop ( expression_list | yield_expression ) augtarget : identifier | attributeref | subscription | slicing augop : "+=" | "-=" | "*=" | "@=" | "/=" | "//=" | "%=" | "**=" | ">>=" | "<<=" | "&=" | "^=" | "|=" (See section Primaries for the syntax definitions of the last three symbols.) An augmented assignment evaluates the target (which, unlike normal assignment statements, cannot be an unpacking) and the expression list, performs the binary operation specific to the type of assignment on the two operands, and assigns the result to the original target. The target is only evaluated once. An augmented assignment statement like x += 1 can be rewritten as x = x + 1 to achieve a similar, but not exactly equal effect. In the augmented version, x is only evaluated once. Also, when possible, the actual operation is performed in-place , meaning that rather than creating a new object and assigning that to the target, the old object is modified instead. Unlike normal assignments, augmented assignments evaluate the left-hand side before evaluating the right-hand side. For example, a[i] += f(x) first looks-up a[i] , then it evaluates f(x) and performs the addition, and lastly, it writes the result back to a[i] . With the exception of assigning to tuples and multiple targets in a single statement, the assignment done by augmented assignment statements is handled the same way as normal assignments. Similarly, with the exception of the possible in-place behavior, the binary operation performed by augmented assignment is the same as the normal binary operations. For targets which are attribute references, the same caveat about class and instance attributes applies as for regular assignments. 7.2.2. Annotated assignment statements ¶ Annotation assignment is the combination, in a single statement, of a variable or attribute annotation and an optional assignment statement: annotated_assignment_stmt : augtarget ":" expression [ "=" ( starred_expression | yield_expression )] The difference from normal Assignment statements is that only a single target is allowed. The assignment target is considered “simple” if it consists of a single name that is not enclosed in parentheses. For simple assignment targets, if in class or module scope, the annotations are gathered in a lazily evaluated annotation scope . The annotations can be evaluated using the __annotations__ attribute of a class or module, or using the facilities in the annotationlib module. If the assignment target is not simple (an attribute, subscript node, or parenthesized name), the annotation is never evaluated. If a name is annotated in a function scope, then this name is local for that scope. Annotations are never evaluated and stored in function scopes. If the right hand side is present, an annotated assignment performs the actual assignment as if there was no annotation present. If the right hand side is not present for an expression target, then the interpreter evaluates the target except for the last __setitem__() or __setattr__() call. See also PEP 526 - Syntax for Variable Annotations The proposal that added syntax for annotating the types of variables (including class variables and instance variables), instead of expressing them through comments. PEP 484 - Type hints The proposal that added the typing module to provide a standard syntax for type annotations that can be used in static analysis tools and IDEs. Changed in version 3.8: Now annotated assignments allow the same expressions in the right hand side as regular assignments. Previously, some expressions (like un-parenthesized tuple expressions) caused a syntax error. Changed in version 3.14: Annotations are now lazily evaluated in a separate annotation scope . If the assignment target is not simple, annotations are never evaluated. 7.3. The assert statement ¶ Assert statements are a convenient way to insert debugging assertions into a program: assert_stmt : "assert" expression [ "," expression ] The simple form, assert expression , is equivalent to if __debug__ : if not expression : raise AssertionError The extended form, assert expression1, expression2 , is equivalent to if __debug__ : if not expression1 : raise AssertionError ( expression2 ) These equivalences assume that __debug__ and AssertionError refer to the built-in variables with those names. In the current implementation, the built-in variable __debug__ is True under normal circumstances, False when optimization is requested (command line option -O ). The current code generator emits no code for an assert statement when optimization is requested at compile time. Note that it is unnecessary to include the source code for the expression that failed in the error message; it will be displayed as part of the stack trace. Assignments to __debug__ are illegal. The value for the built-in variable is determined when the interpreter starts. 7.4. The pass statement ¶ pass_stmt : "pass" pass is a null operation — when it is executed, nothing happens. It is useful as a placeholder when a statement is required syntactically, but no code needs to be executed, for example: def f ( arg ): pass # a function that does nothing (yet) class C : pass # a class with no methods (yet) 7.5. The del statement ¶ del_stmt : "del" target_list Deletion is recursively defined very similar to the way assignment is defined. Rather than spelling it out in full details, here are some hints. Deletion of a target list recursively deletes each target, from left to right. Deletion of a name removes the binding of that name from the local or global namespace, depending on whether the name occurs in a global statement in the same code block. Trying to delete an unbound name raises a NameError exception. Deletion of attribute references, subscriptions and slicings is passed to the primary object involved; deletion of a slicing is in general equivalent to assignment of an empty slice of the right type (but even this is determined by the sliced object). Changed in version 3.2: Previously it was illegal to delete a name from the local namespace if it occurs as a free variable in a nested block. 7.6. The return statement ¶ return_stmt : "return" [ expression_list ] return may only occur syntactically nested in a function definition, not within a nested class definition. If an expression list is present, it is evaluated, else None is substituted. return leaves the current function call with the expression list (or None ) as return value. When return passes control out of a try statement with a finally clause, that finally clause is executed before really leaving the function. In a generator function, the return statement indicates that the generator is done and will cause StopIteration to be raised. The returned value (if any) is used as an argument to construct StopIteration and becomes the StopIteration.value attribute. In an asynchronous generator function, an empty return statement indicates that the asynchronous generator is done and will cause StopAsyncIteration to be raised. A non-empty return statement is a syntax error in an asynchronous generator function. 7.7. The yield statement ¶ yield_stmt : yield_expression A yield statement is semantically equivalent to a yield expression . The yield statement can be used to omit the parentheses that would otherwise be required in the equivalent yield expression statement. For example, the yield statements yield < expr > yield from < expr > are equivalent to the yield expression statements ( yield < expr > ) ( yield from < expr > ) Yield expressions and statements are only used when defining a generator function, and are only used in the body of the generator function. Using yield in a function definition is sufficient to cause that definition to create a generator function instead of a normal function. For full details of yield semantics, refer to the Yield expressions section. 7.8. The raise statement ¶ raise_stmt : "raise" [ expression [ "from" expression ]] If no expressions are present, raise re-raises the exception that is currently being handled, which is also known as the active exception . If there isn’t currently an active exception, a RuntimeError exception is raised indicating that this is an error. Otherwise, raise evaluates the first expression as the exception object. It must be either a subclass or an instance of BaseException . If it is a class, the exception instance will be obtained when needed by instantiating the class with no arguments. The type of the exception is the exception instance’s class, the value is the instance itself. A traceback object is normally created automatically when an exception is raised and attached to it as the __traceback__ attribute. You can create an exception and set your own traceback in one step using the with_traceback() exception method (which returns the same exception instance, with its traceback set to its argument), like so: raise Exception ( "foo occurred" ) . with_traceback ( tracebackobj ) The from clause is used for exception chaining: if given, the second expression must be another exception class or instance. If the second expression is an exception instance, it will be attached to the raised exception as the __cause__ attribute (which is writable). If the expression is an exception class, the class will be instantiated and the resulting exception instance will be attached to the raised exception as the __cause__ attribute. If the raised exception is not handled, both exceptions will be printed: >>> try : ... print ( 1 / 0 ) ... except Exception as exc : ... raise RuntimeError ( "Something bad happened" ) from exc ... Traceback (most recent call last): File "<stdin>" , line 2 , in <module> print ( 1 / 0 ) ~~^~~ ZeroDivisionError : division by zero The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<stdin>" , line 4 , in <module> raise RuntimeError ( "Something bad happened" ) from exc RuntimeError : Something bad happened A similar mechanism works implicitly if a new exception is raised when an exception is already being handled. An exception may be handled when an except or finally clause, or a with statement, is used. The previous exception is then attached as the new exception’s __context__ attribute: >>> try : ... print ( 1 / 0 ) ... except : ... raise RuntimeError ( "Something bad happened" ) ... Traceback (most recent call last): File "<stdin>" , line 2 , in <module> print ( 1 / 0 ) ~~^~~ ZeroDivisionError : division by zero During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>" , line 4 , in <module> raise RuntimeError ( "Something bad happened" ) RuntimeError : Something bad happened Exception chaining can be explicitly suppressed by specifying None in the from clause: >>> try : ... print ( 1 / 0 ) ... except : ... raise RuntimeError ( "Something bad happened" ) from None ... Traceback (most recent call last): File "<stdin>" , line 4 , in <module> RuntimeError : Something bad happened Additional information on exceptions can be found in section Exceptions , and information about handling exceptions is in section The try statement . Changed in version 3.3: None is now permitted as Y in raise X from Y . Added the __suppress_context__ attribute to suppress automatic display of the exception context. Changed in version 3.11: If the traceback of the active exception is modified in an except clause, a subsequent raise statement re-raises the exception with the modified traceback. Previously, the exception was re-raised with the traceback it had when it was caught. 7.9. The break statement ¶ break_stmt : "break" break may only occur syntactically nested in a for or while loop, but not nested in a function or class definition within that loop. It terminates the nearest enclosing loop, skipping the optional else clause if the loop has one. If a for loop is terminated by break , the loop control target keeps its current value. When break passes control out of a try statement with a finally clause, that finally clause is executed before really leaving the loop. 7.10. The continue statement ¶ continue_stmt : "continue" continue may only occur syntactically nested in a for or while loop, but not nested in a function or class definition within that loop. It continues with the next cycle of the nearest enclosing loop. When continue passes control out of a try statement with a finally clause, that finally clause is executed before really starting the next loop cycle. 7.11. The import statement ¶ import_stmt : "import" module [ "as" identifier ] ( "," module [ "as" identifier ])* | "from" relative_module "import" identifier [ "as" identifier ] ( "," identifier [ "as" identifier ])* | "from" relative_module "import" "(" identifier [ "as" identifier ] ( "," identifier [ "as" identifier ])* [ "," ] ")" | "from" relative_module "import" "*" module : ( identifier "." )* identifier relative_module : "." * module | "." + The basic import statement (no from clause) is executed in two steps: find a module, loading and initializing it if necessary define a name or names in the local namespace for the scope where the import statement occurs. When the statement contains multiple clauses (separated by commas) the two steps are carried out separately for each clause, just as though the clauses had been separated out into individual import statements. The details of the first step, finding and loading modules, are described in greater detail in the section on the import system , which also describes the various types of packages and modules that can be imported, as well as all the hooks that can be used to customize the import system. Note that failures in this step may indicate either that the module could not be located, or that an error occurred while initializing the module, which includes execution of the module’s code. If the requested module is retrieved successfully, it will be made available in the local namespace in one of three ways: If the module name is followed by as , then the name following as is bound directly to the imported module. If no other name is specified, and the module being imported is a top level module, the module’s name is bound in the local namespace as a reference to the imported module If the module being imported is not a top level module, then the name of the top level package that contains the module is bound in the local namespace as a reference to the top level package. The imported module must be accessed using its full qualified name rather than directly The from form uses a slightly more complex process: find the module specified in the from clause, loading and initializing it if necessary; for each of the identifiers specified in the import clauses: check if the imported module has an attribute by that name if not, attempt to import a submodule with that name and then check the imported module again for that attribute if the attribute is not found, ImportError is raised. otherwise, a reference to that value is stored in the local namespace, using the name in the as clause if it is present, otherwise using the attribute name Examples: import foo # foo imported and bound locally import foo.bar.baz # foo, foo.bar, and foo.bar.baz imported, foo bound locally import foo.bar.baz as fbb # foo, foo.bar, and foo.bar.baz imported, foo.bar.baz bound as fbb from foo.bar import baz # foo, foo.bar, and foo.bar.baz imported, foo.bar.baz bound as baz from foo import attr # foo imported and foo.attr bound as attr If the list of identifiers is replaced by a star ( '*' ), all public names defined in the module are bound in the local namespace for the scope where the import statement occurs. The public names defined by a module are determined by checking the module’s namespace for a variable named __all__ ; if defined, it must be a sequence of strings which are names defined or imported by that module. The names given in __all__ are all considered public and are required to exist. If __all__ is not defined, the set of public names includes all names found in the module’s namespace which do not begin with an underscore character ( '_' ). __all__ should contain the entire public API. It is intended to avoid accidentally exporting items that are not part of the API (such as library modules which were imported and used within the module). The wild card form of import — from module import * — is only allowed at the module level. Attempting to use it in class or function definitions will raise a SyntaxError . When specifying what module to import you do not have to specify the absolute name of the module. When a module or package is contained within another package it is possible to make a relative import within the same top package without having to mention the package name. By using leading dots in the specified module or package after from you can specify how high to traverse up the current package hierarchy without specifying exact names. One leading dot means the current package where the module making the import exists. Two dots means up one package level. Three dots is up two levels, etc. So if you execute from . import mod from a module in the pkg package then you will end up importing pkg.mod . If you execute from ..subpkg2 import mod from within pkg.subpkg1 you will import pkg.subpkg2.mod . The specification for relative imports is contained in the Package Relative Imports section. importlib.import_module() is provided to support applications that determine dynamically the modules to be loaded. Raises an auditing event import with arguments module , filename , sys.path , sys.meta_path , sys.path_hooks . 7.11.1. Future statements ¶ A future statement is a directive to the compiler that a particular module should be compiled using syntax or semantics that will be available in a specified future release of Python where the feature becomes standard. The future statement is intended to ease migration to future versions of Python that introduce incompatible changes to the language. It allows use of the new features on a per-module basis before the release in which the feature becomes standard. future_stmt : "from" "__future__" "import" feature [ "as" identifier ] ( "," feature [ "as" identifier ])* | "from" "__future__" "import" "(" feature [ "as" identifier ] ( "," feature [ "as" identifier ])* [ "," ] ")" feature : identifier A future statement must appear near the top of the module. The only lines that can appear before a future statement are: the module docstring (if any), comments, blank lines, and other future statements. The only feature that requires using the future statement is annotations (see PEP 563 ). All historical features enabled by the future statement are still recognized by Python 3. The list includes absolute_import , division , generators , generator_stop , unicode_literals , print_function , nested_scopes and with_statement . They are all redundant because they are always enabled, and only kept for backwards compatibility. A future statement is recognized and treated specially at compile time: Changes to the semantics of core constructs are often implemented by generating different code. It may even be the case that a new feature introduces new incompatible syntax (such as a new reserved word), in which case the compiler may need to parse the module differently. Such decisions cannot be pushed off until runtime. For any given release, the compiler knows which feature names have been defined, and raises a compile-time error if a future statement contains a feature not known to it. The direct runtime semantics are the same as for any import statement: there is a standard module __future__ , described later, and it will be imported in the usual way at the time the future statement is executed. The interesting runtime semantics depend on the specific feature enabled by the future statement. Note that there is nothing special about the statement: import __future__ [ as name ] That is not a future statement; it’s an ordinary import statement with no special semantics or syntax restrictions. Code compiled by calls to the built-in functions exec() and compile() that occur in a module M containing a future statement will, by default, use the new syntax or semantics associated with the future statement. This can be controlled by optional arguments to compile() — see the documentation of that function for details. A future statement typed at an interactive interpreter prompt will take effect for the rest of the interpreter session. If an interpreter is started with the -i option, is passed a script name to execute, and the script includes a future statement, it will be in effect in the interactive session started after the script is executed. See also PEP 236 - Back to the __future__ The original proposal for the __future__ mechanism. 7.12. The global statement ¶ global_stmt : "global" identifier ( "," identifier )* The global statement causes the listed identifiers to be interpreted as globals. It would be impossible to assign to a global variable without global , although free variables may refer to globals without being declared global. The global statement applies to the entire current scope (module, function body or class definition). A SyntaxError is raised if a variable is used or assigned to prior to its global declaration in the scope. At the module level, all variables are global, so a global statement has no effect. However, variables must still not be used or assigned to prior to their global declaration. This requirement is relaxed in the interactive prompt ( REPL ). Programmer’s note: global is a directive to the parser. It applies only to code parsed at the same time as the global statement. In particular, a global statement contained in a string or code object supplied to the built-in exec() function does not affect the code block containing the function call, and code contained in such a string is unaffected by global statements in the code containing the function call. The same applies to the eval() and compile() functions. 7.13. The nonlocal statement ¶ nonlocal_stmt : "nonlocal" identifier ( "," identifier )* When the definition of a function or class is nested (enclosed) within the definitions of other functions, its nonlocal scopes are the local scopes of the enclosing functions. The nonlocal statement causes the listed identifiers to refer to names previously bound in nonlocal scopes. It allows encapsulated code to rebind such nonlocal identifiers. If a name is bound in more than one nonlocal scope, the nearest binding is used. If a name is not bound in any nonlocal scope, or if there is no nonlocal scope, a SyntaxError is raised. The nonlocal statement applies to the entire scope of a function or class body. A SyntaxError is raised if a variable is used or assigned to prior to its nonlocal declaration in the scope. See also PEP 3104 - Access to Names in Outer Scopes The specification for the nonlocal statement. Programmer’s note: nonlocal is a directive to the parser and applies only to code parsed along with it. See the note for the global statement. 7.14. The type statement ¶ type_stmt : 'type' identifier [ type_params ] "=" expression The type statement declares a type alias, which is an instance of typing.TypeAliasType . For example, the following statement creates a type alias: type Point = tuple [ float , float ] This code is roughly equivalent to: annotation - def VALUE_OF_Point (): return tuple [ float , float ] Point = typing . TypeAliasType ( "Point" , VALUE_OF_Point ()) annotation-def indicates an annotation scope , which behaves mostly like a function, but with several small differences. The value of the type alias is evaluated in the annotation scope. It is not evaluated when the type alias is created, but only when the value is accessed through the type alias’s __value__ attribute (see Lazy evaluation ). This allows the type alias to refer to names that are not yet defined. Type aliases may be made generic by adding a type parameter list after the name. See Generic type aliases for more. type is a soft keyword . Added in version 3.12. See also PEP 695 - Type Parameter Syntax Introduced the type statement and syntax for generic classes and functions. Table of Contents 7. Simple statements 7.1. Expression statements 7.2. Assignment statements 7.2.1. Augmented assignment statements 7.2.2. Annotated assignment statements 7.3. The assert statement 7.4. The pass statement 7.5. The del statement 7.6. The return statement 7.7. The yield statement 7.8. The raise statement 7.9. The break statement 7.10. The continue statement 7.11. The import statement 7.11.1. Future statements 7.12. The global statement 7.13. The nonlocal statement 7.14. The type statement Previous topic 6. Expressions Next topic 8. Compound statements This page Report a bug Show source « Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Language Reference » 7. Simple statements | Theme Auto Light Dark | © Copyright 2001 Python Software Foundation. This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. See History and License for more information. The Python Software Foundation is a non-profit corporation. Please donate. Last updated on Jan 13, 2026 (06:19 UTC). Found a bug ? Created using Sphinx 8.2.3. | 2026-01-13T08:48:43 |
https://calebporzio.com/laravel-lightwire-liveview-part-2 | Laravel Lightwire (LiveView): Taking Shape | Caleb Porzio Caleb Porzio Posts • Creations • Talks • Tweets Laravel Lightwire (LiveView): Taking Shape Jan 2019 The goal of this screencast series is to catch you up on the progress of the project and demo some dope new features I'm working on. I decided to break this screencast up into five parts for easier consumption. 25-minute videos are something I rarely commit to watching, so hopefully, this eases some of that pain for you. Note: This is OLD content. Some of what I demo may no longer be available in the framework. The docs are the source of truth for the project: https://livewire-framework.com/docs/quickstart/ First, let's walk through the new “component” architecture I decided to go with. Instead of each class representing a view, each class now represents a component, allowing you to isolate the state to a smaller part of each view, as well as add and compose multiple per page. Before we move on to the fun stuff, let’s rebuild the “Todos” component from the last blog post . This will serve as a good refresher for where we left off last time. The original demo only included one-way updates. That’s cool, but we weren’t using the other half of WebSocket’s power: sending updates from the server to the client. In this video, we’ll wire up real-time client updates based on server changes, like updating models. I’ve been toying with another cool feature that will keep a server-side piece of data in real-time sync with the value of an input field. This allows us to do some cool things easily, like real-time validation. Check it out. This final video might be the kind of thing you would assume is possible, but it actually was a little more complex to implement than you' think: nesting components inside other components. So there you go. That’s what I’ve been up to. If you are digging the direction of this, let me know on Twitter . I think I’ll want another week or two of playing around on my own before I open source it, but expect more updates like this in the meantime. Thanks for tuning in! Caleb My Newsletter I send out an email every so often about cool stuff I'm working on or launching. If you dig, go ahead and sign up! | 2026-01-13T08:48:43 |
https://www.youtube.com/watch?v=mneDaMYOKP8&list=PLNG_1j3cPCaZZ7etkzWA7JfdmKWT0pMsa&index=7 | React Docs Keynote - YouTube 정보 보도자료 저작권 문의하기 크리에이터 광고 개발자 약관 개인정보처리방침 정책 및 안전 YouTube 작동의 원리 새로운 기능 테스트하기 © 2026 Google LLC, Sundar Pichai, 1600 Amphitheatre Parkway, Mountain View CA 94043, USA, 0807-882-594 (무료), yt-support-solutions-kr@google.com, 호스팅: Google LLC, 사업자정보 , 불법촬영물 신고 크리에이터들이 유튜브 상에 게시, 태그 또는 추천한 상품들은 판매자들의 약관에 따라 판매됩니다. 유튜브는 이러한 제품들을 판매하지 않으며, 그에 대한 책임을 지지 않습니다. var ytInitialData = {"responseContext":{"serviceTrackingParams":[{"service":"CSI","params":[{"key":"c","value":"WEB"},{"key":"cver","value":"2.20260109.01.00"},{"key":"yt_li","value":"0"},{"key":"GetWatchNext_rid","value":"0x8804d9108e78323c"}]},{"service":"GFEEDBACK","params":[{"key":"logged_in","value":"0"},{"key":"visitor_data","value":"CgtXZEpaRnJIRlNhOCjnjZjLBjIKCgJLUhIEGgAgKWLfAgrcAjE1LllUPWJGT21QWnl6QWJNdW50V08tU1lHMy1tMENGM1ViR0sySzhEbXlUUzZxUTZ3UXlDUHZRaVdKeFdTc2dnQ2VLWkhRRWh4OTBUSVRvRnk5UXY2azZlbWJhVGUzZ1A0eFhVdDlxOHozb2xqTlRhTEtBZzEzOHFPVHhZQlhhWEtFRUlQLTZFaWtrWEU2QUJmZl9pOTNfQXpFa09tZjFfek5nMHNsNzlWbVh2ZXl2X1BWNE96ZUNJUUtKYnZmY0QyYllwTTlFSHY3SHhJb1JkdWN3b3RDak01Y3Y3RklCNXMzMFFRdDRmOVFPZ192bFZueTFNc1VhUktsNjN4MjVydUY5Q2xjclFXY1lyWTNMX3daTlByR0dLel9PNDZiZmRJbGVqWTR5TGdRMU1TZDNFWGt2Ti1JT3Z5b2JJUnlSMUFIaldPVXFPdVNfUVBObDd4eE5UTXJzaU9ndw%3D%3D"}]},{"service":"GUIDED_HELP","params":[{"key":"logged_in","value":"0"}]},{"service":"ECATCHER","params":[{"key":"client.version","value":"2.20260109"},{"key":"client.name","value":"WEB"}]}],"mainAppWebResponseContext":{"loggedOut":true,"trackingParam":"kx_fmPxhoPZRCHY-g9H3miEhk-1nbBeQ_50osziXrso20kHRgkussh7BwOcCE59TDtslLKPQ-SS"},"webResponseContextExtensionData":{"webResponseContextPreloadData":{"preloadMessageNames":["twoColumnWatchNextResults","results","videoPrimaryInfoRenderer","videoViewCountRenderer","menuRenderer","menuServiceItemRenderer","segmentedLikeDislikeButtonViewModel","likeButtonViewModel","toggleButtonViewModel","buttonViewModel","modalWithTitleAndButtonRenderer","buttonRenderer","dislikeButtonViewModel","unifiedSharePanelRenderer","menuFlexibleItemRenderer","videoSecondaryInfoRenderer","videoOwnerRenderer","subscribeButtonRenderer","subscriptionNotificationToggleButtonRenderer","menuPopupRenderer","confirmDialogRenderer","metadataRowContainerRenderer","compositeVideoPrimaryInfoRenderer","itemSectionRenderer","messageRenderer","secondaryResults","lockupViewModel","thumbnailViewModel","thumbnailOverlayBadgeViewModel","thumbnailBadgeViewModel","thumbnailHoverOverlayToggleActionsViewModel","lockupMetadataViewModel","decoratedAvatarViewModel","avatarViewModel","contentMetadataViewModel","sheetViewModel","listViewModel","listItemViewModel","badgeViewModel","continuationItemRenderer","autoplay","playerOverlayRenderer","menuNavigationItemRenderer","watchNextEndScreenRenderer","endScreenVideoRenderer","thumbnailOverlayTimeStatusRenderer","thumbnailOverlayNowPlayingRenderer","playerOverlayAutoplayRenderer","playerOverlayVideoDetailsRenderer","autoplaySwitchButtonRenderer","quickActionsViewModel","decoratedPlayerBarRenderer","multiMarkersPlayerBarRenderer","speedmasterEduViewModel","engagementPanelSectionListRenderer","adsEngagementPanelContentRenderer","engagementPanelTitleHeaderRenderer","chipBarViewModel","chipViewModel","sectionListRenderer","macroMarkersListRenderer","macroMarkersListItemRenderer","structuredDescriptionContentRenderer","videoDescriptionHeaderRenderer","factoidRenderer","viewCountFactoidRenderer","expandableVideoDescriptionBodyRenderer","expandableMetadataRenderer","videoSummaryContentViewModel","videoSummaryParagraphViewModel","horizontalCardListRenderer","richListHeaderRenderer","videoDescriptionTranscriptSectionRenderer","videoDescriptionInfocardsSectionRenderer","desktopTopbarRenderer","topbarLogoRenderer","fusionSearchboxRenderer","topbarMenuButtonRenderer","multiPageMenuRenderer","hotkeyDialogRenderer","hotkeyDialogSectionRenderer","hotkeyDialogSectionOptionRenderer","voiceSearchDialogRenderer","cinematicContainerRenderer"]},"ytConfigData":{"visitorData":"CgtXZEpaRnJIRlNhOCjnjZjLBjIKCgJLUhIEGgAgKWLfAgrcAjE1LllUPWJGT21QWnl6QWJNdW50V08tU1lHMy1tMENGM1ViR0sySzhEbXlUUzZxUTZ3UXlDUHZRaVdKeFdTc2dnQ2VLWkhRRWh4OTBUSVRvRnk5UXY2azZlbWJhVGUzZ1A0eFhVdDlxOHozb2xqTlRhTEtBZzEzOHFPVHhZQlhhWEtFRUlQLTZFaWtrWEU2QUJmZl9pOTNfQXpFa09tZjFfek5nMHNsNzlWbVh2ZXl2X1BWNE96ZUNJUUtKYnZmY0QyYllwTTlFSHY3SHhJb1JkdWN3b3RDak01Y3Y3RklCNXMzMFFRdDRmOVFPZ192bFZueTFNc1VhUktsNjN4MjVydUY5Q2xjclFXY1lyWTNMX3daTlByR0dLel9PNDZiZmRJbGVqWTR5TGdRMU1TZDNFWGt2Ti1JT3Z5b2JJUnlSMUFIaldPVXFPdVNfUVBObDd4eE5UTXJzaU9ndw%3D%3D","rootVisualElementType":3832},"webPrefetchData":{"navigationEndpoints":[{"clickTrackingParams":"CAAQg2ciEwjsov72kIiSAxVfYesIHV8OG_EyDHJlbGF0ZWQtYXV0b0j_0biwjO3gu5oBmgEFCAMQ-B3KAQS4IOTn","commandMetadata":{"webCommandMetadata":{"url":"/watch?v=lhVGdErZuN4\u0026pp=QAFIAQ%3D%3D","webPageType":"WEB_PAGE_TYPE_WATCH","rootVe":3832}},"watchEndpoint":{"videoId":"lhVGdErZuN4","params":"EAEYAdoBBAgBKgA%3D","playerParams":"QAFIAQ%3D%3D","watchEndpointSupportedPrefetchConfig":{"prefetchHintConfig":{"prefetchPriority":0,"countdownUiRelativeSecondsPrefetchCondition":-3}}}},{"clickTrackingParams":"CAAQg2ciEwjsov72kIiSAxVfYesIHV8OG_EyDHJlbGF0ZWQtYXV0b0j_0biwjO3gu5oBmgEFCAMQ-B3KAQS4IOTn","commandMetadata":{"webCommandMetadata":{"url":"/watch?v=lhVGdErZuN4\u0026pp=QAFIAQ%3D%3D","webPageType":"WEB_PAGE_TYPE_WATCH","rootVe":3832}},"watchEndpoint":{"videoId":"lhVGdErZuN4","params":"EAEYAdoBBAgBKgA%3D","playerParams":"QAFIAQ%3D%3D","watchEndpointSupportedPrefetchConfig":{"prefetchHintConfig":{"prefetchPriority":0,"countdownUiRelativeSecondsPrefetchCondition":-3}}}},{"clickTrackingParams":"CAAQg2ciEwjsov72kIiSAxVfYesIHV8OG_EyDHJlbGF0ZWQtYXV0b0j_0biwjO3gu5oBmgEFCAMQ-B3KAQS4IOTn","commandMetadata":{"webCommandMetadata":{"url":"/watch?v=lhVGdErZuN4\u0026pp=QAFIAQ%3D%3D","webPageType":"WEB_PAGE_TYPE_WATCH","rootVe":3832}},"watchEndpoint":{"videoId":"lhVGdErZuN4","params":"EAEYAdoBBAgBKgA%3D","playerParams":"QAFIAQ%3D%3D","watchEndpointSupportedPrefetchConfig":{"prefetchHintConfig":{"prefetchPriority":0,"countdownUiRelativeSecondsPrefetchCondition":-3}}}}]},"hasDecorated":true}},"contents":{"twoColumnWatchNextResults":{"results":{"results":{"contents":[{"videoPrimaryInfoRenderer":{"title":{"runs":[{"text":"React Docs Keynote"}]},"viewCount":{"videoViewCountRenderer":{"viewCount":{"simpleText":"조회수 13,110회"},"shortViewCount":{"simpleText":"조회수 1.3만회"},"originalViewCount":"0"}},"videoActions":{"menuRenderer":{"items":[{"menuServiceItemRenderer":{"text":{"runs":[{"text":"신고"}]},"icon":{"iconType":"FLAG"},"serviceEndpoint":{"clickTrackingParams":"CKMCEMyrARgAIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","showEngagementPanelEndpoint":{"identifier":{"tag":"PAabuse_report"},"globalConfiguration":{"params":"qgdxCAESC21uZURhTVlPS1A4GmBFZ3R0Ym1WRVlVMVpUMHRRT0VBQldBQjRCWklCTWdvd0VpNW9kSFJ3Y3pvdkwya3VlWFJwYldjdVkyOXRMM1pwTDIxdVpVUmhUVmxQUzFBNEwyUmxabUYxYkhRdWFuQm4%3D"},"engagementPanelPresentationConfigs":{"engagementPanelPopupPresentationConfig":{"popupType":"PANEL_POPUP_TYPE_DIALOG"}}}},"trackingParams":"CKMCEMyrARgAIhMI7KL-9pCIkgMVX2HrCB1fDhvx"}}],"trackingParams":"CKMCEMyrARgAIhMI7KL-9pCIkgMVX2HrCB1fDhvx","topLevelButtons":[{"segmentedLikeDislikeButtonViewModel":{"likeButtonViewModel":{"likeButtonViewModel":{"toggleButtonViewModel":{"toggleButtonViewModel":{"defaultButtonViewModel":{"buttonViewModel":{"iconName":"LIKE","title":"220","onTap":{"serialCommand":{"commands":[{"logGestureCommand":{"gestureType":"GESTURE_EVENT_TYPE_LOG_GENERIC_CLICK","trackingParams":"CK4CEKVBIhMI7KL-9pCIkgMVX2HrCB1fDhvx"}},{"innertubeCommand":{"clickTrackingParams":"CK4CEKVBIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"ignoreNavigation":true}},"modalEndpoint":{"modal":{"modalWithTitleAndButtonRenderer":{"title":{"simpleText":"동영상이 마음에 드시나요?"},"content":{"simpleText":"로그인하여 의견을 알려주세요."},"button":{"buttonRenderer":{"style":"STYLE_MONO_FILLED","size":"SIZE_DEFAULT","isDisabled":false,"text":{"simpleText":"로그인"},"navigationEndpoint":{"clickTrackingParams":"CK8CEPqGBCITCOyi_vaQiJIDFV9h6wgdXw4b8coBBLgg5Oc=","commandMetadata":{"webCommandMetadata":{"url":"https://accounts.google.com/ServiceLogin?service=youtube\u0026uilel=3\u0026passive=true\u0026continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26app%3Ddesktop%26hl%3Dko\u0026hl=ko\u0026ec=66426","webPageType":"WEB_PAGE_TYPE_UNKNOWN","rootVe":83769}},"signInEndpoint":{"nextEndpoint":{"clickTrackingParams":"CK8CEPqGBCITCOyi_vaQiJIDFV9h6wgdXw4b8coBBLgg5Oc=","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/like/like"}},"likeEndpoint":{"status":"LIKE","target":{"videoId":"mneDaMYOKP8"},"likeParams":"Cg0KC21uZURhTVlPS1A4IAAyDAjojZjLBhD5-NfFAQ%3D%3D"}},"idamTag":"66426"}},"trackingParams":"CK8CEPqGBCITCOyi_vaQiJIDFV9h6wgdXw4b8Q=="}}}}}}}]}},"accessibilityText":"다른 사용자 220명과 함께 이 동영상에 좋아요 표시","style":"BUTTON_VIEW_MODEL_STYLE_MONO","trackingParams":"CK4CEKVBIhMI7KL-9pCIkgMVX2HrCB1fDhvx","isFullWidth":false,"type":"BUTTON_VIEW_MODEL_TYPE_TONAL","buttonSize":"BUTTON_VIEW_MODEL_SIZE_DEFAULT","accessibilityId":"id.video.like.button","tooltip":"이 동영상이 마음에 듭니다."}},"toggledButtonViewModel":{"buttonViewModel":{"iconName":"LIKE","title":"221","onTap":{"serialCommand":{"commands":[{"logGestureCommand":{"gestureType":"GESTURE_EVENT_TYPE_LOG_GENERIC_CLICK","trackingParams":"CK0CEKVBIhMI7KL-9pCIkgMVX2HrCB1fDhvx"}},{"innertubeCommand":{"clickTrackingParams":"CK0CEKVBIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/like/removelike"}},"likeEndpoint":{"status":"INDIFFERENT","target":{"videoId":"mneDaMYOKP8"},"removeLikeParams":"Cg0KC21uZURhTVlPS1A4GAAqDAjojZjLBhDD4tjFAQ%3D%3D"}}}]}},"accessibilityText":"다른 사용자 220명과 함께 이 동영상에 좋아요 표시","style":"BUTTON_VIEW_MODEL_STYLE_MONO","trackingParams":"CK0CEKVBIhMI7KL-9pCIkgMVX2HrCB1fDhvx","isFullWidth":false,"type":"BUTTON_VIEW_MODEL_TYPE_TONAL","buttonSize":"BUTTON_VIEW_MODEL_SIZE_DEFAULT","accessibilityId":"id.video.like.button","tooltip":"좋아요 취소"}},"identifier":"watch-like","trackingParams":"CKMCEMyrARgAIhMI7KL-9pCIkgMVX2HrCB1fDhvx","isTogglingDisabled":true}},"likeStatusEntityKey":"EgttbmVEYU1ZT0tQOCA-KAE%3D","likeStatusEntity":{"key":"EgttbmVEYU1ZT0tQOCA-KAE%3D","likeStatus":"INDIFFERENT"}}},"dislikeButtonViewModel":{"dislikeButtonViewModel":{"toggleButtonViewModel":{"toggleButtonViewModel":{"defaultButtonViewModel":{"buttonViewModel":{"iconName":"DISLIKE","title":"싫어요","onTap":{"serialCommand":{"commands":[{"logGestureCommand":{"gestureType":"GESTURE_EVENT_TYPE_LOG_GENERIC_CLICK","trackingParams":"CKsCEKiPCSITCOyi_vaQiJIDFV9h6wgdXw4b8Q=="}},{"innertubeCommand":{"clickTrackingParams":"CKsCEKiPCSITCOyi_vaQiJIDFV9h6wgdXw4b8coBBLgg5Oc=","commandMetadata":{"webCommandMetadata":{"ignoreNavigation":true}},"modalEndpoint":{"modal":{"modalWithTitleAndButtonRenderer":{"title":{"simpleText":"동영상이 마음에 안 드시나요?"},"content":{"simpleText":"로그인하여 의견을 알려주세요."},"button":{"buttonRenderer":{"style":"STYLE_MONO_FILLED","size":"SIZE_DEFAULT","isDisabled":false,"text":{"simpleText":"로그인"},"navigationEndpoint":{"clickTrackingParams":"CKwCEPmGBCITCOyi_vaQiJIDFV9h6wgdXw4b8coBBLgg5Oc=","commandMetadata":{"webCommandMetadata":{"url":"https://accounts.google.com/ServiceLogin?service=youtube\u0026uilel=3\u0026passive=true\u0026continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26app%3Ddesktop%26hl%3Dko\u0026hl=ko\u0026ec=66425","webPageType":"WEB_PAGE_TYPE_UNKNOWN","rootVe":83769}},"signInEndpoint":{"nextEndpoint":{"clickTrackingParams":"CKwCEPmGBCITCOyi_vaQiJIDFV9h6wgdXw4b8coBBLgg5Oc=","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/like/dislike"}},"likeEndpoint":{"status":"DISLIKE","target":{"videoId":"mneDaMYOKP8"},"dislikeParams":"Cg0KC21uZURhTVlPS1A4EAAiDAjojZjLBhDliNrFAQ%3D%3D"}},"idamTag":"66425"}},"trackingParams":"CKwCEPmGBCITCOyi_vaQiJIDFV9h6wgdXw4b8Q=="}}}}}}}]}},"accessibilityText":"동영상에 싫어요 표시","style":"BUTTON_VIEW_MODEL_STYLE_MONO","trackingParams":"CKsCEKiPCSITCOyi_vaQiJIDFV9h6wgdXw4b8Q==","isFullWidth":false,"type":"BUTTON_VIEW_MODEL_TYPE_TONAL","buttonSize":"BUTTON_VIEW_MODEL_SIZE_DEFAULT","accessibilityId":"id.video.dislike.button","tooltip":"이 동영상이 마음에 들지 않습니다."}},"toggledButtonViewModel":{"buttonViewModel":{"iconName":"DISLIKE","title":"싫어요","onTap":{"serialCommand":{"commands":[{"logGestureCommand":{"gestureType":"GESTURE_EVENT_TYPE_LOG_GENERIC_CLICK","trackingParams":"CKoCEKiPCSITCOyi_vaQiJIDFV9h6wgdXw4b8Q=="}},{"innertubeCommand":{"clickTrackingParams":"CKoCEKiPCSITCOyi_vaQiJIDFV9h6wgdXw4b8coBBLgg5Oc=","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/like/removelike"}},"likeEndpoint":{"status":"INDIFFERENT","target":{"videoId":"mneDaMYOKP8"},"removeLikeParams":"Cg0KC21uZURhTVlPS1A4GAAqDAjojZjLBhDBpNrFAQ%3D%3D"}}}]}},"accessibilityText":"동영상에 싫어요 표시","style":"BUTTON_VIEW_MODEL_STYLE_MONO","trackingParams":"CKoCEKiPCSITCOyi_vaQiJIDFV9h6wgdXw4b8Q==","isFullWidth":false,"type":"BUTTON_VIEW_MODEL_TYPE_TONAL","buttonSize":"BUTTON_VIEW_MODEL_SIZE_DEFAULT","accessibilityId":"id.video.dislike.button","tooltip":"이 동영상이 마음에 들지 않습니다."}},"trackingParams":"CKMCEMyrARgAIhMI7KL-9pCIkgMVX2HrCB1fDhvx","isTogglingDisabled":true}},"dislikeEntityKey":"EgttbmVEYU1ZT0tQOCA-KAE%3D"}},"iconType":"LIKE_ICON_TYPE_UNKNOWN","likeCountEntity":{"key":"unset_like_count_entity_key"},"dynamicLikeCountUpdateData":{"updateStatusKey":"like_count_update_status_key","placeholderLikeCountValuesKey":"like_count_placeholder_values_key","updateDelayLoopId":"like_count_update_delay_loop_id","updateDelaySec":5},"teasersOrderEntityKey":"EgttbmVEYU1ZT0tQOCD8AygB"}},{"buttonViewModel":{"iconName":"SHARE","title":"공유","onTap":{"serialCommand":{"commands":[{"logGestureCommand":{"gestureType":"GESTURE_EVENT_TYPE_LOG_GENERIC_CLICK","trackingParams":"CKgCEOWWARgCIhMI7KL-9pCIkgMVX2HrCB1fDhvx"}},{"innertubeCommand":{"clickTrackingParams":"CKgCEOWWARgCIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/share/get_share_panel"}},"shareEntityServiceEndpoint":{"serializedShareEntity":"CgttbmVEYU1ZT0tQOKABAQ%3D%3D","commands":[{"clickTrackingParams":"CKgCEOWWARgCIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","openPopupAction":{"popup":{"unifiedSharePanelRenderer":{"trackingParams":"CKkCEI5iIhMI7KL-9pCIkgMVX2HrCB1fDhvx","showLoadingSpinner":true}},"popupType":"DIALOG","beReused":true}}]}}}]}},"accessibilityText":"공유","style":"BUTTON_VIEW_MODEL_STYLE_MONO","trackingParams":"CKgCEOWWARgCIhMI7KL-9pCIkgMVX2HrCB1fDhvx","isFullWidth":false,"type":"BUTTON_VIEW_MODEL_TYPE_TONAL","buttonSize":"BUTTON_VIEW_MODEL_SIZE_DEFAULT","state":"BUTTON_VIEW_MODEL_STATE_ACTIVE","accessibilityId":"id.video.share.button","tooltip":"공유"}}],"accessibility":{"accessibilityData":{"label":"추가 작업"}},"flexibleItems":[{"menuFlexibleItemRenderer":{"menuItem":{"menuServiceItemRenderer":{"text":{"runs":[{"text":"저장"}]},"icon":{"iconType":"PLAYLIST_ADD"},"serviceEndpoint":{"clickTrackingParams":"CKYCEOuQCSITCOyi_vaQiJIDFV9h6wgdXw4b8coBBLgg5Oc=","commandMetadata":{"webCommandMetadata":{"ignoreNavigation":true}},"modalEndpoint":{"modal":{"modalWithTitleAndButtonRenderer":{"title":{"runs":[{"text":"나중에 다시 보고 싶으신가요?"}]},"content":{"runs":[{"text":"로그인하여 동영상을 재생목록에 추가하세요."}]},"button":{"buttonRenderer":{"style":"STYLE_MONO_FILLED","size":"SIZE_DEFAULT","isDisabled":false,"text":{"simpleText":"로그인"},"navigationEndpoint":{"clickTrackingParams":"CKcCEPuGBCITCOyi_vaQiJIDFV9h6wgdXw4b8coBBLgg5Oc=","commandMetadata":{"webCommandMetadata":{"url":"https://accounts.google.com/ServiceLogin?service=youtube\u0026uilel=3\u0026passive=true\u0026continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26app%3Ddesktop%26hl%3Dko%26next%3D%252Fwatch%253Fv%253DmneDaMYOKP8%2526pp%253D0gcJCfcAYGclG_1k\u0026hl=ko\u0026ec=66427","webPageType":"WEB_PAGE_TYPE_UNKNOWN","rootVe":83769}},"signInEndpoint":{"nextEndpoint":{"clickTrackingParams":"CKcCEPuGBCITCOyi_vaQiJIDFV9h6wgdXw4b8coBBLgg5Oc=","commandMetadata":{"webCommandMetadata":{"url":"/watch?v=mneDaMYOKP8\u0026pp=0gcJCfcAYGclG_1k","webPageType":"WEB_PAGE_TYPE_WATCH","rootVe":3832}},"watchEndpoint":{"videoId":"mneDaMYOKP8","playerParams":"0gcJCfcAYGclG_1k","watchEndpointSupportedOnesieConfig":{"html5PlaybackOnesieConfig":{"commonConfig":{"url":"https://rr6---sn-ab02a0nfpgxapox-bh26z.googlevideo.com/initplayback?source=youtube\u0026oeis=1\u0026c=WEB\u0026oad=3200\u0026ovd=3200\u0026oaad=11000\u0026oavd=11000\u0026ocs=700\u0026oewis=1\u0026oputc=1\u0026ofpcc=1\u0026msp=1\u0026odepv=1\u0026id=9a778368c60e28ff\u0026ip=1.208.108.242\u0026initcwndbps=4411250\u0026mt=1768293662\u0026oweuc="}}}}},"idamTag":"66427"}},"trackingParams":"CKcCEPuGBCITCOyi_vaQiJIDFV9h6wgdXw4b8Q=="}}}}}},"trackingParams":"CKYCEOuQCSITCOyi_vaQiJIDFV9h6wgdXw4b8Q=="}},"topLevelButton":{"buttonViewModel":{"iconName":"PLAYLIST_ADD","title":"저장","onTap":{"serialCommand":{"commands":[{"logGestureCommand":{"gestureType":"GESTURE_EVENT_TYPE_LOG_GENERIC_CLICK","trackingParams":"CKQCEOuQCSITCOyi_vaQiJIDFV9h6wgdXw4b8Q=="}},{"innertubeCommand":{"clickTrackingParams":"CKQCEOuQCSITCOyi_vaQiJIDFV9h6wgdXw4b8coBBLgg5Oc=","commandMetadata":{"webCommandMetadata":{"ignoreNavigation":true}},"modalEndpoint":{"modal":{"modalWithTitleAndButtonRenderer":{"title":{"runs":[{"text":"나중에 다시 보고 싶으신가요?"}]},"content":{"runs":[{"text":"로그인하여 동영상을 재생목록에 추가하세요."}]},"button":{"buttonRenderer":{"style":"STYLE_MONO_FILLED","size":"SIZE_DEFAULT","isDisabled":false,"text":{"simpleText":"로그인"},"navigationEndpoint":{"clickTrackingParams":"CKUCEPuGBCITCOyi_vaQiJIDFV9h6wgdXw4b8coBBLgg5Oc=","commandMetadata":{"webCommandMetadata":{"url":"https://accounts.google.com/ServiceLogin?service=youtube\u0026uilel=3\u0026passive=true\u0026continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26app%3Ddesktop%26hl%3Dko%26next%3D%252Fwatch%253Fv%253DmneDaMYOKP8%2526pp%253D0gcJCfcAYGclG_1k\u0026hl=ko\u0026ec=66427","webPageType":"WEB_PAGE_TYPE_UNKNOWN","rootVe":83769}},"signInEndpoint":{"nextEndpoint":{"clickTrackingParams":"CKUCEPuGBCITCOyi_vaQiJIDFV9h6wgdXw4b8coBBLgg5Oc=","commandMetadata":{"webCommandMetadata":{"url":"/watch?v=mneDaMYOKP8\u0026pp=0gcJCfcAYGclG_1k","webPageType":"WEB_PAGE_TYPE_WATCH","rootVe":3832}},"watchEndpoint":{"videoId":"mneDaMYOKP8","playerParams":"0gcJCfcAYGclG_1k","watchEndpointSupportedOnesieConfig":{"html5PlaybackOnesieConfig":{"commonConfig":{"url":"https://rr6---sn-ab02a0nfpgxapox-bh26z.googlevideo.com/initplayback?source=youtube\u0026oeis=1\u0026c=WEB\u0026oad=3200\u0026ovd=3200\u0026oaad=11000\u0026oavd=11000\u0026ocs=700\u0026oewis=1\u0026oputc=1\u0026ofpcc=1\u0026msp=1\u0026odepv=1\u0026id=9a778368c60e28ff\u0026ip=1.208.108.242\u0026initcwndbps=4411250\u0026mt=1768293662\u0026oweuc="}}}}},"idamTag":"66427"}},"trackingParams":"CKUCEPuGBCITCOyi_vaQiJIDFV9h6wgdXw4b8Q=="}}}}}}}]}},"accessibilityText":"재생목록에 저장","style":"BUTTON_VIEW_MODEL_STYLE_MONO","trackingParams":"CKQCEOuQCSITCOyi_vaQiJIDFV9h6wgdXw4b8Q==","isFullWidth":false,"type":"BUTTON_VIEW_MODEL_TYPE_TONAL","buttonSize":"BUTTON_VIEW_MODEL_SIZE_DEFAULT","tooltip":"저장"}}}}]}},"trackingParams":"CKMCEMyrARgAIhMI7KL-9pCIkgMVX2HrCB1fDhvx","dateText":{"simpleText":"2021. 12. 9."},"relativeDateText":{"accessibility":{"accessibilityData":{"label":"4년 전"}},"simpleText":"4년 전"}}},{"videoSecondaryInfoRenderer":{"owner":{"videoOwnerRenderer":{"thumbnail":{"thumbnails":[{"url":"https://yt3.ggpht.com/uWYRwTF365L_lSs_3372-KSTENlGKJ6_T2enkHjewwy_mL7-AVDgFxm_8kRLdD5mHI6ga2Y1wzQ=s48-c-k-c0x00ffffff-no-rj","width":48,"height":48},{"url":"https://yt3.ggpht.com/uWYRwTF365L_lSs_3372-KSTENlGKJ6_T2enkHjewwy_mL7-AVDgFxm_8kRLdD5mHI6ga2Y1wzQ=s88-c-k-c0x00ffffff-no-rj","width":88,"height":88},{"url":"https://yt3.ggpht.com/uWYRwTF365L_lSs_3372-KSTENlGKJ6_T2enkHjewwy_mL7-AVDgFxm_8kRLdD5mHI6ga2Y1wzQ=s176-c-k-c0x00ffffff-no-rj","width":176,"height":176}]},"title":{"runs":[{"text":"React Conf","navigationEndpoint":{"clickTrackingParams":"CKICEOE5IhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"url":"/@ReactConfOfficial","webPageType":"WEB_PAGE_TYPE_CHANNEL","rootVe":3611,"apiUrl":"/youtubei/v1/browse"}},"browseEndpoint":{"browseId":"UC1hOCRBN2mnXgN5reSoO3pQ","canonicalBaseUrl":"/@ReactConfOfficial"}}}]},"subscriptionButton":{"type":"FREE"},"navigationEndpoint":{"clickTrackingParams":"CKICEOE5IhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"url":"/@ReactConfOfficial","webPageType":"WEB_PAGE_TYPE_CHANNEL","rootVe":3611,"apiUrl":"/youtubei/v1/browse"}},"browseEndpoint":{"browseId":"UC1hOCRBN2mnXgN5reSoO3pQ","canonicalBaseUrl":"/@ReactConfOfficial"}},"subscriberCountText":{"accessibility":{"accessibilityData":{"label":"구독자 3.43만명"}},"simpleText":"구독자 3.43만명"},"trackingParams":"CKICEOE5IhMI7KL-9pCIkgMVX2HrCB1fDhvx"}},"subscribeButton":{"subscribeButtonRenderer":{"buttonText":{"runs":[{"text":"구독"}]},"subscribed":false,"enabled":true,"type":"FREE","channelId":"UC1hOCRBN2mnXgN5reSoO3pQ","showPreferences":false,"subscribedButtonText":{"runs":[{"text":"구독중"}]},"unsubscribedButtonText":{"runs":[{"text":"구독"}]},"trackingParams":"CJQCEJsrIhMI7KL-9pCIkgMVX2HrCB1fDhvxKPgdMgV3YXRjaA==","unsubscribeButtonText":{"runs":[{"text":"구독 취소"}]},"subscribeAccessibility":{"accessibilityData":{"label":"React Conf을(를) 구독합니다."}},"unsubscribeAccessibility":{"accessibilityData":{"label":"React Conf을(를) 구독 취소합니다."}},"notificationPreferenceButton":{"subscriptionNotificationToggleButtonRenderer":{"states":[{"stateId":3,"nextStateId":3,"state":{"buttonRenderer":{"style":"STYLE_TEXT","size":"SIZE_DEFAULT","isDisabled":false,"icon":{"iconType":"NOTIFICATIONS_NONE"},"accessibility":{"label":"현재 설정은 맞춤설정 알림 수신입니다. React Conf 채널의 알림 설정을 변경하려면 탭하세요."},"trackingParams":"CKECEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvx","accessibilityData":{"accessibilityData":{"label":"현재 설정은 맞춤설정 알림 수신입니다. React Conf 채널의 알림 설정을 변경하려면 탭하세요."}}}}},{"stateId":0,"nextStateId":0,"state":{"buttonRenderer":{"style":"STYLE_TEXT","size":"SIZE_DEFAULT","isDisabled":false,"icon":{"iconType":"NOTIFICATIONS_OFF"},"accessibility":{"label":"현재 설정은 알림 수신 안함입니다. React Conf 채널의 알림 설정을 변경하려면 탭하세요."},"trackingParams":"CKACEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvx","accessibilityData":{"accessibilityData":{"label":"현재 설정은 알림 수신 안함입니다. React Conf 채널의 알림 설정을 변경하려면 탭하세요."}}}}}],"currentStateId":3,"trackingParams":"CJkCEJf5ASITCOyi_vaQiJIDFV9h6wgdXw4b8Q==","command":{"clickTrackingParams":"CJkCEJf5ASITCOyi_vaQiJIDFV9h6wgdXw4b8coBBLgg5Oc=","commandExecutorCommand":{"commands":[{"clickTrackingParams":"CJkCEJf5ASITCOyi_vaQiJIDFV9h6wgdXw4b8coBBLgg5Oc=","openPopupAction":{"popup":{"menuPopupRenderer":{"items":[{"menuServiceItemRenderer":{"text":{"simpleText":"맞춤설정"},"icon":{"iconType":"NOTIFICATIONS_NONE"},"serviceEndpoint":{"clickTrackingParams":"CJ8CEOy1BBgDIhMI7KL-9pCIkgMVX2HrCB1fDhvxMhJQUkVGRVJFTkNFX0RFRkFVTFTKAQS4IOTn","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/notification/modify_channel_preference"}},"modifyChannelNotificationPreferenceEndpoint":{"params":"ChhVQzFoT0NSQk4ybW5YZ041cmVTb08zcFESAggBGAAgBFITCgIIAxILbW5lRGFNWU9LUDgYAA%3D%3D"}},"trackingParams":"CJ8CEOy1BBgDIhMI7KL-9pCIkgMVX2HrCB1fDhvx","isSelected":true}},{"menuServiceItemRenderer":{"text":{"simpleText":"없음"},"icon":{"iconType":"NOTIFICATIONS_OFF"},"serviceEndpoint":{"clickTrackingParams":"CJ4CEO21BBgEIhMI7KL-9pCIkgMVX2HrCB1fDhvxMhtQUkVGRVJFTkNFX05PX05PVElGSUNBVElPTlPKAQS4IOTn","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/notification/modify_channel_preference"}},"modifyChannelNotificationPreferenceEndpoint":{"params":"ChhVQzFoT0NSQk4ybW5YZ041cmVTb08zcFESAggDGAAgBFITCgIIAxILbW5lRGFNWU9LUDgYAA%3D%3D"}},"trackingParams":"CJ4CEO21BBgEIhMI7KL-9pCIkgMVX2HrCB1fDhvx","isSelected":false}},{"menuServiceItemRenderer":{"text":{"runs":[{"text":"구독 취소"}]},"icon":{"iconType":"PERSON_MINUS"},"serviceEndpoint":{"clickTrackingParams":"CJoCENuLChgFIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"sendPost":true}},"signalServiceEndpoint":{"signal":"CLIENT_SIGNAL","actions":[{"clickTrackingParams":"CJoCENuLChgFIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","openPopupAction":{"popup":{"confirmDialogRenderer":{"trackingParams":"CJsCEMY4IhMI7KL-9pCIkgMVX2HrCB1fDhvx","dialogMessages":[{"runs":[{"text":"React Conf"},{"text":" 구독을 취소하시겠습니까?"}]}],"confirmButton":{"buttonRenderer":{"style":"STYLE_BLUE_TEXT","size":"SIZE_DEFAULT","isDisabled":false,"text":{"runs":[{"text":"구독 취소"}]},"serviceEndpoint":{"clickTrackingParams":"CJ0CEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvxMgV3YXRjaMoBBLgg5Oc=","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/subscription/unsubscribe"}},"unsubscribeEndpoint":{"channelIds":["UC1hOCRBN2mnXgN5reSoO3pQ"],"params":"CgIIAxILbW5lRGFNWU9LUDgYAA%3D%3D"}},"accessibility":{"label":"구독 취소"},"trackingParams":"CJ0CEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvx"}},"cancelButton":{"buttonRenderer":{"style":"STYLE_TEXT","size":"SIZE_DEFAULT","isDisabled":false,"text":{"runs":[{"text":"취소"}]},"accessibility":{"label":"취소"},"trackingParams":"CJwCEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvx"}},"primaryIsCancel":false}},"popupType":"DIALOG"}}]}},"trackingParams":"CJoCENuLChgFIhMI7KL-9pCIkgMVX2HrCB1fDhvx"}}]}},"popupType":"DROPDOWN"}}]}},"targetId":"notification-bell","secondaryIcon":{"iconType":"EXPAND_MORE"}}},"targetId":"watch-subscribe","signInEndpoint":{"clickTrackingParams":"CJQCEJsrIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"ignoreNavigation":true}},"modalEndpoint":{"modal":{"modalWithTitleAndButtonRenderer":{"title":{"simpleText":"채널을 구독하시겠습니까?"},"content":{"simpleText":"채널을 구독하려면 로그인하세요."},"button":{"buttonRenderer":{"style":"STYLE_MONO_FILLED","size":"SIZE_DEFAULT","isDisabled":false,"text":{"simpleText":"로그인"},"navigationEndpoint":{"clickTrackingParams":"CJgCEP2GBCITCOyi_vaQiJIDFV9h6wgdXw4b8TIJc3Vic2NyaWJlygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"url":"https://accounts.google.com/ServiceLogin?service=youtube\u0026uilel=3\u0026passive=true\u0026continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26app%3Ddesktop%26hl%3Dko%26next%3D%252Fwatch%253Fv%253DmneDaMYOKP8%2526pp%253D0gcJCfcAYGclG_1k%26continue_action%3DQUFFLUhqa01rRGxEX254MFY0TmJhUUZmZUJqSTBNa3NDd3xBQ3Jtc0tsU2VtbzFjemE5LThaY2dPT2JjQ0lqMEN4WW9pZ0hJVHZXNUtxaEVRNmxPeG12MFVhSWRJTmczWFMyV0Nrcm4wV2RfY3VRU2pfVE5YZF9VWnFsbW4waXhNZGpIYlllOU5XclZoS2VtUV9rSFFfRFlRWnM2RXB5LUxrYmdVeHJuSFB2Z0c1UVNSWjRuaG5QM3dOS3FWYzA4R2VjMm9nVTR6cTdDdUl0VGhNaE9hczVfaUpqVDB5OEliUlhCN0RmYnBiSENVZUo\u0026hl=ko\u0026ec=66429","webPageType":"WEB_PAGE_TYPE_UNKNOWN","rootVe":83769}},"signInEndpoint":{"nextEndpoint":{"clickTrackingParams":"CJgCEP2GBCITCOyi_vaQiJIDFV9h6wgdXw4b8coBBLgg5Oc=","commandMetadata":{"webCommandMetadata":{"url":"/watch?v=mneDaMYOKP8\u0026pp=0gcJCfcAYGclG_1k","webPageType":"WEB_PAGE_TYPE_WATCH","rootVe":3832}},"watchEndpoint":{"videoId":"mneDaMYOKP8","playerParams":"0gcJCfcAYGclG_1k","watchEndpointSupportedOnesieConfig":{"html5PlaybackOnesieConfig":{"commonConfig":{"url":"https://rr6---sn-ab02a0nfpgxapox-bh26z.googlevideo.com/initplayback?source=youtube\u0026oeis=1\u0026c=WEB\u0026oad=3200\u0026ovd=3200\u0026oaad=11000\u0026oavd=11000\u0026ocs=700\u0026oewis=1\u0026oputc=1\u0026ofpcc=1\u0026msp=1\u0026odepv=1\u0026id=9a778368c60e28ff\u0026ip=1.208.108.242\u0026initcwndbps=4411250\u0026mt=1768293662\u0026oweuc="}}}}},"continueAction":"QUFFLUhqa01rRGxEX254MFY0TmJhUUZmZUJqSTBNa3NDd3xBQ3Jtc0tsU2VtbzFjemE5LThaY2dPT2JjQ0lqMEN4WW9pZ0hJVHZXNUtxaEVRNmxPeG12MFVhSWRJTmczWFMyV0Nrcm4wV2RfY3VRU2pfVE5YZF9VWnFsbW4waXhNZGpIYlllOU5XclZoS2VtUV9rSFFfRFlRWnM2RXB5LUxrYmdVeHJuSFB2Z0c1UVNSWjRuaG5QM3dOS3FWYzA4R2VjMm9nVTR6cTdDdUl0VGhNaE9hczVfaUpqVDB5OEliUlhCN0RmYnBiSENVZUo","idamTag":"66429"}},"trackingParams":"CJgCEP2GBCITCOyi_vaQiJIDFV9h6wgdXw4b8Q=="}}}}}},"subscribedEntityKey":"EhhVQzFoT0NSQk4ybW5YZ041cmVTb08zcFEgMygB","onSubscribeEndpoints":[{"clickTrackingParams":"CJQCEJsrIhMI7KL-9pCIkgMVX2HrCB1fDhvxKPgdMgV3YXRjaMoBBLgg5Oc=","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/subscription/subscribe"}},"subscribeEndpoint":{"channelIds":["UC1hOCRBN2mnXgN5reSoO3pQ"],"params":"EgIIAxgAIgttbmVEYU1ZT0tQOA%3D%3D"}}],"onUnsubscribeEndpoints":[{"clickTrackingParams":"CJQCEJsrIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"sendPost":true}},"signalServiceEndpoint":{"signal":"CLIENT_SIGNAL","actions":[{"clickTrackingParams":"CJQCEJsrIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","openPopupAction":{"popup":{"confirmDialogRenderer":{"trackingParams":"CJUCEMY4IhMI7KL-9pCIkgMVX2HrCB1fDhvx","dialogMessages":[{"runs":[{"text":"React Conf"},{"text":" 구독을 취소하시겠습니까?"}]}],"confirmButton":{"buttonRenderer":{"style":"STYLE_BLUE_TEXT","size":"SIZE_DEFAULT","isDisabled":false,"text":{"runs":[{"text":"구독 취소"}]},"serviceEndpoint":{"clickTrackingParams":"CJcCEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvxKPgdMgV3YXRjaMoBBLgg5Oc=","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/subscription/unsubscribe"}},"unsubscribeEndpoint":{"channelIds":["UC1hOCRBN2mnXgN5reSoO3pQ"],"params":"CgIIAxILbW5lRGFNWU9LUDgYAA%3D%3D"}},"accessibility":{"label":"구독 취소"},"trackingParams":"CJcCEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvx"}},"cancelButton":{"buttonRenderer":{"style":"STYLE_TEXT","size":"SIZE_DEFAULT","isDisabled":false,"text":{"runs":[{"text":"취소"}]},"accessibility":{"label":"취소"},"trackingParams":"CJYCEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvx"}},"primaryIsCancel":false}},"popupType":"DIALOG"}}]}}]}},"metadataRowContainer":{"metadataRowContainerRenderer":{"collapsedItemCount":0,"trackingParams":"CJMCEM2rARgBIhMI7KL-9pCIkgMVX2HrCB1fDhvx"}},"showMoreText":{"simpleText":"...더보기"},"showLessText":{"simpleText":"간략히"},"trackingParams":"CJMCEM2rARgBIhMI7KL-9pCIkgMVX2HrCB1fDhvx","defaultExpanded":false,"descriptionCollapsedLines":3,"showMoreCommand":{"clickTrackingParams":"CJMCEM2rARgBIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandExecutorCommand":{"commands":[{"clickTrackingParams":"CJMCEM2rARgBIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","changeEngagementPanelVisibilityAction":{"targetId":"engagement-panel-structured-description","visibility":"ENGAGEMENT_PANEL_VISIBILITY_EXPANDED"}},{"clickTrackingParams":"CJMCEM2rARgBIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","scrollToEngagementPanelCommand":{"targetId":"engagement-panel-structured-description"}}]}},"showLessCommand":{"clickTrackingParams":"CJMCEM2rARgBIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","changeEngagementPanelVisibilityAction":{"targetId":"engagement-panel-structured-description","visibility":"ENGAGEMENT_PANEL_VISIBILITY_HIDDEN"}},"attributedDescription":{"content":"Rachel Nabors","styleRuns":[{"startIndex":0,"length":13,"styleRunExtensions":{"styleRunColorMapExtension":{"colorMap":[{"key":"USER_INTERFACE_THEME_DARK","value":4294967295},{"key":"USER_INTERFACE_THEME_LIGHT","value":4279440147}]}},"fontFamilyName":"Roboto"}]},"headerRuns":[{"startIndex":0,"length":13,"headerMapping":"ATTRIBUTED_STRING_HEADER_MAPPING_UNSPECIFIED"}]}},{"compositeVideoPrimaryInfoRenderer":{}},{"itemSectionRenderer":{"contents":[{"messageRenderer":{"text":{"runs":[{"text":"댓글이 사용 중지되었습니다. "},{"text":"자세히 알아보기","navigationEndpoint":{"clickTrackingParams":"CJICEJY7GAAiEwjsov72kIiSAxVfYesIHV8OG_HKAQS4IOTn","commandMetadata":{"webCommandMetadata":{"url":"https://support.google.com/youtube/answer/9706180?hl=ko","webPageType":"WEB_PAGE_TYPE_UNKNOWN","rootVe":83769}},"urlEndpoint":{"url":"https://support.google.com/youtube/answer/9706180?hl=ko"}}}]},"trackingParams":"CJICEJY7GAAiEwjsov72kIiSAxVfYesIHV8OG_E="}}],"trackingParams":"CJECELsvGAMiEwjsov72kIiSAxVfYesIHV8OG_E=","sectionIdentifier":"comment-item-section"}}],"trackingParams":"CJACELovIhMI7KL-9pCIkgMVX2HrCB1fDhvx"}},"secondaryResults":{"secondaryResults":{"results":[{"lockupViewModel":{"contentImage":{"thumbnailViewModel":{"image":{"sources":[{"url":"https://i.ytimg.com/vi/-7odLW_hG7s/hqdefault.jpg?sqp=-oaymwEiCKgBEF5IWvKriqkDFQgBFQAAAAAYASUAAMhCPQCAokN4AQ==\u0026rs=AOn4CLAa3DeqfT1sfFq2TvX2Ifc7_Uys1g","width":168,"height":94},{"url":"https://i.ytimg.com/vi/-7odLW_hG7s/hqdefault.jpg?sqp=-oaymwEjCNACELwBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=\u0026rs=AOn4CLCzAHV8WDB4Xbhr6qeC_9M8BbP91A","width":336,"height":188}]},"overlays":[{"thumbnailOverlayBadgeViewModel":{"thumbnailBadges":[{"thumbnailBadgeViewModel":{"text":"9:20","badgeStyle":"THUMBNAIL_OVERLAY_BADGE_STYLE_DEFAULT","animationActivationTargetId":"-7odLW_hG7s","animationActivationEntityKey":"Eh8veW91dHViZS9hcHAvd2F0Y2gvcGxheWVyX3N0YXRlIMMCKAE%3D","lottieData":{"url":"https://www.gstatic.com/youtube/img/lottie/audio_indicator/audio_indicator_v2.json","settings":{"loop":true,"autoplay":true}},"animatedText":"지금 재생 중","animationActivationEntitySelectorType":"THUMBNAIL_BADGE_ANIMATION_ENTITY_SELECTOR_TYPE_PLAYER_STATE","rendererContext":{"accessibilityContext":{"label":"9분 20초"}}}}],"position":"THUMBNAIL_OVERLAY_BADGE_POSITION_BOTTOM_END"}},{"thumbnailHoverOverlayToggleActionsViewModel":{"buttons":[{"toggleButtonViewModel":{"defaultButtonViewModel":{"buttonViewModel":{"iconName":"WATCH_LATER","onTap":{"innertubeCommand":{"clickTrackingParams":"CI8CEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/browse/edit_playlist"}},"playlistEditEndpoint":{"playlistId":"WL","actions":[{"addedVideoId":"-7odLW_hG7s","action":"ACTION_ADD_VIDEO"}]}}},"accessibilityText":"나중에 볼 동영상","style":"BUTTON_VIEW_MODEL_STYLE_OVERLAY_DARK","trackingParams":"CI8CEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvx","type":"BUTTON_VIEW_MODEL_TYPE_TONAL","buttonSize":"BUTTON_VIEW_MODEL_SIZE_COMPACT","state":"BUTTON_VIEW_MODEL_STATE_ACTIVE"}},"toggledButtonViewModel":{"buttonViewModel":{"iconName":"CHECK","onTap":{"innertubeCommand":{"clickTrackingParams":"CI4CEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/browse/edit_playlist"}},"playlistEditEndpoint":{"playlistId":"WL","actions":[{"action":"ACTION_REMOVE_VIDEO_BY_VIDEO_ID","removedVideoId":"-7odLW_hG7s"}]}}},"accessibilityText":"추가됨","style":"BUTTON_VIEW_MODEL_STYLE_OVERLAY_DARK","trackingParams":"CI4CEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvx","type":"BUTTON_VIEW_MODEL_TYPE_TONAL","buttonSize":"BUTTON_VIEW_MODEL_SIZE_COMPACT","state":"BUTTON_VIEW_MODEL_STATE_ACTIVE"}},"isToggled":false,"trackingParams":"CIcCENTEDBgAIhMI7KL-9pCIkgMVX2HrCB1fDhvx"}},{"toggleButtonViewModel":{"defaultButtonViewModel":{"buttonViewModel":{"iconName":"ADD_TO_QUEUE_TAIL","onTap":{"innertubeCommand":{"clickTrackingParams":"CI0CEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"sendPost":true}},"signalServiceEndpoint":{"signal":"CLIENT_SIGNAL","actions":[{"clickTrackingParams":"CI0CEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","addToPlaylistCommand":{"openMiniplayer":false,"openListPanel":true,"videoId":"-7odLW_hG7s","listType":"PLAYLIST_EDIT_LIST_TYPE_QUEUE","onCreateListCommand":{"clickTrackingParams":"CI0CEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/playlist/create"}},"createPlaylistServiceEndpoint":{"videoIds":["-7odLW_hG7s"],"params":"CAQ%3D"}},"videoIds":["-7odLW_hG7s"],"videoCommand":{"clickTrackingParams":"CI0CEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"url":"/watch?v=-7odLW_hG7s","webPageType":"WEB_PAGE_TYPE_WATCH","rootVe":3832}},"watchEndpoint":{"videoId":"-7odLW_hG7s","watchEndpointSupportedOnesieConfig":{"html5PlaybackOnesieConfig":{"commonConfig":{"url":"https://rr3---sn-ab02a0nfpgxapox-bh2zs.googlevideo.com/initplayback?source=youtube\u0026oeis=1\u0026c=WEB\u0026oad=3200\u0026ovd=3200\u0026oaad=11000\u0026oavd=11000\u0026ocs=700\u0026oewis=1\u0026oputc=1\u0026ofpcc=1\u0026msp=1\u0026odepv=1\u0026id=fbba1d2d6fe11bbb\u0026ip=1.208.108.242\u0026initcwndbps=3783750\u0026mt=1768293662\u0026oweuc="}}}}}}}]}}},"accessibilityText":"현재 재생목록에 추가","style":"BUTTON_VIEW_MODEL_STYLE_OVERLAY_DARK","trackingParams":"CI0CEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvx","type":"BUTTON_VIEW_MODEL_TYPE_TONAL","buttonSize":"BUTTON_VIEW_MODEL_SIZE_COMPACT","state":"BUTTON_VIEW_MODEL_STATE_ACTIVE"}},"toggledButtonViewModel":{"buttonViewModel":{"iconName":"CHECK","accessibilityText":"추가됨","style":"BUTTON_VIEW_MODEL_STYLE_OVERLAY_DARK","trackingParams":"CIwCEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvx","type":"BUTTON_VIEW_MODEL_TYPE_TONAL","buttonSize":"BUTTON_VIEW_MODEL_SIZE_COMPACT","state":"BUTTON_VIEW_MODEL_STATE_ACTIVE"}},"isToggled":false,"trackingParams":"CIcCENTEDBgAIhMI7KL-9pCIkgMVX2HrCB1fDhvx"}}]}}]}},"metadata":{"lockupMetadataViewModel":{"title":{"content":"Things I learnt from the new React docs"},"image":{"decoratedAvatarViewModel":{"avatar":{"avatarViewModel":{"image":{"sources":[{"url":"https://yt3.ggpht.com/uWYRwTF365L_lSs_3372-KSTENlGKJ6_T2enkHjewwy_mL7-AVDgFxm_8kRLdD5mHI6ga2Y1wzQ=s68-c-k-c0x00ffffff-no-rj","width":68,"height":68}]},"avatarImageSize":"AVATAR_SIZE_M"}},"a11yLabel":"React Conf 채널로 이동","rendererContext":{"commandContext":{"onTap":{"innertubeCommand":{"clickTrackingParams":"CIcCENTEDBgAIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"url":"/@ReactConfOfficial","webPageType":"WEB_PAGE_TYPE_CHANNEL","rootVe":3611,"apiUrl":"/youtubei/v1/browse"}},"browseEndpoint":{"browseId":"UC1hOCRBN2mnXgN5reSoO3pQ","canonicalBaseUrl":"/@ReactConfOfficial"}}}}}}},"metadata":{"contentMetadataViewModel":{"metadataRows":[{"metadataParts":[{"text":{"content":"React Conf"}}]},{"metadataParts":[{"text":{"content":"조회수 8.3천회"}},{"text":{"content":"4년 전"}}]}],"delimiter":" • "}},"menuButton":{"buttonViewModel":{"iconName":"MORE_VERT","onTap":{"innertubeCommand":{"clickTrackingParams":"CIgCEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","showSheetCommand":{"panelLoadingStrategy":{"inlineContent":{"sheetViewModel":{"content":{"listViewModel":{"listItems":[{"listItemViewModel":{"title":{"content":"현재 재생목록에 추가"},"leadingImage":{"sources":[{"clientResource":{"imageName":"ADD_TO_QUEUE_TAIL"}}]},"rendererContext":{"loggingContext":{"loggingDirectives":{"trackingParams":"CIsCEP6YBBgAIhMI7KL-9pCIkgMVX2HrCB1fDhvx","visibility":{"types":"12"}}},"commandContext":{"onTap":{"innertubeCommand":{"clickTrackingParams":"CIsCEP6YBBgAIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"sendPost":true}},"signalServiceEndpoint":{"signal":"CLIENT_SIGNAL","actions":[{"clickTrackingParams":"CIsCEP6YBBgAIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","addToPlaylistCommand":{"openMiniplayer":true,"videoId":"-7odLW_hG7s","listType":"PLAYLIST_EDIT_LIST_TYPE_QUEUE","onCreateListCommand":{"clickTrackingParams":"CIsCEP6YBBgAIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/playlist/create"}},"createPlaylistServiceEndpoint":{"videoIds":["-7odLW_hG7s"],"params":"CAQ%3D"}},"videoIds":["-7odLW_hG7s"],"videoCommand":{"clickTrackingParams":"CIsCEP6YBBgAIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"url":"/watch?v=-7odLW_hG7s\u0026pp=0gcJCUUEdf6zKzOD","webPageType":"WEB_PAGE_TYPE_WATCH","rootVe":3832}},"watchEndpoint":{"videoId":"-7odLW_hG7s","playerParams":"0gcJCUUEdf6zKzOD","watchEndpointSupportedOnesieConfig":{"html5PlaybackOnesieConfig":{"commonConfig":{"url":"https://rr3---sn-ab02a0nfpgxapox-bh2zs.googlevideo.com/initplayback?source=youtube\u0026oeis=1\u0026c=WEB\u0026oad=3200\u0026ovd=3200\u0026oaad=11000\u0026oavd=11000\u0026ocs=700\u0026oewis=1\u0026oputc=1\u0026ofpcc=1\u0026msp=1\u0026odepv=1\u0026id=fbba1d2d6fe11bbb\u0026ip=1.208.108.242\u0026initcwndbps=3783750\u0026mt=1768293662\u0026oweuc="}}}}}}}]}}}}}}},{"listItemViewModel":{"title":{"content":"재생목록에 저장"},"leadingImage":{"sources":[{"clientResource":{"imageName":"BOOKMARK_BORDER"}}]},"rendererContext":{"loggingContext":{"loggingDirectives":{"trackingParams":"CIoCEJSsCRgBIhMI7KL-9pCIkgMVX2HrCB1fDhvx","visibility":{"types":"12"}}},"commandContext":{"onTap":{"innertubeCommand":{"clickTrackingParams":"CIoCEJSsCRgBIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"url":"https://accounts.google.com/ServiceLogin?service=youtube\u0026uilel=3\u0026passive=true\u0026continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26app%3Ddesktop%26hl%3Dko\u0026hl=ko","webPageType":"WEB_PAGE_TYPE_UNKNOWN","rootVe":83769}},"signInEndpoint":{"nextEndpoint":{"clickTrackingParams":"CIoCEJSsCRgBIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","showSheetCommand":{"panelLoadingStrategy":{"requestTemplate":{"panelId":"PAadd_to_playlist","params":"-gYNCgstN29kTFdfaEc3cw%3D%3D"}}}}}}}}}}},{"listItemViewModel":{"title":{"content":"공유"},"leadingImage":{"sources":[{"clientResource":{"imageName":"SHARE"}}]},"rendererContext":{"commandContext":{"onTap":{"innertubeCommand":{"clickTrackingParams":"CIgCEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/share/get_share_panel"}},"shareEntityServiceEndpoint":{"serializedShareEntity":"CgstN29kTFdfaEc3cw%3D%3D","commands":[{"clickTrackingParams":"CIgCEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","openPopupAction":{"popup":{"unifiedSharePanelRenderer":{"trackingParams":"CIkCEI5iIhMI7KL-9pCIkgMVX2HrCB1fDhvx","showLoadingSpinner":true}},"popupType":"DIALOG","beReused":true}}]}}}}}}}]}}}}}}}},"accessibilityText":"추가 작업","style":"BUTTON_VIEW_MODEL_STYLE_MONO","trackingParams":"CIgCEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvx","type":"BUTTON_VIEW_MODEL_TYPE_TEXT","buttonSize":"BUTTON_VIEW_MODEL_SIZE_DEFAULT","state":"BUTTON_VIEW_MODEL_STATE_ACTIVE"}}}},"contentId":"-7odLW_hG7s","contentType":"LOCKUP_CONTENT_TYPE_VIDEO","rendererContext":{"loggingContext":{"loggingDirectives":{"trackingParams":"CIcCENTEDBgAIhMI7KL-9pCIkgMVX2HrCB1fDhvx","visibility":{"types":"12"}}},"accessibilityContext":{"label":"Things I learnt from the new React docs 9분 20초"},"commandContext":{"onTap":{"innertubeCommand":{"clickTrackingParams":"CIcCENTEDBgAIhMI7KL-9pCIkgMVX2HrCB1fDhvxMgdyZWxhdGVkSP_RuLCM7eC7mgGaAQUIARD4HcoBBLgg5Oc=","commandMetadata":{"webCommandMetadata":{"url":"/watch?v=-7odLW_hG7s","webPageType":"WEB_PAGE_TYPE_WATCH","rootVe":3832}},"watchEndpoint":{"videoId":"-7odLW_hG7s","nofollow":true,"watchEndpointSupportedOnesieConfig":{"html5PlaybackOnesieConfig":{"commonConfig":{"url":"https://rr3---sn-ab02a0nfpgxapox-bh2zs.googlevideo.com/initplayback?source=youtube\u0026oeis=1\u0026c=WEB\u0026oad=3200\u0026ovd=3200\u0026oaad=11000\u0026oavd=11000\u0026ocs=700\u0026oewis=1\u0026oputc=1\u0026ofpcc=1\u0026msp=1\u0026odepv=1\u0026id=fbba1d2d6fe11bbb\u0026ip=1.208.108.242\u0026initcwndbps=3783750\u0026mt=1768293662\u0026oweuc="}}}}}}}}}},{"lockupViewModel":{"contentImage":{"thumbnailViewModel":{"image":{"sources":[{"url":"https://i.ytimg.com/vi/_3TbZtQ-9rg/hqdefault.jpg?sqp=-oaymwEiCKgBEF5IWvKriqkDFQgBFQAAAAAYASUAAMhCPQCAokN4AQ==\u0026rs=AOn4CLCbKvHY3c-LmzTOjNYuEpq9nvMpPQ","width":168,"height":94},{"url":"https://i.ytimg.com/vi/_3TbZtQ-9rg/hqdefault.jpg?sqp=-oaymwEjCNACELwBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=\u0026rs=AOn4CLByII4SaVHoQilklJXGC96CSrkcGg","width":336,"height":188}]},"overlays":[{"thumbnailOverlayBadgeViewModel":{"thumbnailBadges":[{"thumbnailBadgeViewModel":{"text":"11:24","badgeStyle":"THUMBNAIL_OVERLAY_BADGE_STYLE_DEFAULT","animationActivationTargetId":"_3TbZtQ-9rg","animationActivationEntityKey":"Eh8veW91dHViZS9hcHAvd2F0Y2gvcGxheWVyX3N0YXRlIMMCKAE%3D","lottieData":{"url":"https://www.gstatic.com/youtube/img/lottie/audio_indicator/audio_indicator_v2.json","settings":{"loop":true,"autoplay":true}},"animatedText":"지금 재생 중","animationActivationEntitySelectorType":"THUMBNAIL_BADGE_ANIMATION_ENTITY_SELECTOR_TYPE_PLAYER_STATE","rendererContext":{"accessibilityContext":{"label":"11분 24초"}}}}],"position":"THUMBNAIL_OVERLAY_BADGE_POSITION_BOTTOM_END"}},{"thumbnailHoverOverlayToggleActionsViewModel":{"buttons":[{"toggleButtonViewModel":{"defaultButtonViewModel":{"buttonViewModel":{"iconName":"WATCH_LATER","onTap":{"innertubeCommand":{"clickTrackingParams":"CIYCEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/browse/edit_playlist"}},"playlistEditEndpoint":{"playlistId":"WL","actions":[{"addedVideoId":"_3TbZtQ-9rg","action":"ACTION_ADD_VIDEO"}]}}},"accessibilityText":"나중에 볼 동영상","style":"BUTTON_VIEW_MODEL_STYLE_OVERLAY_DARK","trackingParams":"CIYCEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvx","type":"BUTTON_VIEW_MODEL_TYPE_TONAL","buttonSize":"BUTTON_VIEW_MODEL_SIZE_COMPACT","state":"BUTTON_VIEW_MODEL_STATE_ACTIVE"}},"toggledButtonViewModel":{"buttonViewModel":{"iconName":"CHECK","onTap":{"innertubeCommand":{"clickTrackingParams":"CIUCEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/browse/edit_playlist"}},"playlistEditEndpoint":{"playlistId":"WL","actions":[{"action":"ACTION_REMOVE_VIDEO_BY_VIDEO_ID","removedVideoId":"_3TbZtQ-9rg"}]}}},"accessibilityText":"추가됨","style":"BUTTON_VIEW_MODEL_STYLE_OVERLAY_DARK","trackingParams":"CIUCEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvx","type":"BUTTON_VIEW_MODEL_TYPE_TONAL","buttonSize":"BUTTON_VIEW_MODEL_SIZE_COMPACT","state":"BUTTON_VIEW_MODEL_STATE_ACTIVE"}},"isToggled":false,"trackingParams":"CP4BENTEDBgBIhMI7KL-9pCIkgMVX2HrCB1fDhvx"}},{"toggleButtonViewModel":{"defaultButtonViewModel":{"buttonViewModel":{"iconName":"ADD_TO_QUEUE_TAIL","onTap":{"innertubeCommand":{"clickTrackingParams":"CIQCEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"sendPost":true}},"signalServiceEndpoint":{"signal":"CLIENT_SIGNAL","actions":[{"clickTrackingParams":"CIQCEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","addToPlaylistCommand":{"openMiniplayer":false,"openListPanel":true,"videoId":"_3TbZtQ-9rg","listType":"PLAYLIST_EDIT_LIST_TYPE_QUEUE","onCreateListCommand":{"clickTrackingParams":"CIQCEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"sendPost":true,"apiUrl":"/youtubei/v1/playlist/create"}},"createPlaylistServiceEndpoint":{"videoIds":["_3TbZtQ-9rg"],"params":"CAQ%3D"}},"videoIds":["_3TbZtQ-9rg"],"videoCommand":{"clickTrackingParams":"CIQCEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"url":"/watch?v=_3TbZtQ-9rg","webPageType":"WEB_PAGE_TYPE_WATCH","rootVe":3832}},"watchEndpoint":{"videoId":"_3TbZtQ-9rg","watchEndpointSupportedOnesieConfig":{"html5PlaybackOnesieConfig":{"commonConfig":{"url":"https://rr9---sn-ab02a0nfpgxapox-bh2lk.googlevideo.com/initplayback?source=youtube\u0026oeis=1\u0026c=WEB\u0026oad=3200\u0026ovd=3200\u0026oaad=11000\u0026oavd=11000\u0026ocs=700\u0026oewis=1\u0026oputc=1\u0026ofpcc=1\u0026msp=1\u0026odepv=1\u0026id=ff74db66d43ef6b8\u0026ip=1.208.108.242\u0026initcwndbps=4325000\u0026mt=1768293662\u0026oweuc="}}}}}}}]}}},"accessibilityText":"현재 재생목록에 추가","style":"BUTTON_VIEW_MODEL_STYLE_OVERLAY_DARK","trackingParams":"CIQCEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvx","type":"BUTTON_VIEW_MODEL_TYPE_TONAL","buttonSize":"BUTTON_VIEW_MODEL_SIZE_COMPACT","state":"BUTTON_VIEW_MODEL_STATE_ACTIVE"}},"toggledButtonViewModel":{"buttonViewModel":{"iconName":"CHECK","accessibilityText":"추가됨","style":"BUTTON_VIEW_MODEL_STYLE_OVERLAY_DARK","trackingParams":"CIMCEPBbIhMI7KL-9pCIkgMVX2HrCB1fDhvx","type":"BUTTON_VIEW_MODEL_TYPE_TONAL","buttonSize":"BUTTON_VIEW_MODEL_SIZE_COMPACT","state":"BUTTON_VIEW_MODEL_STATE_ACTIVE"}},"isToggled":false,"trackingParams":"CP4BENTEDBgBIhMI7KL-9pCIkgMVX2HrCB1fDhvx"}}]}}]}},"metadata":{"lockupMetadataViewModel":{"title":{"content":"TanStack Start"},"image":{"decoratedAvatarViewModel":{"avatar":{"avatarViewModel":{"image":{"sources":[{"url":"https://yt3.ggpht.com/uWYRwTF365L_lSs_3372-KSTENlGKJ6_T2enkHjewwy_mL7-AVDgFxm_8kRLdD5mHI6ga2Y1wzQ=s68-c-k-c0x00ffffff-no-rj","width":68,"height":68}]},"avatarImageSize":"AVATAR_SIZE_M"}},"a11yLabel":"React Conf 채널로 이동","rendererContext":{"commandContext":{"onTap":{"innertubeCommand":{"clickTrackingParams":"CP4BENTEDBgBIhMI7KL-9pCIkgMVX2HrCB1fDhvxygEEuCDk5w==","commandMetadata":{"webCommandMetadata":{"url":"/@ReactConfOfficial","webPageType":"WEB_PAGE_TYPE_CHANNEL","rootVe":3611,"apiUrl":"/youtubei/v1/browse"}},"browseEndpoint":{"browseId":"UC1hOCRBN2mnXgN5reSoO3pQ","canonicalBaseUrl":"/@ReactConfOfficial"}}}}}}} | 2026-01-13T08:48:43 |
https://www.pocketgamer.com/best-games/best-upcoming-mobile-games/ | Best upcoming mobile games in 2025 | Pocket Gamer Our Network Arrow Down PocketGamer.com AppSpy.com 148Apps.com PocketGamer.fr PocketGamer.biz PCGamesInsider.biz The Sims News PocketGamer.fun BlockchainGamer.biz PG Connects BigIndiePitch.com MobileGamesAwards.com U.GG Icy Veins The Sims Resource Fantasy Football Scout GameKnot Addicting Games Arcade Cloud EV.IO Menu PocketGamer.com Facebook X YouTube RSS Search Search Best Games Best upcoming mobile games in 2026 By Jupiter Hadley | Dec 20, 2025 iOS + Android Looking forward to Cookie Run OvenSmash, Arknights Endfield, and other new mobile games that will be released this year! Here's the complete list of upcoming games. Twitter Facebook Reddit Left Arrow 0 / 16 Right Arrow Updated on December 20th, 2025 - checked games. Are you looking for a list of upcoming mobile games? Us too. Of course, there are plenty of great games already available on mobile, so many, in fact, that you'd never be able to play every single one of them. But even so, we can't help but keep one eye on the future, because new games are always exciting. So, we decided to compile this list of the best mobile games that are set to arrive on phones at some stage. We've got everything from exciting new IPs to recognisable franchises making a jump to the mobile gaming realm. There is likely to be something for everyone, particularly if you enjoy multiplayer gaming. We've got MOBAs , battle royales , third-person action games and RPGs you'll be able to sink an unfathomable number of hours into. So, without further ado, hit that big blue button below and enjoy our list of the best upcoming mobile games. Click Here To View The List » 1 VALORANT Mobile Riot Games has confirmed that their incredibly popular FPS will be making its way over to mobile. Over 14 million players are enjoying the game on PC on a daily basis, so the demand for VALORANT Mobile was always going to be huge. If you're – somehow – unfamiliar with it, it is a 5v5 multiplayer FPS shooter set in the near future. You can select from a roster of Agents, each of which possesses distinct skills and abilities alongside numerous guns such as SMGs, shotguns and assault rifles, among others. There are several modes to choose from, though the most popular uses the traditional attack-and-defend formula. Release date: 2026 Subscribe to Pocket Gamer on 2 Rust Mobile Rust Mobile has been announced, and there's alpha footage on the internet already, following a few tests. The developer promises that the full PC experience will be carefully ported to mobile. In case you aren't familiar with it, Rust is set in a very hostile environment where you need to gather scraps, ammo, various parts and survive for as long as you can. You'll build a base and try to defend your gathered treasures, but that can be pretty rough, as no fort can't be taken down, right? Since the world is full of PVP, it's best to play with a friend or two; otherwise, you'll be easy prey for other gangs roaming around. We expect it to launch in the second or third quarter of 2025, and in the meantime, go to YouTube and check out the videos already available to see if it fits your vibe. There are thousands of hilarious videos around that will help you get to know the world of Rust a bit better. Release date: 2026 Subscribe to Pocket Gamer on 3 Neverness to Everness Neverness to Everness is another open-world RPG from the makers of Tower of Fantasy. This new project has a supernatural, urban story where you find yourself with Esper Abilities, allowing you to take on Anomalies that are within the city. You can also do some real-life things like race cars, own property, decorate your own house, and change your outfits. It's shaping up to be a neat game. Neverness to Everness currently has an open beta at the time of writing. Release date: 2026 Subscribe to Pocket Gamer on 4 The Hidden Ones The Hidden Ones is a 3D action fighting game, an adaptation of the martial arts franchise The Outcase. Along with having engaging, fast-paced combat, there are captivating stories that string you along. You can compete in the PvP experience, along with taking on the story mode, which showcases the different chapters of the mythical martial arts story. It looks fantastic and well, like a game worth keeping your eye on. Release date: TBA The Hidden Ones has a pre-alpha test ahead of the release. Subscribe to Pocket Gamer on 5 Unending Dawn Unending Dawn is an action RPG with anime aesthetics set in a medieval world, combining elements of games like Genshin Impact and Dark Souls. There are a variety of opponents, from medieval soldiers to terrifying creatures to powerful bosses. You'll be dodging, fighting and exploring your way through different environments, fighting along the way. Unending Dawn was meant to release in 2024, with pre-registration in 2023, but this was delayed. Release date: TBD Subscribe to Pocket Gamer on 6 Path of Exile Mobile Back in 2019, Grinding Gear Games announced that they were working on a mobile version of their popular dungeon-crawling RPG, Path of Exile. Unlike most of the entries on this list, Path of Exile Mobile isn't 100 per cent confirmed since the developer has previously stated that they won't release the game if it's not an enjoyable experience. But that doesn't mean we can't get excited about the concept. Carrying such a sizeable game around in our pockets is a tantalising prospect, no doubt. Much like Diablo Immortal, there will likely be several character classes to choose from, such as Marauder, Duelist, Ranger, Shadow, Witch, Templar and Scion, though none of this is confirmed just yet. You can read all we know so far, including the Path of Exile Mobile release date in case you are interested in all of the info we have so far. Release date: TBA Subscribe to Pocket Gamer on 7 Honor of Kings World Honor of Kings: World is a spin-off of the game Honor of Kings, but it isn't exactly a MOBA like the previous entry in the series. It's an open-world, action RPG with a bunch of different playable classes and characters, aiming to be something similar to Genshin Impact. The game is still multiplayer-focused, with the ability to team up with friends and explore the world. There currently isn't a set release date for Honor of Kings World, but it's predicted to be launched this year. Release date: Spring 2026 Subscribe to Pocket Gamer on 8 Arknights Endfield Arknights Endfield moves away from the tower defence formula that the original brought; it focuses on being a full blooded RPG that looks like one of the most beautiful mobile games we've ever seen. You'll take the role of Endministrator, who wakes up whenever the world is in some sort of crisis. Without diving too deep into the story and spoiling it for you, let's talk about combat instead. You'll lead a team of characters, but can only take control of one. All of the combat is done in real time, and you'll quickly get used to it. However, it requires a bit of skill, as you'll have to avoid enemy attacks and position yourself to perform a skill properly. This means that even after dozens of hours, you won't get bored with it, which is fantastic. There are also combos that trigger when a specific action is taken, depending on the characters you're using. There's also a base building that will enable you to build items or craft gear for your characters, giving you even more depth of gameplay. Release date: 2026 Subscribe to Pocket Gamer on 9 Cookie Run: OvenSmash Many of you are already familiar with the cookie games from Devsisters - an adorable endless runner or a delicious kingdom builder/RPG. Both of them have fascinated us with their gameplay and incredibly feisty cookies, but the next big player is already in the making. Cookie Run: OvenSmash is the developers' next project, and it looks like it's going to play by the meta, a MOBA. OvenSmash looks like the first 3D game with actually rendered cookies (which look as delicious as we might expect them to be, looking at you Pistachio Cookie ), and while the name is not final yet, it is all we need to spike our interest. While we wait for this tasty new smashing title to release, you can check out some of our other Cookie Run picks! We've got a list of all the latest Cookie Run: Kingdom codes , as well as all the latest Cookie Run: OvenBreak codes ! And if that's not enough, you can also stay up-to-date with the best cookies in Kingdom . Release date: March 2026 Subscribe to Pocket Gamer on 10 ANANTA Ananta looks like a massive, open-world adventure that's supposedly coming out in 2025. There hasn't been a beta to learn much information from, but with some gameplay reveal trailers, it looks like a fun title to play! Racing around a city, exploring events, and making friends with other characters... while also trying to save the city you live in from giant monsters and meteorites. It's looking super promising! Previously, it was called Project Mugen, but the devs have decided to go with Ananta. Release date: Late 2026 Subscribe to Pocket Gamer on 11 The Sims 5 / Project Rene The Sims 5, which is currently under the name Project Rene, is currently being tested on both PC and Mobile, speculating on a mobile release, though this hasn't been completely confirmed. There have been lots of releases around the game being cross-platform on Mobile and PC. This would allow cross-save and multiplayer through the various devices, bringing a lot of new ways to play. There isn't much known about The Sims 5, but I am sure that the game itself will play on a lot of the classic features of The Sims, allowing you to create your own character that lives inside the Sims world. Release date: TBA 2026 12 Assassin's Creed Codename Jade Sadly, without any release date revealed yet, another Assassin's Creed game is yet to hit the market. Assassin's Creed Codename Jade will be F2P, and with the UE5 visuals that we know and love from the previous Assassin's Creed games, we know this one will look amazing. Taking place in the Qing Dynasty in China, after the events of Odysseus and before Odyssey, you know the narrative is going to tie in nicely with all the other games. The gameplay will, of course, be different from the others (since it's on mobile), but if you love an open-world RPG, you're going to love immersing yourself in this experience. Release date: TBD Subscribe to Pocket Gamer on 13 Awaken: Astral Blade This is yet another game that promises a lot, but we don't see much just yet. It's still in fairly early stages, but so far this ARPG hack'n'slash looks like a game worth adding to your list. You are in control of a character called Loretta, who has an alien parasite inside. Because of that, she's able to harness a lot of power and use it in order to discover what actually happened in the world she lives in. It has beautiful renditions and visuals, and when it comes to the gameplay, you can probably expect some side-scrolling platformer-like action. So far so good - check out the trailer below! Release date: TBA Subscribe to Pocket Gamer on 14 Where Winds Meet Where Winds Meet is a martial arts-inspired adventure game that takes place during the fading days of the Ten Kingdoms era. It takes place in a time when dynasties rose and fell quickly, with the focus being at the end of the Southern Tang Dynasty, which was steeped in political unrest and poetic tragedy. There is a lot of open-ended storytelling with Wuxia-inspired techniques like running on water and wall walking! It's got a lot going for it. Release date: 2026 Subscribe to Pocket Gamer on 15 Demon Slayer: Battle Royale (KimeKimetsu no Yaiba: Keppu Kengeki Royal) While we're not sure yet about the actual release date, we do know that Demon Slayer: Battle Royale that it's going to be absolutely fantastic. From graphics and animations that match the ones in the manga (and anime), this game looks like a battle royale similar to Onmyoji: Arena (after all, we did get the characters in there as limited event characters). The information we have right now is from the Japanese site, so we can't tell for certain if anything will change or stay the same when a Global one rolls around. Until then, though, we'll leave you with the trailer below! Release date: TBD Subscribe to Pocket Gamer on 16 Azur Promilia Azur Promilia looks like a mix of Genshin Impact and Horizon Zero Dawn, with a Pokémon mix right in there. It has a beautiful open world with colourful characters, and a lot of action, but you're also able to capture some creatures, run a farm, and in general, it has a lot of different activities. Combat is very active, quick and flashy. You'll take control over one character, but there's a whole party with you, making things a bit easier. There isn't much info about it so far, as developers are quiet on social media, but as soon as we know more about it, we'll share it! Release date: 2026 Subscribe to Pocket Gamer on Left Arrow 0 / 16 Right Arrow Jupiter Hadley Twitter Jupiter is a prolific indie game journalist with a focus on smaller indie gems. She covers thousands of game jams and indie games on her YouTube channel, letting every game have a moment in the spotlight. She runs indiegamejams.com, a calendar of all of the game jams going on in the world, and judges many jams and events. You can find her on Twitter as @Jupiter_Hadley Next Up : Best NES Emulators for Android phones and tablets Related The best mobile games of 2026 so far (January 2026) iOS + Android Best Netflix games available right now - From Into the Breach to Red Dead Redemption iOS + Android Best free games to play on your iPhone, iPad or Android Phone in 2026 - Updated iOS + Android Top 52 best soft launch mobile games for iPhone, iPad or Android iOS + Android + Digital Board Games The best mobile games of 2025 so far (December 2025) iOS + Android Sign up! Get Pocket Gamer tips, news & features in your inbox Daily Updates Weekly Updates Your sign up will be strictly used in accordance with our Terms of Use and Privacy Policy . Get social! Facebook X YouTube RSS | 2026-01-13T08:48:43 |
https://www.pocketgamer.com/hardware-reviews/status-audio-pro-x-earbuds/ | Status Audio Pro X review - "Great sound quality and noise cancelling" | Pocket Gamer Our Network Arrow Down PocketGamer.com AppSpy.com 148Apps.com PocketGamer.fr PocketGamer.biz PCGamesInsider.biz The Sims News PocketGamer.fun BlockchainGamer.biz PG Connects BigIndiePitch.com MobileGamesAwards.com U.GG Icy Veins The Sims Resource Fantasy Football Scout GameKnot Addicting Games Arcade Cloud EV.IO Menu PocketGamer.com Facebook X YouTube RSS Search Search Hardware Reviews Status Audio Pro X review - "Great sound quality and noise cancelling" By Jupiter Hadley | Jan 2 iOS + Android By Jupiter Hadley | Jan 2 iOS + Android Twitter Facebook Reddit Absolutely fantastic sound Only OK battery life I like the design too Now, I have been reviewing and testing a variety of earbuds for quite some time. I have my favourite pair, which have gone with me everywhere, and I have yet to find a pair that has topped them. But I do think the Status Audio Pro X is a contender, just on sound quality alone. Let's start with the case and looks of the Status Audio Pro X. The case itself is simple - it's on the flatter side, with a USB-C insert to charge it. There is a small light bar in the middle of the front that lights up to give you a visual clue on whether you need to charge your earbuds. The magnetic snap is good. Each of the earbuds snaps in well. There is a strange QR code on the top of the inside of the case, which leads nowhere on my phone... in any case, it's just a very sleek and durable-feeling case. The earbuds themselves have a dual-tone, rectangular look to them, with the majority of them being matte but the very bottom being shiny and sleek. Each side has little on buttons on the top, so when you first pair them, you do need to turn both of them on individually to connect. I have since left them both "on" and put them in the case like that so that I can just take them out to use them, which seems to work fine. Now, from the moment I put in the Status Audio Pro X, I could hear the difference in sound quality. This pair of earbuds has three audio drivers per side (most earbuds only have one), so the sound just feels rich and fantastic. With the noise cancelling on them, I can literally only hear music, even when people are talking to me, my kid is playing her Switch 2 on the PC on medium volume, and someone is yelling from the next room over - and my volume is just at a medium. It's not even loud. This quality is fantastic, really. Aurvana Ace Mimi review - "Great sound control" The Status Audio Pro X doesn't have a bunch of flashy features generally, which is fine by me, as I am not a huge fan of messing with the earbuds I own. It does have an ambient noise mode, which lets sound into these earbuds without amplifying the volume, which is interesting. This is turned on through the Status Hub App, which also lets you change the touch controls and mess with some of the five equaliser presets that they have or mess with a custom mode. Funnily enough, if you lose your earbuds, you can use the app to track where they are and make them make a noise so you can hear them, which is nice if you lose things. When it comes to the battery life, I am a little let down by the Status Audio Pro X. This case charges using a USB-C cable, which is standard, but it can also be charged wirelessly if you have a wireless charger. The earbuds themselves only have 8 hours of battery life with noise-cancelling turned off, and the case only has 24 hours of charge. It's just not a ton of battery life for a pair of earbuds that I am going to forget to charge often. Status Audio Pro X review - "Great sound quality and noise cancelling" I found the Status Audio Pro X to be a comfortable pair of earbuds with fantastic sound quality that just feel good to listen to and wear. I wish that there was better battery life with them, and they are lacking some of the features that earbuds of this price point often have, though I didn't miss them much. Jupiter Hadley Twitter Jupiter is a prolific indie game journalist with a focus on smaller indie gems. She covers thousands of game jams and indie games on her YouTube channel, letting every game have a moment in the spotlight. She runs indiegamejams.com, a calendar of all of the game jams going on in the world, and judges many jams and events. You can find her on Twitter as @Jupiter_Hadley Next Up : Boox Note Max review - "Top-notch productivity and gaming without the eye strain" Related Boox Note Max review - "Top-notch productivity and gaming without the eye strain" Android Gunnar Cruz, Spider-Man Miles Morales Edition glasses review - "Made for teens, but oddly perfect for me" Gunnar Roswell Alienware Glasses review - "Futuristic statement piece" The Grinch Plush Wireless Headphones review - "They sure are comfortable" Santa Jack Skellington Cable Guys review - "Large and well themed" Sign up! Get Pocket Gamer tips, news & features in your inbox Daily Updates Weekly Updates Your sign up will be strictly used in accordance with our Terms of Use and Privacy Policy . Get social! Facebook X YouTube RSS | 2026-01-13T08:48:43 |
https://calebporzio.com/proof-of-concept-phoenix-liveview-for-laravel | Proof of Concept: Phoenix LiveView for Laravel | Caleb Porzio Caleb Porzio Posts • Creations • Talks • Tweets Proof of Concept: Phoenix LiveView for Laravel Jan 2019 I recently read through this blog post about Phoenix LiveView and got really excited for what might be possible in Laravel. I started hacking on a little proof of concept in Laravel and quickly realized this might be a game changer. Check out the following two videos for a demo of what's possible with this type of approach. If you dig the idea, hit me up on Twitter , I'd love to collaborate with folks on this project. I have a lot more thoughts and questions about this approach, but a just wanted to get something out there quickly, so expect more content on the subject soon! Note: This PoC has been formed into a full-on framework called Livewire. Get started here: https://livewire-framework.com Quick counter app Little TODO app My Newsletter I send out an email every so often about cool stuff I'm working on or launching. If you dig, go ahead and sign up! | 2026-01-13T08:48:43 |
https://calebporzio.com/build-it-for-yourself | Build it for yourself | Caleb Porzio Caleb Porzio Posts • Creations • Talks • Tweets Build it for yourself Jan 2016 One of the goals for our development team this year is to "level up" our skills. Particularly in learning new technologies like Laravel and VueJs. I am a pretty serious follower and fan of both of these technologies. I was given the green light to organize a hackathon for the team. One day, full of learning and code. So I challenged the team to build a todo list app using laravel. I added a couple of restraints and offered brownie points for building it using TDD and the interface in VueJs. The experience was fantastic and everyone learned a lot, including me. I ended up building this: A crucial shift happened along the way. At some point I realized that I could actually use this app I was building. Everything changed. As soon as I started building this todo app for me and my needs, my whole self was engaged. Pouring over lines of css, designing an interface that pleases me. Perfecting the backend with tests. I had a ton of fun. I've been using my new app hosted locally for myself ever since. Takeaway: Build things for yourself, you discover super powers. My Newsletter I send out an email every so often about cool stuff I'm working on or launching. If you dig, go ahead and sign up! | 2026-01-13T08:48:43 |
https://github.com/vjnvisakh | vjnvisakh (Visakh Vijayan) · GitHub Skip to content Navigation Menu Toggle navigation Sign in Appearance settings Platform AI CODE CREATION GitHub Copilot Write better code with AI GitHub Spark Build and deploy intelligent apps GitHub Models Manage and compare prompts MCP Registry New Integrate external tools DEVELOPER WORKFLOWS Actions Automate any workflow Codespaces Instant dev environments Issues Plan and track work Code Review Manage code changes APPLICATION SECURITY GitHub Advanced Security Find and fix vulnerabilities Code security Secure your code as you build Secret protection Stop leaks before they start EXPLORE Why GitHub Documentation Blog Changelog Marketplace View all features Solutions BY COMPANY SIZE Enterprises Small and medium teams Startups Nonprofits BY USE CASE App Modernization DevSecOps DevOps CI/CD View all use cases BY INDUSTRY Healthcare Financial services Manufacturing Government View all industries View all solutions Resources EXPLORE BY TOPIC AI Software Development DevOps Security View all topics EXPLORE BY TYPE Customer stories Events & webinars Ebooks & reports Business insights GitHub Skills SUPPORT & SERVICES Documentation Customer support Community forum Trust center Partners Open Source COMMUNITY GitHub Sponsors Fund open source developers PROGRAMS Security Lab Maintainer Community Accelerator Archive Program REPOSITORIES Topics Trending Collections Enterprise ENTERPRISE SOLUTIONS Enterprise platform AI-powered developer platform AVAILABLE ADD-ONS GitHub Advanced Security Enterprise-grade security features Copilot for Business Enterprise-grade AI features Premium Support Enterprise-grade 24/7 support Pricing Search or jump to... Search code, repositories, users, issues, pull requests... --> Search Clear Search syntax tips Provide feedback --> We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly --> Name Query To see all available qualifiers, see our documentation . Cancel Create saved search Sign in Sign up Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} vjnvisakh Follow Overview Repositories 16 Projects 0 Packages 0 Stars 1 More Overview Repositories Projects Packages Stars vjnvisakh Follow 💭 Fooling around with Technology Visakh Vijayan vjnvisakh 💭 Fooling around with Technology Follow Always awake. Skips food for fun. Confused most of the time. Home Kolkata, India Achievements Achievements Block or Report Block or report vjnvisakh --> Block user Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users . You must be logged in to block users. Add an optional note Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you. Block user Report abuse Contact GitHub support about this user’s behavior. Learn more about reporting abuse . Report abuse Overview Repositories 16 Projects 0 Packages 0 Stars 1 More Overview Repositories Projects Packages Stars Popular repositories Loading kumomo kumomo Public The much awaited newsletter website. PHP 1 1 cloudinary_php cloudinary_php Public Forked from cloudinary/cloudinary_php PHP extension for Cloudinary PHP hello-world hello-world Public This is used for testing purposes. kuttu kuttu Public trouble trouble Public none at all km_newsletter km_newsletter Public The newsletter project PHP Something went wrong, please refresh the page to try again. If the problem persists, check the GitHub status page or contact support . Uh oh! There was an error while loading. Please reload this page . Footer © 2026 GitHub, Inc. Footer navigation Terms Privacy Security Status Community Docs Contact Manage cookies Do not share my personal information You can’t perform that action at this time. | 2026-01-13T08:48:43 |
https://survivejs.com#content | SurviveJS Skip to content Home Search ☰ Home Books Blog Research Workshops Presentations Open source Consulting Search About me Loading... SurviveJS From an apprentice to a master of JavaScript Welcome to survivejs.com. I (Juho Vepsäläinen) have gathered material related to JavaScript since 2016. You can consider this site as a learning resource at different levels where I have gathered my learnings about the topic. Given JavaScript is a broad subject, I have divided the site as follows: In the books section you can find my larger writings about JavaScript. Currently maintenance, React ↗ , and webpack ↗ (most up to date book) are covered. The blog contains numerous of developer interviews (200+) and shorter posts about JavaScript. In the academic research section you can find my papers about the topics. I have taken care to include enough background material in my papers to keep them accessible so it is not as dry as you might think. I have gathered material related to my recent workshops at the workshops section of the site. Currently Qwik ↗ , Deno ↗ , and Web Audio ↗ are covered. Most of the content is freely available although you can support my efforts by buying books or considering some form of consulting . I work mainly around TypeScript, tooling, and web performance these days. Through my research efforts I have had to delve into the latest rendering techniques and upcoming themes like edge computing. This site has been built using Gustwind ↗ , my personal framework that is close to HTML with an API familiar to users of React. You could consider the site itself as a learning resource as I have built it using Tailwind syntax and you can copy/paste from the source easily although my custom components have been removed from the output although you can find the custom components at GitHub ↗ . Books SurviveJS – Webpack 5 In this book, I go through main features of webpack ↗ , a module bundler for JavaScript, and show how to compose your own configuration effectively. It doubles as a reference for common webpack techniques and I have included discussion considering alternatives. The book matches the current version of webpack. Read webpack book SurviveJS – Maintenance In this book co-authored with Artem Sapegin ↗ , I explore how to maintain and publish your JavaScript projects. Originally it was split off from the webpack book. The book is largely complete although I want to give it modernization pass to catch up with the latest developments in the space. Read maintenance book SurviveJS – React React book is where it all started and the webpack book was split up from this. The book is not up to date although it may be interesting to follow the book project while building it using some other technology or the latest React APIs. In other words the book could use an update and it is maintained on the site for historical purposes for now. Read React book Latest blog posts Impressions on Web Summit 2024 Impressions on Web Summit 2024 Web Summit 2024 occurred from 11 to 14.11 in Lisbon, Portugal. Despite its name, the summit does not focus on the web. … Published: 21.11.2024 state-ref - Easy to integrate state management library - Interview with Kim Jinwoo State management is one of those recurring themes in frontend development. State becomes an issue when you try to build something even a little comple… Published: 18.10.2024 KaibanJS - Open-source framework for building multi-agent AI systems - Interview with Dariel Vila Since the launch of ChatGPT, there has been a lot of interest in AI systems. The question is, how do you build your agents, for example? In this inte… Published: 11.10.2024 Workshops Qwik katas (2023) ↗ Qwik ↗ is a recent web framework that approaches web application from a different angle by eschewing the concept of hydration and replacing it with resumability. This means it provides unique benefits, such as automatic code-splitting, out of the box making it an interesting alternative for web developers that want to develop performant websites and applications out of the box. See Qwik katas ↗ Deno katas (2023) ↗ Deno ↗ is the followup project of Ryan Dahl, the original author of Node.js ↗ . In Deno, Ryan wanted to fix his perceived mistakes of Node.js and Deno could be characterized as a whole toolbox that comes with solutions for common server-side programming problems particularly in terms of tooling. See Deno katas ↗ Web Audio katas (2023) ↗ Web Audio ↗ is a powerful, yet underestimated, web API that allows you to build complex audio-based web application. In this kata, you will build a small Digital Audio Workstation (DAW) while getting acquainted with the relevant APIs and some of the history behind digital audio. See Web Audio katas ↗ Books Survivejs – Webpack 5 Survivejs – Maintenance Survivejs – React Conferences Future Frontend ↗ React Finland ↗ Feeling social? Subscribe to the mailing list ↗ Follow @survivejs on X ↗ Follow @survivejs on Bluesky ↗ Follow project on GitHub ↗ Contact me ↗ Subscribe to RSS About SurviveJS is maintained by Juho Vepsäläinen . You can find the site source at GitHub ↗ . | 2026-01-13T08:48:43 |
https://survivejs.com/ | SurviveJS Skip to content Home Search ☰ Home Books Blog Research Workshops Presentations Open source Consulting Search About me Loading... SurviveJS From an apprentice to a master of JavaScript Welcome to survivejs.com. I (Juho Vepsäläinen) have gathered material related to JavaScript since 2016. You can consider this site as a learning resource at different levels where I have gathered my learnings about the topic. Given JavaScript is a broad subject, I have divided the site as follows: In the books section you can find my larger writings about JavaScript. Currently maintenance, React ↗ , and webpack ↗ (most up to date book) are covered. The blog contains numerous of developer interviews (200+) and shorter posts about JavaScript. In the academic research section you can find my papers about the topics. I have taken care to include enough background material in my papers to keep them accessible so it is not as dry as you might think. I have gathered material related to my recent workshops at the workshops section of the site. Currently Qwik ↗ , Deno ↗ , and Web Audio ↗ are covered. Most of the content is freely available although you can support my efforts by buying books or considering some form of consulting . I work mainly around TypeScript, tooling, and web performance these days. Through my research efforts I have had to delve into the latest rendering techniques and upcoming themes like edge computing. This site has been built using Gustwind ↗ , my personal framework that is close to HTML with an API familiar to users of React. You could consider the site itself as a learning resource as I have built it using Tailwind syntax and you can copy/paste from the source easily although my custom components have been removed from the output although you can find the custom components at GitHub ↗ . Books SurviveJS – Webpack 5 In this book, I go through main features of webpack ↗ , a module bundler for JavaScript, and show how to compose your own configuration effectively. It doubles as a reference for common webpack techniques and I have included discussion considering alternatives. The book matches the current version of webpack. Read webpack book SurviveJS – Maintenance In this book co-authored with Artem Sapegin ↗ , I explore how to maintain and publish your JavaScript projects. Originally it was split off from the webpack book. The book is largely complete although I want to give it modernization pass to catch up with the latest developments in the space. Read maintenance book SurviveJS – React React book is where it all started and the webpack book was split up from this. The book is not up to date although it may be interesting to follow the book project while building it using some other technology or the latest React APIs. In other words the book could use an update and it is maintained on the site for historical purposes for now. Read React book Latest blog posts Impressions on Web Summit 2024 Impressions on Web Summit 2024 Web Summit 2024 occurred from 11 to 14.11 in Lisbon, Portugal. Despite its name, the summit does not focus on the web. … Published: 21.11.2024 state-ref - Easy to integrate state management library - Interview with Kim Jinwoo State management is one of those recurring themes in frontend development. State becomes an issue when you try to build something even a little comple… Published: 18.10.2024 KaibanJS - Open-source framework for building multi-agent AI systems - Interview with Dariel Vila Since the launch of ChatGPT, there has been a lot of interest in AI systems. The question is, how do you build your agents, for example? In this inte… Published: 11.10.2024 Workshops Qwik katas (2023) ↗ Qwik ↗ is a recent web framework that approaches web application from a different angle by eschewing the concept of hydration and replacing it with resumability. This means it provides unique benefits, such as automatic code-splitting, out of the box making it an interesting alternative for web developers that want to develop performant websites and applications out of the box. See Qwik katas ↗ Deno katas (2023) ↗ Deno ↗ is the followup project of Ryan Dahl, the original author of Node.js ↗ . In Deno, Ryan wanted to fix his perceived mistakes of Node.js and Deno could be characterized as a whole toolbox that comes with solutions for common server-side programming problems particularly in terms of tooling. See Deno katas ↗ Web Audio katas (2023) ↗ Web Audio ↗ is a powerful, yet underestimated, web API that allows you to build complex audio-based web application. In this kata, you will build a small Digital Audio Workstation (DAW) while getting acquainted with the relevant APIs and some of the history behind digital audio. See Web Audio katas ↗ Books Survivejs – Webpack 5 Survivejs – Maintenance Survivejs – React Conferences Future Frontend ↗ React Finland ↗ Feeling social? Subscribe to the mailing list ↗ Follow @survivejs on X ↗ Follow @survivejs on Bluesky ↗ Follow project on GitHub ↗ Contact me ↗ Subscribe to RSS About SurviveJS is maintained by Juho Vepsäläinen . You can find the site source at GitHub ↗ . | 2026-01-13T08:48:43 |
https://docs.python.org/ro/3/ | 3.14.2 Documentation Tema Automată Luminoasă Întunecată Download Download these documents Docs by version Python 3.15 (in development) Python 3.14 (stable) Python 3.13 (stable) Python 3.12 (security-fixes) Python 3.11 (security-fixes) Python 3.10 (security-fixes) Python 3.9 (EOL) Python 3.8 (EOL) Python 3.7 (EOL) Python 3.6 (EOL) Python 3.5 (EOL) Python 3.4 (EOL) Python 3.3 (EOL) Python 3.2 (EOL) Python 3.1 (EOL) Python 3.0 (EOL) Python 2.7 (EOL) Python 2.6 (EOL) All versions Other resources PEP Index Beginner's Guide Book List Audio/Visual Talks Python Developer’s Guide Navigație index module | Python » 3.14.2 Documentation » | Tema Automată Luminoasă Întunecată | Python 3.14.2 documentație Bine ați venit! Aceasta este documentația oficială pentru Python 3.14.2. Secțiunile documentației: Ce este nou în Python 3.14? Sau toate documentele cu "Ce este nou" de la Python 2.0 și până astăzi Un tutorial Porniți de aici: să facem cunoștință cu sintaxa și cu puterile Python-ului Referința bibliotecii Biblioteca standard și predefinitele Referința limbajului Sintaxă și elemente de limbaj Setările și utilizarea Python-ului Cum să instalăm, să configurăm și să întrebuințăm Python-ul CUM-SE-FACE-ASTA în Python Manuale detaliate privind diferite subiecte Instalarea modulelor Python Module ale unor terțe părți și PyPI.org Distribuirea modulelor Python Cum trebuie publicate modulele pentru a fi folosite de către alți oameni Extinderi și scufundări Pentru programatorii în C/C++ API-ul (IPA) C al Python-ului Referința API-ului C FAQ/IFF Întrebări frecvent formulate (și răspunsuri la ele!) Ieșiri din uz Funcționalități ieșite din uz Indecși, glosar și pagină de căutare: Indexul global al modulelor Toate modulele și bibliotecile Indexul general Toate funcțiile, clasele și termenii Glosarul Explicația termenilor Pagina de căutare Căutare în documentația de față Tabla de materii completă Lista tuturor secțiunilor și a subsecțiunilor Informații despre proiect: Cum se raportează erorile Cum se contribuie la documentație De unde se descarcă documentația Istoricul și licența Python-ului Drepturi de autor Despre această documentație Download Download these documents Docs by version Python 3.15 (in development) Python 3.14 (stable) Python 3.13 (stable) Python 3.12 (security-fixes) Python 3.11 (security-fixes) Python 3.10 (security-fixes) Python 3.9 (EOL) Python 3.8 (EOL) Python 3.7 (EOL) Python 3.6 (EOL) Python 3.5 (EOL) Python 3.4 (EOL) Python 3.3 (EOL) Python 3.2 (EOL) Python 3.1 (EOL) Python 3.0 (EOL) Python 2.7 (EOL) Python 2.6 (EOL) All versions Other resources PEP Index Beginner's Guide Book List Audio/Visual Talks Python Developer’s Guide « Navigație index module | Python » 3.14.2 Documentation » | Tema Automată Luminoasă Întunecată | © Drepturi de autor 2001 Python Software Foundation. Pagina de față este licențiată cu Versiunea 2 a Python Software Foundation License (Licența fundației Python dedicată software-ului). Exemplele, rețetele și alte fragmente de cod din documentație sunt licențiate suplimentar cu Zero Clause BSD License (Licența de clauză zero a BSD-ului). Vedeți Istoric și licență pentru mai multe informații. Python Software Foundation (PSF, Fundația Python dedicată software-ului) este o corporație non-profit. Vă rugăm să donați. Ultima modificare în ian. 13, 2026 (07:13 UTC). Ați găsit o greșeală ? Creat cu Sphinx 8.2.3. | 2026-01-13T08:48:43 |
https://www.pocketgamer.com/roblox/ | Roblox | Pocket Gamer Our Network Arrow Down PocketGamer.com AppSpy.com 148Apps.com PocketGamer.fr PocketGamer.biz PCGamesInsider.biz The Sims News PocketGamer.fun BlockchainGamer.biz PG Connects BigIndiePitch.com MobileGamesAwards.com U.GG Icy Veins The Sims Resource Fantasy Football Scout GameKnot Addicting Games Arcade Cloud EV.IO Menu PocketGamer.com Facebook X YouTube RSS Search Search Roblox Get Publisher: Roblox | Available on: iOS + Android Twitter Facebook Reddit Roblox Articles RSS Top List Best free games to play on your iPhone, iPad or Android Phone in 2026 - Updated By Stephen Gregson-Wood How To Miraculous Tower Defense codes (January 2026) By Mihail Katsoris How To Dandy's World codes (January 2026) By Cristina Mesesan How To Tennis Zero codes (January 2026) By Cristina Mesesan How To Roblox Baddies codes (January 2026) By Cristina Mesesan How To Assetto Street Racing codes (January 2026) By Cristina Mesesan Right Arrow Game Finder Browse our archive for thousands of game reviews across all mobile and handheld formats How To Grow a Garden codes (January 2026) By Cristina Mesesan How To Anime Fruit codes for January 2026 By Cristina Mesesan How To Anime Crossover Defense codes (January 2026) By Shaun Walton How To Rogue Demon codes (January 2026) By Cristina Mesesan How To Asylum Life codes (January 2026) By Cristina Mesesan How To Blue Lock Rivals codes (January 2026) By Cristina Mesesan How To Roblox Fish It! codes (January 2026) By Cristina Mesesan How To Flashpoint codes (January 2026) By Cristina Mesesan How To SpongeBob Tower Defense codes (January 2026) By Cristina Mesesan How To Anime Vanguards codes for freebies and goodies (January 2026) By Shaun Walton How To Volleyball Legends codes for January 2026 (Haikyuu Legends) By Cristina Mesesan How To Jujutsu Infinite codes (January 2026) - master your techniques By Cristina Mesesan How To Roblox: Plants Vs. Brainrots codes (January 2026) By Cristina Mesesan How To Flag Wars codes (January 2026) By Shaun Walton How To Own a Fish Pond codes (January 2026) By Cristina Mesesan How To Emergency Hamburg codes (January 2026) By Cristina Mesesan How To Anime Defenders codes (January 2026) By Jack Brassell How To Garden Tower Defense codes (January 2026) By Cristina Mesesan How To Anime Card Clash codes (January 2026) By Cristina Mesesan How To NFL Universe Football codes (January 2026) By Cristina Mesesan How To Something Evil Will Happen codes (January 2026) By Cristina Mesesan How To Roblox Dig codes active in January 2026 By Cristina Mesesan How To Anime Shadow 2 codes (January 2026) By Cristina Mesesan How To Anime Rangers X codes (January 2026) By Cristina Mesesan Next | 2026-01-13T08:48:43 |
https://docs.python.org/3/tutorial/datastructures.html#tut-loopidioms | 5. Data Structures — Python 3.14.2 documentation Theme Auto Light Dark Table of Contents 5. Data Structures 5.1. More on Lists 5.1.1. Using Lists as Stacks 5.1.2. Using Lists as Queues 5.1.3. List Comprehensions 5.1.4. Nested List Comprehensions 5.2. The del statement 5.3. Tuples and Sequences 5.4. Sets 5.5. Dictionaries 5.6. Looping Techniques 5.7. More on Conditions 5.8. Comparing Sequences and Other Types Previous topic 4. More Control Flow Tools Next topic 6. Modules This page Report a bug Show source Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 5. Data Structures | Theme Auto Light Dark | 5. Data Structures ¶ This chapter describes some things you’ve learned about already in more detail, and adds some new things as well. 5.1. More on Lists ¶ The list data type has some more methods. Here are all of the methods of list objects: list. append ( x ) Add an item to the end of the list. Similar to a[len(a):] = [x] . list. extend ( iterable ) Extend the list by appending all the items from the iterable. Similar to a[len(a):] = iterable . list. insert ( i , x ) Insert an item at a given position. The first argument is the index of the element before which to insert, so a.insert(0, x) inserts at the front of the list, and a.insert(len(a), x) is equivalent to a.append(x) . list. remove ( x ) Remove the first item from the list whose value is equal to x . It raises a ValueError if there is no such item. list. pop ( [ i ] ) Remove the item at the given position in the list, and return it. If no index is specified, a.pop() removes and returns the last item in the list. It raises an IndexError if the list is empty or the index is outside the list range. list. clear ( ) Remove all items from the list. Similar to del a[:] . list. index ( x [ , start [ , end ] ] ) Return zero-based index of the first occurrence of x in the list. Raises a ValueError if there is no such item. The optional arguments start and end are interpreted as in the slice notation and are used to limit the search to a particular subsequence of the list. The returned index is computed relative to the beginning of the full sequence rather than the start argument. list. count ( x ) Return the number of times x appears in the list. list. sort ( * , key = None , reverse = False ) Sort the items of the list in place (the arguments can be used for sort customization, see sorted() for their explanation). list. reverse ( ) Reverse the elements of the list in place. list. copy ( ) Return a shallow copy of the list. Similar to a[:] . An example that uses most of the list methods: >>> fruits = [ 'orange' , 'apple' , 'pear' , 'banana' , 'kiwi' , 'apple' , 'banana' ] >>> fruits . count ( 'apple' ) 2 >>> fruits . count ( 'tangerine' ) 0 >>> fruits . index ( 'banana' ) 3 >>> fruits . index ( 'banana' , 4 ) # Find next banana starting at position 4 6 >>> fruits . reverse () >>> fruits ['banana', 'apple', 'kiwi', 'banana', 'pear', 'apple', 'orange'] >>> fruits . append ( 'grape' ) >>> fruits ['banana', 'apple', 'kiwi', 'banana', 'pear', 'apple', 'orange', 'grape'] >>> fruits . sort () >>> fruits ['apple', 'apple', 'banana', 'banana', 'grape', 'kiwi', 'orange', 'pear'] >>> fruits . pop () 'pear' You might have noticed that methods like insert , remove or sort that only modify the list have no return value printed – they return the default None . [ 1 ] This is a design principle for all mutable data structures in Python. Another thing you might notice is that not all data can be sorted or compared. For instance, [None, 'hello', 10] doesn’t sort because integers can’t be compared to strings and None can’t be compared to other types. Also, there are some types that don’t have a defined ordering relation. For example, 3+4j < 5+7j isn’t a valid comparison. 5.1.1. Using Lists as Stacks ¶ The list methods make it very easy to use a list as a stack, where the last element added is the first element retrieved (“last-in, first-out”). To add an item to the top of the stack, use append() . To retrieve an item from the top of the stack, use pop() without an explicit index. For example: >>> stack = [ 3 , 4 , 5 ] >>> stack . append ( 6 ) >>> stack . append ( 7 ) >>> stack [3, 4, 5, 6, 7] >>> stack . pop () 7 >>> stack [3, 4, 5, 6] >>> stack . pop () 6 >>> stack . pop () 5 >>> stack [3, 4] 5.1.2. Using Lists as Queues ¶ It is also possible to use a list as a queue, where the first element added is the first element retrieved (“first-in, first-out”); however, lists are not efficient for this purpose. While appends and pops from the end of list are fast, doing inserts or pops from the beginning of a list is slow (because all of the other elements have to be shifted by one). To implement a queue, use collections.deque which was designed to have fast appends and pops from both ends. For example: >>> from collections import deque >>> queue = deque ([ "Eric" , "John" , "Michael" ]) >>> queue . append ( "Terry" ) # Terry arrives >>> queue . append ( "Graham" ) # Graham arrives >>> queue . popleft () # The first to arrive now leaves 'Eric' >>> queue . popleft () # The second to arrive now leaves 'John' >>> queue # Remaining queue in order of arrival deque(['Michael', 'Terry', 'Graham']) 5.1.3. List Comprehensions ¶ List comprehensions provide a concise way to create lists. Common applications are to make new lists where each element is the result of some operations applied to each member of another sequence or iterable, or to create a subsequence of those elements that satisfy a certain condition. For example, assume we want to create a list of squares, like: >>> squares = [] >>> for x in range ( 10 ): ... squares . append ( x ** 2 ) ... >>> squares [0, 1, 4, 9, 16, 25, 36, 49, 64, 81] Note that this creates (or overwrites) a variable named x that still exists after the loop completes. We can calculate the list of squares without any side effects using: squares = list ( map ( lambda x : x ** 2 , range ( 10 ))) or, equivalently: squares = [ x ** 2 for x in range ( 10 )] which is more concise and readable. A list comprehension consists of brackets containing an expression followed by a for clause, then zero or more for or if clauses. The result will be a new list resulting from evaluating the expression in the context of the for and if clauses which follow it. For example, this listcomp combines the elements of two lists if they are not equal: >>> [( x , y ) for x in [ 1 , 2 , 3 ] for y in [ 3 , 1 , 4 ] if x != y ] [(1, 3), (1, 4), (2, 3), (2, 1), (2, 4), (3, 1), (3, 4)] and it’s equivalent to: >>> combs = [] >>> for x in [ 1 , 2 , 3 ]: ... for y in [ 3 , 1 , 4 ]: ... if x != y : ... combs . append (( x , y )) ... >>> combs [(1, 3), (1, 4), (2, 3), (2, 1), (2, 4), (3, 1), (3, 4)] Note how the order of the for and if statements is the same in both these snippets. If the expression is a tuple (e.g. the (x, y) in the previous example), it must be parenthesized. >>> vec = [ - 4 , - 2 , 0 , 2 , 4 ] >>> # create a new list with the values doubled >>> [ x * 2 for x in vec ] [-8, -4, 0, 4, 8] >>> # filter the list to exclude negative numbers >>> [ x for x in vec if x >= 0 ] [0, 2, 4] >>> # apply a function to all the elements >>> [ abs ( x ) for x in vec ] [4, 2, 0, 2, 4] >>> # call a method on each element >>> freshfruit = [ ' banana' , ' loganberry ' , 'passion fruit ' ] >>> [ weapon . strip () for weapon in freshfruit ] ['banana', 'loganberry', 'passion fruit'] >>> # create a list of 2-tuples like (number, square) >>> [( x , x ** 2 ) for x in range ( 6 )] [(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), (5, 25)] >>> # the tuple must be parenthesized, otherwise an error is raised >>> [ x , x ** 2 for x in range ( 6 )] File "<stdin>" , line 1 [ x , x ** 2 for x in range ( 6 )] ^^^^^^^ SyntaxError : did you forget parentheses around the comprehension target? >>> # flatten a list using a listcomp with two 'for' >>> vec = [[ 1 , 2 , 3 ], [ 4 , 5 , 6 ], [ 7 , 8 , 9 ]] >>> [ num for elem in vec for num in elem ] [1, 2, 3, 4, 5, 6, 7, 8, 9] List comprehensions can contain complex expressions and nested functions: >>> from math import pi >>> [ str ( round ( pi , i )) for i in range ( 1 , 6 )] ['3.1', '3.14', '3.142', '3.1416', '3.14159'] 5.1.4. Nested List Comprehensions ¶ The initial expression in a list comprehension can be any arbitrary expression, including another list comprehension. Consider the following example of a 3x4 matrix implemented as a list of 3 lists of length 4: >>> matrix = [ ... [ 1 , 2 , 3 , 4 ], ... [ 5 , 6 , 7 , 8 ], ... [ 9 , 10 , 11 , 12 ], ... ] The following list comprehension will transpose rows and columns: >>> [[ row [ i ] for row in matrix ] for i in range ( 4 )] [[1, 5, 9], [2, 6, 10], [3, 7, 11], [4, 8, 12]] As we saw in the previous section, the inner list comprehension is evaluated in the context of the for that follows it, so this example is equivalent to: >>> transposed = [] >>> for i in range ( 4 ): ... transposed . append ([ row [ i ] for row in matrix ]) ... >>> transposed [[1, 5, 9], [2, 6, 10], [3, 7, 11], [4, 8, 12]] which, in turn, is the same as: >>> transposed = [] >>> for i in range ( 4 ): ... # the following 3 lines implement the nested listcomp ... transposed_row = [] ... for row in matrix : ... transposed_row . append ( row [ i ]) ... transposed . append ( transposed_row ) ... >>> transposed [[1, 5, 9], [2, 6, 10], [3, 7, 11], [4, 8, 12]] In the real world, you should prefer built-in functions to complex flow statements. The zip() function would do a great job for this use case: >>> list ( zip ( * matrix )) [(1, 5, 9), (2, 6, 10), (3, 7, 11), (4, 8, 12)] See Unpacking Argument Lists for details on the asterisk in this line. 5.2. The del statement ¶ There is a way to remove an item from a list given its index instead of its value: the del statement. This differs from the pop() method which returns a value. The del statement can also be used to remove slices from a list or clear the entire list (which we did earlier by assignment of an empty list to the slice). For example: >>> a = [ - 1 , 1 , 66.25 , 333 , 333 , 1234.5 ] >>> del a [ 0 ] >>> a [1, 66.25, 333, 333, 1234.5] >>> del a [ 2 : 4 ] >>> a [1, 66.25, 1234.5] >>> del a [:] >>> a [] del can also be used to delete entire variables: >>> del a Referencing the name a hereafter is an error (at least until another value is assigned to it). We’ll find other uses for del later. 5.3. Tuples and Sequences ¶ We saw that lists and strings have many common properties, such as indexing and slicing operations. They are two examples of sequence data types (see Sequence Types — list, tuple, range ). Since Python is an evolving language, other sequence data types may be added. There is also another standard sequence data type: the tuple . A tuple consists of a number of values separated by commas, for instance: >>> t = 12345 , 54321 , 'hello!' >>> t [ 0 ] 12345 >>> t (12345, 54321, 'hello!') >>> # Tuples may be nested: >>> u = t , ( 1 , 2 , 3 , 4 , 5 ) >>> u ((12345, 54321, 'hello!'), (1, 2, 3, 4, 5)) >>> # Tuples are immutable: >>> t [ 0 ] = 88888 Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : 'tuple' object does not support item assignment >>> # but they can contain mutable objects: >>> v = ([ 1 , 2 , 3 ], [ 3 , 2 , 1 ]) >>> v ([1, 2, 3], [3, 2, 1]) As you see, on output tuples are always enclosed in parentheses, so that nested tuples are interpreted correctly; they may be input with or without surrounding parentheses, although often parentheses are necessary anyway (if the tuple is part of a larger expression). It is not possible to assign to the individual items of a tuple, however it is possible to create tuples which contain mutable objects, such as lists. Though tuples may seem similar to lists, they are often used in different situations and for different purposes. Tuples are immutable , and usually contain a heterogeneous sequence of elements that are accessed via unpacking (see later in this section) or indexing (or even by attribute in the case of namedtuples ). Lists are mutable , and their elements are usually homogeneous and are accessed by iterating over the list. A special problem is the construction of tuples containing 0 or 1 items: the syntax has some extra quirks to accommodate these. Empty tuples are constructed by an empty pair of parentheses; a tuple with one item is constructed by following a value with a comma (it is not sufficient to enclose a single value in parentheses). Ugly, but effective. For example: >>> empty = () >>> singleton = 'hello' , # <-- note trailing comma >>> len ( empty ) 0 >>> len ( singleton ) 1 >>> singleton ('hello',) The statement t = 12345, 54321, 'hello!' is an example of tuple packing : the values 12345 , 54321 and 'hello!' are packed together in a tuple. The reverse operation is also possible: >>> x , y , z = t This is called, appropriately enough, sequence unpacking and works for any sequence on the right-hand side. Sequence unpacking requires that there are as many variables on the left side of the equals sign as there are elements in the sequence. Note that multiple assignment is really just a combination of tuple packing and sequence unpacking. 5.4. Sets ¶ Python also includes a data type for sets . A set is an unordered collection with no duplicate elements. Basic uses include membership testing and eliminating duplicate entries. Set objects also support mathematical operations like union, intersection, difference, and symmetric difference. Curly braces or the set() function can be used to create sets. Note: to create an empty set you have to use set() , not {} ; the latter creates an empty dictionary, a data structure that we discuss in the next section. Here is a brief demonstration: >>> basket = { 'apple' , 'orange' , 'apple' , 'pear' , 'orange' , 'banana' } >>> print ( basket ) # show that duplicates have been removed {'orange', 'banana', 'pear', 'apple'} >>> 'orange' in basket # fast membership testing True >>> 'crabgrass' in basket False >>> # Demonstrate set operations on unique letters from two words >>> >>> a = set ( 'abracadabra' ) >>> b = set ( 'alacazam' ) >>> a # unique letters in a {'a', 'r', 'b', 'c', 'd'} >>> a - b # letters in a but not in b {'r', 'd', 'b'} >>> a | b # letters in a or b or both {'a', 'c', 'r', 'd', 'b', 'm', 'z', 'l'} >>> a & b # letters in both a and b {'a', 'c'} >>> a ^ b # letters in a or b but not both {'r', 'd', 'b', 'm', 'z', 'l'} Similarly to list comprehensions , set comprehensions are also supported: >>> a = { x for x in 'abracadabra' if x not in 'abc' } >>> a {'r', 'd'} 5.5. Dictionaries ¶ Another useful data type built into Python is the dictionary (see Mapping Types — dict ). Dictionaries are sometimes found in other languages as “associative memories” or “associative arrays”. Unlike sequences, which are indexed by a range of numbers, dictionaries are indexed by keys , which can be any immutable type; strings and numbers can always be keys. Tuples can be used as keys if they contain only strings, numbers, or tuples; if a tuple contains any mutable object either directly or indirectly, it cannot be used as a key. You can’t use lists as keys, since lists can be modified in place using index assignments, slice assignments, or methods like append() and extend() . It is best to think of a dictionary as a set of key: value pairs, with the requirement that the keys are unique (within one dictionary). A pair of braces creates an empty dictionary: {} . Placing a comma-separated list of key:value pairs within the braces adds initial key:value pairs to the dictionary; this is also the way dictionaries are written on output. The main operations on a dictionary are storing a value with some key and extracting the value given the key. It is also possible to delete a key:value pair with del . If you store using a key that is already in use, the old value associated with that key is forgotten. Extracting a value for a non-existent key by subscripting ( d[key] ) raises a KeyError . To avoid getting this error when trying to access a possibly non-existent key, use the get() method instead, which returns None (or a specified default value) if the key is not in the dictionary. Performing list(d) on a dictionary returns a list of all the keys used in the dictionary, in insertion order (if you want it sorted, just use sorted(d) instead). To check whether a single key is in the dictionary, use the in keyword. Here is a small example using a dictionary: >>> tel = { 'jack' : 4098 , 'sape' : 4139 } >>> tel [ 'guido' ] = 4127 >>> tel {'jack': 4098, 'sape': 4139, 'guido': 4127} >>> tel [ 'jack' ] 4098 >>> tel [ 'irv' ] Traceback (most recent call last): File "<stdin>" , line 1 , in <module> KeyError : 'irv' >>> print ( tel . get ( 'irv' )) None >>> del tel [ 'sape' ] >>> tel [ 'irv' ] = 4127 >>> tel {'jack': 4098, 'guido': 4127, 'irv': 4127} >>> list ( tel ) ['jack', 'guido', 'irv'] >>> sorted ( tel ) ['guido', 'irv', 'jack'] >>> 'guido' in tel True >>> 'jack' not in tel False The dict() constructor builds dictionaries directly from sequences of key-value pairs: >>> dict ([( 'sape' , 4139 ), ( 'guido' , 4127 ), ( 'jack' , 4098 )]) {'sape': 4139, 'guido': 4127, 'jack': 4098} In addition, dict comprehensions can be used to create dictionaries from arbitrary key and value expressions: >>> { x : x ** 2 for x in ( 2 , 4 , 6 )} {2: 4, 4: 16, 6: 36} When the keys are simple strings, it is sometimes easier to specify pairs using keyword arguments: >>> dict ( sape = 4139 , guido = 4127 , jack = 4098 ) {'sape': 4139, 'guido': 4127, 'jack': 4098} 5.6. Looping Techniques ¶ When looping through dictionaries, the key and corresponding value can be retrieved at the same time using the items() method. >>> knights = { 'gallahad' : 'the pure' , 'robin' : 'the brave' } >>> for k , v in knights . items (): ... print ( k , v ) ... gallahad the pure robin the brave When looping through a sequence, the position index and corresponding value can be retrieved at the same time using the enumerate() function. >>> for i , v in enumerate ([ 'tic' , 'tac' , 'toe' ]): ... print ( i , v ) ... 0 tic 1 tac 2 toe To loop over two or more sequences at the same time, the entries can be paired with the zip() function. >>> questions = [ 'name' , 'quest' , 'favorite color' ] >>> answers = [ 'lancelot' , 'the holy grail' , 'blue' ] >>> for q , a in zip ( questions , answers ): ... print ( 'What is your {0} ? It is {1} .' . format ( q , a )) ... What is your name? It is lancelot. What is your quest? It is the holy grail. What is your favorite color? It is blue. To loop over a sequence in reverse, first specify the sequence in a forward direction and then call the reversed() function. >>> for i in reversed ( range ( 1 , 10 , 2 )): ... print ( i ) ... 9 7 5 3 1 To loop over a sequence in sorted order, use the sorted() function which returns a new sorted list while leaving the source unaltered. >>> basket = [ 'apple' , 'orange' , 'apple' , 'pear' , 'orange' , 'banana' ] >>> for i in sorted ( basket ): ... print ( i ) ... apple apple banana orange orange pear Using set() on a sequence eliminates duplicate elements. The use of sorted() in combination with set() over a sequence is an idiomatic way to loop over unique elements of the sequence in sorted order. >>> basket = [ 'apple' , 'orange' , 'apple' , 'pear' , 'orange' , 'banana' ] >>> for f in sorted ( set ( basket )): ... print ( f ) ... apple banana orange pear It is sometimes tempting to change a list while you are looping over it; however, it is often simpler and safer to create a new list instead. >>> import math >>> raw_data = [ 56.2 , float ( 'NaN' ), 51.7 , 55.3 , 52.5 , float ( 'NaN' ), 47.8 ] >>> filtered_data = [] >>> for value in raw_data : ... if not math . isnan ( value ): ... filtered_data . append ( value ) ... >>> filtered_data [56.2, 51.7, 55.3, 52.5, 47.8] 5.7. More on Conditions ¶ The conditions used in while and if statements can contain any operators, not just comparisons. The comparison operators in and not in are membership tests that determine whether a value is in (or not in) a container. The operators is and is not compare whether two objects are really the same object. All comparison operators have the same priority, which is lower than that of all numerical operators. Comparisons can be chained. For example, a < b == c tests whether a is less than b and moreover b equals c . Comparisons may be combined using the Boolean operators and and or , and the outcome of a comparison (or of any other Boolean expression) may be negated with not . These have lower priorities than comparison operators; between them, not has the highest priority and or the lowest, so that A and not B or C is equivalent to (A and (not B)) or C . As always, parentheses can be used to express the desired composition. The Boolean operators and and or are so-called short-circuit operators: their arguments are evaluated from left to right, and evaluation stops as soon as the outcome is determined. For example, if A and C are true but B is false, A and B and C does not evaluate the expression C . When used as a general value and not as a Boolean, the return value of a short-circuit operator is the last evaluated argument. It is possible to assign the result of a comparison or other Boolean expression to a variable. For example, >>> string1 , string2 , string3 = '' , 'Trondheim' , 'Hammer Dance' >>> non_null = string1 or string2 or string3 >>> non_null 'Trondheim' Note that in Python, unlike C, assignment inside expressions must be done explicitly with the walrus operator := . This avoids a common class of problems encountered in C programs: typing = in an expression when == was intended. 5.8. Comparing Sequences and Other Types ¶ Sequence objects typically may be compared to other objects with the same sequence type. The comparison uses lexicographical ordering: first the first two items are compared, and if they differ this determines the outcome of the comparison; if they are equal, the next two items are compared, and so on, until either sequence is exhausted. If two items to be compared are themselves sequences of the same type, the lexicographical comparison is carried out recursively. If all items of two sequences compare equal, the sequences are considered equal. If one sequence is an initial sub-sequence of the other, the shorter sequence is the smaller (lesser) one. Lexicographical ordering for strings uses the Unicode code point number to order individual characters. Some examples of comparisons between sequences of the same type: ( 1 , 2 , 3 ) < ( 1 , 2 , 4 ) [ 1 , 2 , 3 ] < [ 1 , 2 , 4 ] 'ABC' < 'C' < 'Pascal' < 'Python' ( 1 , 2 , 3 , 4 ) < ( 1 , 2 , 4 ) ( 1 , 2 ) < ( 1 , 2 , - 1 ) ( 1 , 2 , 3 ) == ( 1.0 , 2.0 , 3.0 ) ( 1 , 2 , ( 'aa' , 'ab' )) < ( 1 , 2 , ( 'abc' , 'a' ), 4 ) Note that comparing objects of different types with < or > is legal provided that the objects have appropriate comparison methods. For example, mixed numeric types are compared according to their numeric value, so 0 equals 0.0, etc. Otherwise, rather than providing an arbitrary ordering, the interpreter will raise a TypeError exception. Footnotes [ 1 ] Other languages may return the mutated object, which allows method chaining, such as d->insert("a")->remove("b")->sort(); . Table of Contents 5. Data Structures 5.1. More on Lists 5.1.1. Using Lists as Stacks 5.1.2. Using Lists as Queues 5.1.3. List Comprehensions 5.1.4. Nested List Comprehensions 5.2. The del statement 5.3. Tuples and Sequences 5.4. Sets 5.5. Dictionaries 5.6. Looping Techniques 5.7. More on Conditions 5.8. Comparing Sequences and Other Types Previous topic 4. More Control Flow Tools Next topic 6. Modules This page Report a bug Show source « Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 5. Data Structures | Theme Auto Light Dark | © Copyright 2001 Python Software Foundation. This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. See History and License for more information. The Python Software Foundation is a non-profit corporation. Please donate. Last updated on Jan 13, 2026 (06:19 UTC). Found a bug ? Created using Sphinx 8.2.3. | 2026-01-13T08:48:43 |
https://docs.python.org/3/license.html#asyncio | History and License — Python 3.14.2 documentation Theme Auto Light Dark Table of Contents History and License History of the software Terms and conditions for accessing or otherwise using Python PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION Licenses and Acknowledgements for Incorporated Software Mersenne Twister Sockets Asynchronous socket services Cookie management Execution tracing UUencode and UUdecode functions XML Remote Procedure Calls test_epoll Select kqueue SipHash24 strtod and dtoa OpenSSL expat libffi zlib cfuhash libmpdec W3C C14N test suite mimalloc asyncio Global Unbounded Sequences (GUS) Zstandard bindings Previous topic Copyright This page Report a bug Show source Navigation index modules | previous | Python » 3.14.2 Documentation » History and License | Theme Auto Light Dark | History and License ¶ History of the software ¶ Python was created in the early 1990s by Guido van Rossum at Stichting Mathematisch Centrum (CWI, see https://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 https://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, which became Zope Corporation. In 2001, the Python Software Foundation (PSF, see https://www.python.org/psf/ ) was formed, a non-profit organization created specifically to own Python-related Intellectual Property. Zope Corporation was a sponsoring member of the PSF. All Python releases are Open Source (see https://opensource.org for the Open Source Definition). Historically, most, but not all, Python releases have also been GPL-compatible; the table below summarizes the various releases. Release Derived from Year Owner GPL-compatible? (1) 0.9.0 thru 1.2 n/a 1991-1995 CWI yes 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes 1.6 1.5.2 2000 CNRI no 2.0 1.6 2000 BeOpen.com no 1.6.1 1.6 2001 CNRI yes (2) 2.1 2.0+1.6.1 2001 PSF no 2.0.1 2.0+1.6.1 2001 PSF yes 2.1.1 2.1+2.0.1 2001 PSF yes 2.1.2 2.1.1 2002 PSF yes 2.1.3 2.1.2 2002 PSF yes 2.2 and above 2.1.1 2001-now PSF yes Note GPL-compatible doesn’t mean that we’re distributing Python under the GPL. All Python licenses, unlike the GPL, let you distribute a modified version without making your changes open source. The GPL-compatible licenses make it possible to combine Python with other software that is released under the GPL; the others don’t. According to Richard Stallman, 1.6.1 is not GPL-compatible, because its license has a choice of law clause. According to CNRI, however, Stallman’s lawyer has told CNRI’s lawyer that 1.6.1 is “not incompatible” with the GPL. Thanks to the many outside volunteers who have worked under Guido’s direction to make these releases possible. Terms and conditions for accessing or otherwise using Python ¶ Python software and documentation are licensed under the Python Software Foundation License Version 2. Starting with Python 3.8.6, examples, recipes, and other code in the documentation are dual licensed under the PSF License Version 2 and the Zero-Clause BSD license . Some software incorporated into Python is under different licenses. The licenses are listed with code falling under that license. See Licenses and Acknowledgements for Incorporated Software for an incomplete list of these licenses. PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 ¶ 1. This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), and the Individual or Organization ("Licensee") accessing and otherwise using this software ("Python") in source or binary form and its associated documentation. 2. Subject to the terms and conditions of this License Agreement, PSF hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of copyright, i.e., "Copyright © 2001 Python Software Foundation; All Rights Reserved" are retained in Python alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates Python or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to Python. 4. PSF is making Python available to Licensee on an "AS IS" basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. 7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between PSF and Licensee. This License Agreement does not grant permission to use PSF trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. 8. By copying, installing or otherwise using Python, Licensee agrees to be bound by the terms and conditions of this License Agreement. BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 ¶ BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the Individual or Organization ("Licensee") accessing and otherwise using this software in source or binary form and its associated documentation ("the Software"). 2. Subject to the terms and conditions of this BeOpen Python License Agreement, BeOpen hereby grants Licensee a non-exclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use the Software alone or in any derivative version, provided, however, that the BeOpen Python License is retained in the Software, alone or in any derivative version prepared by Licensee. 3. BeOpen is making the Software available to Licensee on an "AS IS" basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 5. This License Agreement will automatically terminate upon a material breach of its terms and conditions. 6. This License Agreement shall be governed by and interpreted in all respects by the law of the State of California, excluding conflict of law provisions. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between BeOpen and Licensee. This License Agreement does not grant permission to use BeOpen trademarks or trade names in a trademark sense to endorse or promote products or services of Licensee, or any third party. As an exception, the "BeOpen Python" logos available at http://www.pythonlabs.com/logos.html may be used according to the permissions granted on that web page. 7. By copying, installing or otherwise using the software, Licensee agrees to be bound by the terms and conditions of this License Agreement. CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 ¶ 1. This LICENSE AGREEMENT is between the Corporation for National Research Initiatives, having an office at 1895 Preston White Drive, Reston, VA 20191 ("CNRI"), and the Individual or Organization ("Licensee") accessing and otherwise using Python 1.6.1 software in source or binary form and its associated documentation. 2. Subject to the terms and conditions of this License Agreement, CNRI hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python 1.6.1 alone or in any derivative version, provided, however, that CNRI's License Agreement and CNRI's notice of copyright, i.e., "Copyright © 1995-2001 Corporation for National Research Initiatives; All Rights Reserved" are retained in Python 1.6.1 alone or in any derivative version prepared by Licensee. Alternately, in lieu of CNRI's License Agreement, Licensee may substitute the following text (omitting the quotes): "Python 1.6.1 is made available subject to the terms and conditions in CNRI's License Agreement. This Agreement together with Python 1.6.1 may be located on the internet using the following unique, persistent identifier (known as a handle): 1895.22/1013. This Agreement may also be obtained from a proxy server on the internet using the following URL: http://hdl.handle.net/1895.22/1013". 3. In the event Licensee prepares a derivative work that is based on or incorporates Python 1.6.1 or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to Python 1.6.1. 4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON 1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. 7. This License Agreement shall be governed by the federal intellectual property law of the United States, including without limitation the federal copyright law, and, to the extent such U.S. federal law does not apply, by the law of the Commonwealth of Virginia, excluding Virginia's conflict of law provisions. Notwithstanding the foregoing, with regard to derivative works based on Python 1.6.1 that incorporate non-separable material that was previously distributed under the GNU General Public License (GPL), the law of the Commonwealth of Virginia shall govern this License Agreement only as to issues arising under or with respect to Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between CNRI and Licensee. This License Agreement does not grant permission to use CNRI trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. 8. By clicking on the "ACCEPT" button where indicated, or by copying, installing or otherwise using Python 1.6.1, Licensee agrees to be bound by the terms and conditions of this License Agreement. CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 ¶ Copyright © 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, The Netherlands. All rights reserved. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Stichting Mathematisch Centrum or CWI not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION ¶ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Licenses and Acknowledgements for Incorporated Software ¶ This section is an incomplete, but growing list of licenses and acknowledgements for third-party software incorporated in the Python distribution. Mersenne Twister ¶ The _random C extension underlying the random module includes code based on a download from http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html . The following are the verbatim comments from the original code: A C-program for MT19937, with initialization improved 2002/1/26. Coded by Takuji Nishimura and Makoto Matsumoto. Before using, initialize the state by using init_genrand(seed) or init_by_array(init_key, key_length). Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Any feedback is very welcome. http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) Sockets ¶ The socket module uses the functions, getaddrinfo() , and getnameinfo() , which are coded in separate source files from the WIDE Project, https://www.wide.ad.jp/ . Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Asynchronous socket services ¶ The test.support.asynchat and test.support.asyncore modules contain the following notice: Copyright 1996 by Sam Rushing All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Sam Rushing not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. SAM RUSHING DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SAM RUSHING BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Cookie management ¶ The http.cookies module contains the following notice: Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Timothy O'Malley not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Timothy O'Malley DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL Timothy O'Malley BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Execution tracing ¶ The trace module contains the following notice: portions copyright 2001, Autonomous Zones Industries, Inc., all rights... err... reserved and offered to the public under the terms of the Python 2.2 license. Author: Zooko O'Whielacronx http://zooko.com/ mailto:zooko@zooko.com Copyright 2000, Mojam Media, Inc., all rights reserved. Author: Skip Montanaro Copyright 1999, Bioreason, Inc., all rights reserved. Author: Andrew Dalke Copyright 1995-1997, Automatrix, Inc., all rights reserved. Author: Skip Montanaro Copyright 1991-1995, Stichting Mathematisch Centrum, all rights reserved. Permission to use, copy, modify, and distribute this Python software and its associated documentation for any purpose without fee is hereby granted, provided that the above copyright notice appears in all copies, and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of neither Automatrix, Bioreason or Mojam Media be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. UUencode and UUdecode functions ¶ The uu codec contains the following notice: Copyright 1994 by Lance Ellinghouse Cathedral City, California Republic, United States of America. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Lance Ellinghouse not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE CENTRUM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Modified by Jack Jansen, CWI, July 1995: - Use binascii module to do the actual line-by-line conversion between ascii and binary. This results in a 1000-fold speedup. The C version is still 5 times faster, though. - Arguments more compliant with Python standard XML Remote Procedure Calls ¶ The xmlrpc.client module contains the following notice: The XML-RPC client interface is Copyright (c) 1999-2002 by Secret Labs AB Copyright (c) 1999-2002 by Fredrik Lundh By obtaining, using, and/or copying this software and/or its associated documentation, you agree that you have read, understood, and will comply with the following terms and conditions: Permission to use, copy, modify, and distribute this software and its associated documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appears in all copies, and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Secret Labs AB or the author not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. test_epoll ¶ The test.test_epoll module contains the following notice: Copyright (c) 2001-2006 Twisted Matrix Laboratories. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Select kqueue ¶ The select module contains the following notice for the kqueue interface: Copyright (c) 2000 Doug White, 2006 James Knight, 2007 Christian Heimes All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SipHash24 ¶ The file Python/pyhash.c contains Marek Majkowski’ implementation of Dan Bernstein’s SipHash24 algorithm. It contains the following note: <MIT License> Copyright (c) 2013 Marek Majkowski <marek@popcount.org> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. </MIT License> Original location: https://github.com/majek/csiphash/ Solution inspired by code from: Samuel Neves (supercop/crypto_auth/siphash24/little) djb (supercop/crypto_auth/siphash24/little2) Jean-Philippe Aumasson (https://131002.net/siphash/siphash24.c) strtod and dtoa ¶ The file Python/dtoa.c , which supplies C functions dtoa and strtod for conversion of C doubles to and from strings, is derived from the file of the same name by David M. Gay, currently available from https://web.archive.org/web/20220517033456/http://www.netlib.org/fp/dtoa.c . The original file, as retrieved on March 16, 2009, contains the following copyright and licensing notice: /**************************************************************** * * The author of this software is David M. Gay. * * Copyright (c) 1991, 2000, 2001 by Lucent Technologies. * * Permission to use, copy, modify, and distribute this software for any * purpose without fee is hereby granted, provided that this entire notice * is included in all copies of any software which is or includes a copy * or modification of this software and in all copies of the supporting * documentation for such software. * * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * ***************************************************************/ OpenSSL ¶ The modules hashlib , posix and ssl use the OpenSSL library for added performance if made available by the operating system. Additionally, the Windows and macOS installers for Python may include a copy of the OpenSSL libraries, so we include a copy of the OpenSSL license here. For the OpenSSL 3.0 release, and later releases derived from that, the Apache License v2 applies: Apache License Version 2.0, January 2004 https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS expat ¶ The pyexpat extension is built using an included copy of the expat sources unless the build is configured --with-system-expat : Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. libffi ¶ The _ctypes C extension underlying the ctypes module is built using an included copy of the libffi sources unless the build is configured --with-system-libffi : Copyright (c) 1996-2008 Red Hat, Inc and others. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. zlib ¶ The zlib extension is built using an included copy of the zlib sources if the zlib version found on the system is too old to be used for the build: Copyright (C) 1995-2011 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Jean-loup Gailly Mark Adler jloup@gzip.org madler@alumni.caltech.edu cfuhash ¶ The implementation of the hash table used by the tracemalloc is based on the cfuhash project: Copyright (c) 2005 Don Owens All rights reserved. This code is released under the BSD license: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. libmpdec ¶ The _decimal C extension underlying the decimal module is built using an included copy of the libmpdec library unless the build is configured --with-system-libmpdec : Copyright (c) 2008-2020 Stefan Krah. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. W3C C14N test suite ¶ The C14N 2.0 test suite in the test package ( Lib/test/xmltestdata/c14n-20/ ) was retrieved from the W3C website at https://www.w3.org/TR/xml-c14n2-testcases/ and is distributed under the 3-clause BSD license: Copyright (c) 2013 W3C(R) (MIT, ERCIM, Keio, Beihang), All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of works must retain the original copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the original copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the W3C nor the names of its contributors may be used to endorse or promote products derived from this work without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. mimalloc ¶ MIT License: Copyright (c) 2018-2021 Microsoft Corporation, Daan Leijen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. asyncio ¶ Parts of the asyncio module are incorporated from uvloop 0.16 , which is distributed under the MIT license: Copyright (c) 2015-2021 MagicStack Inc. http://magic.io Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Global Unbounded Sequences (GUS) ¶ The file Python/qsbr.c is adapted from FreeBSD’s “Global Unbounded Sequences” safe memory reclamation scheme in subr_smr.c . The file is distributed under the 2-Clause BSD License: Copyright (c) 2019,2020 Jeffrey Roberson <jeff@FreeBSD.org> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following con | 2026-01-13T08:48:43 |
https://calebporzio.com/i-just-hit-dollar-100000yr-on-github-sponsors-heres-how-i-did-it | I Just Hit $100k/yr On GitHub Sponsors! 🎉❤️ (How I Did It) | Caleb Porzio Caleb Porzio Posts • Creations • Talks • Tweets I Just Hit $100k/yr On GitHub Sponsors! 🎉❤️ (How I Did It) Jun 2020 I have a story to tell. My last year as a full-time developer (at Tighten ) was 2018. (Read “On Leaving My Day Job” for that story) My income for that year was ~$90k: Developer salaries vary like crazy, but $90k was pretty solid for me. Combined with my wife’s income and some Mustachianism it was plenty to save up a chunk of cash for a rainy day. (Or for a few months of working un-paid on open source lol - SPOILER ALERT 😬) After needing a change of scenery, I left Tighten on January 11th, 2019 to go on a “sabbatical” (fancy word for “take a break and do whatever the hell I want“ 😛) and then start freelancing or something after a couple of months. 4 days into my Sabbatical, I read this post and hastily made a proof of concept for Laravel . This day marked the abrupt end of my sabbatical. I was completely enamored with the project (now called Livewire ) and couldn’t stop working on it full-time. (I’ve never stopped. I’m STILL enamored with it full-time.) (I also created a pretty popular JS framework along the way called AlpineJS that I work on too, but that’s a story for another time…) Believe it or not, open-source software doesn’t quite pay the bills, so I took on some small code mentorship clients to stay above the water for the entire year of 2019. Here was my income for 2019 from that freelance work: I reduced my salary by ~$70k so I could pursue my passion. It seemed risky, but I knew it would only get harder to make this kind of move in life. Lots of kind folks reached out to me along the way asking how they could help support the project. Sending me messages like this: I avoided creating a Patreon for a long time because I kept picturing a world where a handful of people give me five bucks a month. Which would be nice, but never seemed worth it to me. Then I saw GitHub Sponsors . 😍 It seemed perfect. Hosted directly on GitHub and new enough that there’s some excitement around it. I was accepted into GitHub Sponsors on Dec. 12th of 2019. (Thanks for being my first sponsor, Brian! ❤️) I’ve since received ~$25k in cash from GitHub sponsors… (They match the first $5k, and they take a ZERO percent cut. You keep EVERYTHING 🙌🏻❤️) …and as of this writing, I’ve grown my annual GitHub sponsors revenue to $112,680/yr. 🎉 Wow. I am now making more money than I’ve ever made while developing open-source software for a community that I adore. Pinch me, I’m dreaming. Was it luck? there’s certainly been a lot of that. Was it fate? Let’s leave religion out of this mmkay?… Was it that the software I built was so incredibly compelling that it forced 535 people to give me at least $14/mo. to keep working on it? …I wish. It’s more than that though. There were some key things I did along the way to get here. Let me tell you all about them. Here we go! Phase 1: Good-Hearted Folks At first, GitHub Sponsors was a place to send loyal/generous followers that wanted to support the project. However saintly these people are, there aren’t that many of them compared to the number of people actually using the software (and often making money on it). Because of the nature of open-source, people are already getting the software for free, so without ADDING any value to their lives, this strategy is seriously limiting. The first section of this income graph is solely from kind folks who just wanted to pitch in. Huge thank you to all those people. Now let’s talk about that first spike. Phase 2: Sponsorware Here’s where things started to get wild. I had a cool idea for a small little Laravel package. While recording an episode of No Plans To Merge with my buddy Daniel on how to monetize it, we cooked up a novel idea called: “Sponsorware” ( Listen To Full Episode ) Here’s how Sponsorware works: Create a cool piece of software Make it exclusive to people who sponsor you until you reach a certain number of sponsors Then open source the project to the world It’s a win-win. It worked incredibly well and I increased my yearly revenue by $11k in a matter of days. I did an entire writeup on “Sponsorware” here and was interviewed about the process on this episode of The Changelog Podcast . Also, a friend of mine Nuno Maduro recently replicated the technique with his project called Pest and had similar success: This technique is fantastic, but it requires me to have a constant stream of new ideas. All of which would become projects I would have to maintain ongoing. I needed something more reasonable for the long haul. Phase 3: Sponsored Screencasts This is where the VAST majority of my sponsorships came from. The chart speaks for itself: So what’s the secret? Educational content. Building a useful piece of software is one thing. Educating people on how to use it is an entirely different thing. (A much less fun thing I might add) I try to make the docs as good as possible, but there’s always a need for more advanced content. Rather than taking on the huge task of creating an entire course or book on Livewire. I decided to go a different route. Here’s exactly what I did that took me from ~$40k to >$100k in ~3 months: I released a free set of screencasts on the basics of using Livewire: I added links to other parts of the documentation pointing people towards them so they know they’re there: A few weeks later I added a new “private” group of screencasts for GitHub sponsors only. THIS is the secret sauce 🌶️. (To make all this happen I built a Laravel app with GitHub authentication that calls on the GitHub API to verify a user’s sponsorship) Now, people watching the screencasts will naturally encounter these “private” screencasts and if they like the free ones, they will sponsor me (at $14/mo.) to get access. I release a new batch of videos every time a new feature comes out, or I decide to cover a new Livewire technique. I also provide sponsors with access to the source code for each lesson (which is hosted on a separate repo and will eventually become an entire web app written with Livewire). In terms of income, this has been the single most impactful idea I have EVER had. It raised my annual revenue by ~$80k in 90 days. It’s like magic. Now I have a constant stream of income without having to spend all my time on major course launches. I can keep building the software I love for the community I love and release new screencasts over time (which I actually enjoy doing). Nuggets I’ve Picked Up Along The Way: Make good stuff All of this works because I spent years and years honing my craft and producing software that is truly useful. I’ve poured everything I have into that work, and there are no shortcuts there. You saw earlier how I worked full-time on an open-source project for almost an entire year before seeing any returns. The work people are sponsoring for has to be quality and remain the #1 priority. Build an audience You can build the greatest tool on the internet, but it means nothing if no one’s paying attention to you. Building an audience is ESSENTIAL for any of this to work. Twitter followers and email subscribers are your most valuable asset. Again, no shortcuts here. Just hard work, and providing value to people publicly and consistently for a long time. Charge an impactful amount The biggest mistake people make with GitHub sponsors is offering too small of a first tier. If people have the option of paying $1-5/mo. instead of >$14, they will pay the lesser amount. I realized early on that if I want to really make a go of this, I’d need more than five dollar sponsorships. I started at $9 for a long time and then bumped it to $14 for the screencasts. I’ve added a $7 tier that gets no perks for kind folks that just want to say thanks but don’t need anything in return. (These people are the aforementioned Saints 🙏🏻) Pick better tier names When you are setting up your sponsorship tiers, pick names that describe the type of person the tier is suited for. For example. For a higher tier, label it something like “The Agency” or something that implies that a business should be sponsoring at a higher tier, rather than something vague like “Platinum”. This way, when people are reading the tiers they will think to themselves: “What level of usage do I fall under”, rather than: “How much money do I want to spend per month”. Don’t be afraid to talk about your sponsorships and how much you make I grew up thinking it was rude to talk about money. This is a lie. I got a ten thousand dollar raise once because a coworker told me how much they made. After I learned what they made I felt comfortable asking for that same amount. Nothing would have happened if they didn’t tell me. Transparency is health. I don’t hide what I make because I’ve benefited from others not hiding what they make. Even if it’s astronomically higher than me, I’m never bitter or entitled about it, I’m only ever excited and inspired. My hope is that others feel the same way. On top of that, if you’re excited about your GitHub sponsors revenue, others will be too! It’s not rude to be totally up-front that you rely on this money and it helps you build the software people are using and benefiting from every day. Don’t feel guilty about making a lot of money. I always remind myself that I am not a code missionary. If my sponsorship revenue climbs beyond a modest living, THAT’S OK. It’s not a non-profit. It’s OK for my income to be proportional to the value my software adds to other people’s lives. This isn’t holy work I’m doing. it’s software that businesses use to make money. They profit from it. It’s OK to profit as well. Well Wishes I hope this saga at least amuses you, and at most provides a blueprint for making your own open-source projects financially sustainable. SO many open source projects are started with enthusiasm and later abandoned. I believe, if working on those projects was financially sustainable, they would be better, grow bigger, and be maintained longer. Everyone would win. If you try any of these techniques yourself, I’d love to know about it. My DMs on Twitter are always open. If you like the work I do and want to support it, you know what to do ❤️ Much Love, Caleb My Newsletter I send out an email every so often about cool stuff I'm working on or launching. If you dig, go ahead and sign up! | 2026-01-13T08:48:43 |
https://docs.python.org/3/tutorial/interpreter.html | 2. Using the Python Interpreter — Python 3.14.2 documentation Theme Auto Light Dark Table of Contents 2. Using the Python Interpreter 2.1. Invoking the Interpreter 2.1.1. Argument Passing 2.1.2. Interactive Mode 2.2. The Interpreter and Its Environment 2.2.1. Source Code Encoding Previous topic 1. Whetting Your Appetite Next topic 3. An Informal Introduction to Python This page Report a bug Show source Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 2. Using the Python Interpreter | Theme Auto Light Dark | 2. Using the Python Interpreter ¶ 2.1. Invoking the Interpreter ¶ The Python interpreter is usually installed as /usr/local/bin/python3.14 on those machines where it is available; putting /usr/local/bin in your Unix shell’s search path makes it possible to start it by typing the command: python3.14 to the shell. [ 1 ] Since the choice of the directory where the interpreter lives is an installation option, other places are possible; check with your local Python guru or system administrator. (E.g., /usr/local/python is a popular alternative location.) On Windows machines where you have installed Python from the Microsoft Store , the python3.14 command will be available. If you have the py.exe launcher installed, you can use the py command. See Python install manager for other ways to launch Python. Typing an end-of-file character ( Control - D on Unix, Control - Z on Windows) at the primary prompt causes the interpreter to exit with a zero exit status. If that doesn’t work, you can exit the interpreter by typing the following command: quit() . The interpreter’s line-editing features include interactive editing, history substitution and code completion on systems that support the GNU Readline library. Perhaps the quickest check to see whether command line editing is supported is typing Control - P to the first Python prompt you get. If it beeps, you have command line editing; see Appendix Interactive Input Editing and History Substitution for an introduction to the keys. If nothing appears to happen, or if ^P is echoed, command line editing isn’t available; you’ll only be able to use backspace to remove characters from the current line. The interpreter operates somewhat like the Unix shell: when called with standard input connected to a tty device, it reads and executes commands interactively; when called with a file name argument or with a file as standard input, it reads and executes a script from that file. A second way of starting the interpreter is python -c command [arg] ... , which executes the statement(s) in command , analogous to the shell’s -c option. Since Python statements often contain spaces or other characters that are special to the shell, it is usually advised to quote command in its entirety. Some Python modules are also useful as scripts. These can be invoked using python -m module [arg] ... , which executes the source file for module as if you had spelled out its full name on the command line. When a script file is used, it is sometimes useful to be able to run the script and enter interactive mode afterwards. This can be done by passing -i before the script. All command line options are described in Command line and environment . 2.1.1. Argument Passing ¶ When known to the interpreter, the script name and additional arguments thereafter are turned into a list of strings and assigned to the argv variable in the sys module. You can access this list by executing import sys . The length of the list is at least one; when no script and no arguments are given, sys.argv[0] is an empty string. When the script name is given as '-' (meaning standard input), sys.argv[0] is set to '-' . When -c command is used, sys.argv[0] is set to '-c' . When -m module is used, sys.argv[0] is set to the full name of the located module. Options found after -c command or -m module are not consumed by the Python interpreter’s option processing but left in sys.argv for the command or module to handle. 2.1.2. Interactive Mode ¶ When commands are read from a tty, the interpreter is said to be in interactive mode . In this mode it prompts for the next command with the primary prompt , usually three greater-than signs ( >>> ); for continuation lines it prompts with the secondary prompt , by default three dots ( ... ). The interpreter prints a welcome message stating its version number and a copyright notice before printing the first prompt: $ python3.14 Python 3.14 (default, April 4 2024, 09:25:04) [GCC 10.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> Continuation lines are needed when entering a multi-line construct. As an example, take a look at this if statement: >>> the_world_is_flat = True >>> if the_world_is_flat : ... print ( "Be careful not to fall off!" ) ... Be careful not to fall off! For more on interactive mode, see Interactive Mode . 2.2. The Interpreter and Its Environment ¶ 2.2.1. Source Code Encoding ¶ By default, Python source files are treated as encoded in UTF-8. In that encoding, characters of most languages in the world can be used simultaneously in string literals, identifiers and comments — although the standard library only uses ASCII characters for identifiers, a convention that any portable code should follow. To display all these characters properly, your editor must recognize that the file is UTF-8, and it must use a font that supports all the characters in the file. To declare an encoding other than the default one, a special comment line should be added as the first line of the file. The syntax is as follows: # -*- coding: encoding -*- where encoding is one of the valid codecs supported by Python. For example, to declare that Windows-1252 encoding is to be used, the first line of your source code file should be: # -*- coding: cp1252 -*- One exception to the first line rule is when the source code starts with a UNIX “shebang” line . In this case, the encoding declaration should be added as the second line of the file. For example: #!/usr/bin/env python3 # -*- coding: cp1252 -*- Footnotes [ 1 ] On Unix, the Python 3.x interpreter is by default not installed with the executable named python , so that it does not conflict with a simultaneously installed Python 2.x executable. Table of Contents 2. Using the Python Interpreter 2.1. Invoking the Interpreter 2.1.1. Argument Passing 2.1.2. Interactive Mode 2.2. The Interpreter and Its Environment 2.2.1. Source Code Encoding Previous topic 1. Whetting Your Appetite Next topic 3. An Informal Introduction to Python This page Report a bug Show source « Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 2. Using the Python Interpreter | Theme Auto Light Dark | © Copyright 2001 Python Software Foundation. This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. See History and License for more information. The Python Software Foundation is a non-profit corporation. Please donate. Last updated on Jan 13, 2026 (06:19 UTC). Found a bug ? Created using Sphinx 8.2.3. | 2026-01-13T08:48:43 |
https://docs.devcycle.com/platform/feature-flags/targeting/targeting-overview | Targeting Overview | DevCycle Docs Skip to main content Home SDKs APIs Management API Bucketing API Integrations CLI / MCP Best Practices Community Blog Discord Search Sign Up Home Getting Started Essentials DevCycle Overview Key Features System Architecture Feature Hierarchy Feature Types Platform Feature Flags Features Variables and Variations Targeting Targeting Overview Audiences Custom Properties Random Variations Scheduling & Rollouts Randomize using a Custom Property EdgeDB (Stored Custom Properties) Status and Lifecycle Stale Feature Notifications Experimentation Account Management Security and Guardrails Testing and QA Extras Examples Platform Feature Flags Targeting Targeting Overview On this page Targeting Overview Targeting rules can be used to grant Features to specific user groups, incrementally roll out Features for monitoring, or create and test different Feature configurations. Already understand the targeting essentials? Be sure to check out our advanced targeting documentation which covers topics like: Audiences Custom Properties Random Variations Rollouts Self-Targeting Targeting Properties Targeting works by evaluating rules you configure against the properties of a user you've identified in a DevCycle SDK. The properties available on a user are a combination of ones that are automatically tracked by the SDK, ones that you set yourself in the SDK but are built into the platform, and custom properties that you define to extend the built-in Targeting properties. Below is a summary of the properties built-in to the platform, and how to specify them in the SDK: Property Name Purpose How to Set User ID Unique identifier for this user. Also used for distribution and rollout randomization. Set "user_id" property User Email Email associated to this user Set "email" property App Version Version of the application currently in use. Set "appVersion" property or automatically set by Mobile SDK Platform Platform type (eg. Android, Web, C# etc.) Automatically set by SDK Platform Version Platform version specific to the current platform (eg. Android OS versio) Automatically set by SDK Device Model Device model specific to the current device (eg. iPhone 12) Automatically set by Client-side SDK Country Country the user is located in. Must be a valid 2 letter ISO-3166 country code Set "country" property In addition to these built-in properties, you can specify any other property that suits your needs using the Custom Properties Feature. Here is an example of a user object being passed to an SDK with these properties set: const user = { user_id : 'user1' , email : ' [email protected] ' , country : 'CA' , customData : { isBetaUser : true , subscriptionPlan : 'premium' , } } devcycleClient . identifyUser ( user ) With properties defined and being sent from an SDK, you can now use them to create Targeting Rules in the DevCycle dashboard. Defining a Targeting Rule Targeting Rules are made up of a few different fields that will allow you define who you'd like to deliver your Feature to, when you'd like to do so, and which Variation you'd like to serve them. More details below. The Targeting Status. Targeting ON or Targeting OFF, this is what defines if the rules will be used to deliver a Variation of a Feature to users within a specific Environment. If Targeting is OFF, no users within the Environment will receive the Feature at all, regardless of the Targeting Rules set. Use this to enable or disable the Feature for an Environment. This is also best used as a killswitch to instantly disable a Feature. The Targeting Rule Name. A human-readable identifier for the Targeting Rule. This name is optional and can be used for debugging and informational purposes when understanding why certain users received certain Variations. The Rule Definition. This is the logic that defines who will receive the specified Variation of the Feature, based on various properties that you may set from the DevCycle User (e.g. User ID, User Email, Audience, Platform, etc). The many ways to create a definition are outlined below. What Users will be Served. This is what defines the Variation that a user who fulfills the rule will receive. Different rules may receive different Variations. Additionally, a random distribution for A/B testing of Variations can be set. A Rollout Schedule for the Feature. When the Schedule is set to the default (None), the Targeting Rule will be enabled once the Environment is enabled. Using Schedule, a specific date/time can be set to release your Feature at a certain time, additionally providing the option to include a Gradual or Phased Rollout of the Feature. More details can be found in Schedules and Rollouts . Example: Targeting specific users. Let's say for example there is a brand new Feature that is meant to only roll out to internal QA users for the time being. There are numerous ways to achieve this, however for this example, only known user ids or emails will be used. In this example, the users with a user ID of "john" and "victor" will receive the Variation of "Variation ON" of this Feature on the Development Environment. This type of direct user targeting is great for numerous things such as adding users to QA versions of a Feature, inviting beta users to a Feature, or simply targeting your personal user ID for development purposes. Rule Definition Definitions are created by adding a property, a comparator, and a set of values that you'd want to compare the property to. Properties can be automatically populated through DevCycle SDKs, but in most cases, will usually set by yourself on the SDK. Multiple properties can be used at once allowing for AND operations for more complex combinations of properties. Each property is typed and has its own set of comparators available to it. Those comparators are as follows: Operator Supported Types Action is string, number, boolean exact match on one of the values is not string, number, boolean exact match on none of the values contains string substring match does not contain string substring does not match starts with string substring match does not start with string substring does not match ends with string substring match does not end with string substring does not match exists string, number, boolean null check does not exist string, number, boolean null check equals, does not equal number math comparison greater than, less than number math comparison less than or equal to, greater than or equal to number math comparison info Disabling an Environment's Targeting Rules will remove all users in that Environment from the Feature, and users will receive the code defaults. Targeting Rule Evaluation Order Often during development, developers might want to create specific Targeting Rules which target only themselves as they work on a Feature and not the greater audience. Or, there may be a larger Feature with many personalized Variations which could require multiple Targeting Rules in order to accurately segment your users. In either case, this section will help you ensure that you understand the order in which Targeting Rules are evaluated when working with multiple Targeting Rules. Evaluation Order Targeting Rules are evaluated in a top-down order. A User may match the definition of multiple Targeting Rules, however, they will only receive the first Targeting Rule that they match for in the given Environment. This situation allows you to group specific users into seeing a Variation, for example: Meet our user Victor, he lives in Canada and has a @devcycle.com email address. We do not want him, or other @devcycle.com users, to see our Secret Getaway Feature. Victor has a neighbor, John that doesn’t have a @devcycle.com email address. We want all our other Canadian users to see our Secret Getaway Feature. Victor also has several friends that live in Norway, and we want to show all our users in Norway the Secret Getaway Feature. In this situation, here’s how we can set up our Targeting Rule for the Secret Getaway Feature. We define our first Targeting Rule to target users in Canada with email addresses containing @devcycle.com to NOT see the Secret Getaway Feature. Then we can add a second Targeting Rule by clicking the “Add Targeting Rule" button. Lastly, we'll update this Targeting Rule to make sure that other users in Canada (i.e. those without @devcycle.com emails) and all users in Norway (i.e. Country is Norway) DO see the Secret Getaway Feature. The above will then satisfy the requirements of the defined situation. Managing a Targeting Rule Targeting rules can be seen in the individual Feature page by selecting the relevant Environment under Users & Targeting in the Manage Feature 🚩 menu on the left hand side of the screen. From here you will be able to enable or disable the specific Targeting Rules by clicking the Targeting ON or Targeting OFF toggle. Creating a Targeting Rule tip Looking to use DevCycle to help you QA a new Feature? Be sure to check out Self-Targeting . On the Features dashboard page, select Users & Targeting from the left hand menu and choose which Environment it should apply to. If a Feature is toggled ON for an Environment, the rules defined within the Environment will be followed. Once the Targeting Rule is defined, the next step is to determine what Variation users targeted by this rule should receive. Note: The available Variations will be determined by the chosen Feature Type, however, these can be modified and more Variations can be added at any time. To choose the Variation for this targeted audience, use the "Serve" dropdown and choose the desired Variation. When the Environment is enabled, and if a user fulfills the Targeting Rule, they will then be served that Variation and its associated variable values. Updating A Targeting Rule Targeting Rules can be updated on the dashboard anytime by changing the relevant input for the Environment in question and click the Save button in the upper right-hand corner of the screen. Reordering Targeting Rules In these cases, you can very simply reorder any Targeting Rule by clicking the arrows on the side of the rule and moving it up or down. Saving this Feature will then cause the next evaluation of a variable for all users to respect the new targeting order (after the config has been updated for client-side SDKs). Copying a Targeting Rule A lot of teams use Staging Environments to not only QA Features, but to also validate a Feature Flag's targeting. For teams that do this, you want to be able to "promote" Targeting Rules as-is between Environments, so you can be confident that what was validated in Staging is what will be defined in Production. To copy a Targeting Rule, just click the Copy Targeting Rule button at the top right of the Targeting Rule you want to copy. This opens a confirmation modal where you can select the Environment you want to copy that Targeting Rule to. Once confirmed, the new Targeting Rule will be added to the Environment, with all aspects identical to the copied rule other than the name which will be appended with (Copy). Once copied you can make edits to the name or re-order the priority of rules as needed and save the Feature when you are ready. Creating an Audience from a Targeting Rule Audiences are designed to make the creation and management of Targeting Rules easier by making complex filters reusable. Sometimes Targeting Rules can get complex over time before you think to use an audience. If you find that a rule definition has gotten complex and you want to make it an Audience so it can be easily reused elsewhere you can just create an Audience right from the rule. To create an Audience, just click the Create An Audience button at the top right of the Targeting Rule in question. This opens a modal where you can confirm the details such as name, key and description. When you confirm, the new Audience will be opened in a new tab where you can edit it further, as needed. note The new Audience will not automatically replace the definition in the Targeting Rule it was created from. Deleting a Targeting Rule Select the trash can icon on the right-hand side of the relevant Environment Targeting Rules to delete the rule and click Save to apply the changes. Edit this page Last updated on Jan 9, 2026 Previous Feature Flag Reach Next Audiences Targeting Properties Defining a Targeting Rule Rule Definition Targeting Rule Evaluation Order Managing a Targeting Rule Creating a Targeting Rule Updating A Targeting Rule Copying a Targeting Rule Creating an Audience from a Targeting Rule Deleting a Targeting Rule DevCycle Dashboard Blog Privacy Policy Twitter Discord GitHub Copyright © 2026 DevCycle. All rights reserved. | 2026-01-13T08:48:43 |
https://porkbun.com/products/textla | porkbun.com | Textla Toggle navigation porkbun $0.00 (0) products Domains Transfers Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting All Web Hosting Options Easy WordPress Link In Bio Articulation Sitebuilder Cloud WordPress Shared cPanel Hosting Static Hosting Website Builder Easy PHP Email Hosting All Email Hosting Options Proton Mail Porkbun Email Free Email Forwarding Marketing Tools Textla - SMS Marketing Free WHOIS Privacy Free SSL Certificates Free URL Forwarding transfer Free WordPress SALE! .COM SALE! About --> About Who We Are Why Choose Porkbun Porkbun vs Cloudflare FAQs Resources Knowledge Base Porkbun Blog Service Status Help $0.00 (0) sign in Affordable SMS Marketing from Textla The low-cost leader in business texting. Keep your business communication professional and powerful using Textla with your domain name from Porkbun! It's the ultimate SMS marketing solution. You get an easy-to-use, personalized messaging platform backed by automation, analytics, and real human support — all at special low prices for Porkbun customers starting at just $19.00/month and $0.01 per message with no hidden fees. Textla Plans Note: Price listed is for USD. Pricing at Textla may appear different based on your selected currency. First year price applies to new paid Textla customers only. Starter Professional texting tools to get you started. $19 per user / month Billed annually as $228.00 for first year Includes: 1 user seat Bulk messaging 1-on-1 direct messaging per user Contact list segmentation Unlimited campaigns U.S.-based human support Recommended Professional Advanced messaging automation and features for growing teams. $39 unlimited users / month Billed annually as $468.00 for first year Includes: Everything in Starter Multiple team members Personalized message fields Keywords Multiple phone numbers Non-Profit Full feature suite with the best pricing for non-profits. FREE 1-year subscription Unlimited users / month $0.007 per text message for non-profits. Includes: Everything in Professional Plan Sign up with Textla today! Continue on Textla.com Why Choose Textla with Your Porkbun Domain? Textla is more than just a texting platform — it's the simplest and most effective way to reach your audience. While other providers are built for tech teams and complex CRMs, Textla gives you a clean, easy-to-use interface designed for business owners. With built-in automations, contact management, and powerful campaign tools, Textla makes sure your messages get delivered, read, and acted on — without the hassle or hidden fees. Top Features of Textla Bulk SMS Send messages to hundreds or thousands of contacts in seconds, perfect for promotions, reminders, alerts, and more. Two-Way Messaging Have real conversations with your customers. Textla lets you respond in real-time and build stronger relationships. Scheduled Campaigns Plan ahead. Schedule one-time or recurring messages and automate your entire outreach calendar. Automation Trigger messages based on keywords, time delays, or audience activity. Set it and forget it—Textla handles the rest. Textla also comes with marketing-friendly tools like: Contact segmentation Message performance analytics Built-in Zapier integrations BENEFITS OF USING TEXTLA WITH YOUR PORKBUN DOMAIN NAME The partnership between Porkbun and Textla brings you the best-in-class SMS communication platform built for ease, speed, and results. Use Textla to text your customers and drive them to your Porkbun domain in one affordable, easy-to-use platform. Effortless Setup Launch your first campaign in minutes. Textla is built to work effortlessly with Porkbun domains—no code, no hassle. Trusted Deliverability Every message is routed for speed and deliverability, ensuring your audience receives your texts reliably and on time. Noise-Free Communication SMS isn't crowded like email. With 98% open rates, your message gets seen—no spam filters, no distractions. Seamless Integrations Connect Textla to your existing business platforms using their built-in Zapier integration. Higher ROI Textla users see a massive leap in revenue and customer engagement after adding SMS marketing to their go-to-market strategy. GET STARTED WITH PORKBUN AND TEXTLA Elevate your business communication and grow your brand with Textla and Porkbun. Whether you're a small business owner, a marketer, or just someone who wants to stay connected more effectively, this is the SMS solution you've been waiting for. Note: Pricing is in USD. Features and pricing are subject to change. Sign up with Textla today! Continue on Textla.com × Modal Title Close Close × Modal Title Close porkbun Porkbun is an amazingly awesome ICANN accredited domain name registrar based out of the Pacific Northwest. We're different, we're easy, and we're affordable. Use us, you won't be sorry. If you don't use us we'll be sad, but we'll still love you. Get Pork-Puns In Your Inbox Stay in the loop on all things Porkbun by signing up for our newsletter! 21370 SW Langer Farms Parkway, Suite 142-429 Sherwood, OR 97140, US If you're looking for support, you might be able to answer your own question using our Knowledge Base . Support Hours Impacted From January 3rd to January 11th we will be holding our annual company summit which will impact live and after hours support. Our goal is to provide you with an excellent domain registration experience and support and we all appreciate your patience as the whole company works together to make Porkbun even better. Thank you. Reach our USA-Based phone support team: 1.855.PORKBUN (1.855.767.5286) 9AM - 5PM Pacific Time Other Hours: Your mileage may vary, but give it a whirl support@porkbun.com 24 / 7 Email Support Chat Support Hours Vary Your browser does not support the audio element. This plays a little Porkbun jingle. Stay up to date with Porkbun. Sign up for our cool newsletter and we'll keep you up to date with sweet deals, amazing info, and maybe even the occasional limerick or sonnet. Sign Up Products Domain Names Greatest Deals Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting Link In Bio Articulation Sitebuilder Cloud WordPress cPanel Hosting Static Hosting Easy PHP Website Builder Email Hosting WHOIS Privacy DNS Management SSL Certificates Email Forwarding URL Forwarding Quick Connect Domain Transfer Affiliate Program Handshake Names Ethereum Name Service International Domain Names API Access Support Contact Us Knowledge Base Payment Options Report Abuse Tools Domain Search Domain Suggestion Generator RDAP (WHOIS) Password Generator Service Status Don't like our name? The Buniverse Your IP Address Online DNS Lookup Our Company About Us Our Official Blog Careers Branding Guidelines Policies and Legal Privacy Policy Data Disclosure Policy Bug Bounty Program Porkbun Merchandise Awesomeness Copyright © Porkbun LLC. All rights reserved. Porkbun is a Top Level Design Company Made in the USA 🇺🇸 This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. WARNING: This site has been known to cause a mind blowing experience. We recommend you prepare yourself mentally and if possible be sitting down. Side effects may include saving money, letting out a chuckle, and sporadic oinking. 1 × Modal Title Cancel Continue | 2026-01-13T08:48:43 |
https://calebporzio.com/6-annoying-things-in-vs-code-you-can-fix-right-now | 5 Annoying Things In VS Code You Can Fix Right Now | Caleb Porzio Caleb Porzio Posts • Creations • Talks • Tweets 5 Annoying Things In VS Code You Can Fix Right Now Jul 2020 Let’s just skip the intro and get to the good stuff. Mmkay? Kay. 1) Move “Find All” To The Bottom When you hit Cmd+Shift+F VS Code’s “Find All” panel shows up. It’s a super powerful feature. It’s one of the niceties that originally drew me away from Sublime Text in the first place. WHY IN THE WORLD IS IT SCRUNCHED IN THE SIDEBAR!!??! The bottom panel thingy (where the terminal sits) is a much better place for “Search”. This actually used to be the default in VS Code, and there was a setting to customize it yourself. Now, they changed the default AND they removed the setting completely. What are we to do? Welp, turns out you can just drag it. Take a gander: There we go. One annoyance down. Four to go. 2) Better New Window Sizing This one might just be me, but when I open a new VS Code window, I expect it to be the same size as the previously opened one. Here’s what opening a new window in VS Code looks like with an existing window already opened by default: Now, admittedly, this actually looks kind of cool, but nonetheless, it would make so much more sense if VS Code just used the last known window size as a reference. To make this happen, we can add the following configuration to our settings.json file. To open settings.json , search for “settings json” in the command palette ( Cmd+Shift+P ): Now, you can add the following line: "window.newWindowDimensions": "inherit", Here’s what opening a new window will look like now: You might also prefer to keep the same dimensions, but “offset” the new window. You can do that with the following setting: "window.newWindowDimensions": "offset", Now, the new window will be “offset”: 3) Snippet Suggestions At The Top Snippets in VS Code are a powerful way to auto-fill repetitive boilerplate text. If you don’t already use them, you can read more about them here . I don’t know about you, but if I registered a trigger for a snippet, I want to see that snippet at the top of my autocomplete list. Otherwise, SNIPPETS ARE USELESS. Snippets have to be fast and easy to trigger, and out of the box THEY ARE NOT. Take the following example GIF of a console.log snippet with a trigger of con . When I type con I should be able to hit Enter and fill console.log . This is not the case: To remedy this, we can add a new setting to our settings.json file: "editor.snippetSuggestions": "top", Now, when I type con , my suggestions are more sensible: Ugh, VS Code… 4) GitHub-Style Inline Diffs I LOVE VS Code’s diff viewer. It’s a great way to get a glimpse of your changes before a commit, or easily resolve a merge conflict. However, the default diff viewer is “Side by Side”. Meaning there are two panels with two different versions of the same file open side by side: I much prefer the way GitHub renders diffs inline: We can easily achieve this in VS Code with the following setting: "diffEditor.renderSideBySide": false, Now take a look at the diff editor in VS Code: Wehoo, love it 👌🏻 5) Disable “Peek” Previews Previews panels in VS Code are the most annoying thing ever. So ugly and so useless. I don’t think I’ve ever wanted to see a tiny preview of a file instead of just viewing the file itself. The previews are always too constrained anyways. Look at this horribleness: With a few settings we can improve our world and never see those disgusting things again! "editor.gotoLocation.multipleReferences": "goto", "editor.gotoLocation.multipleDefinitions": "goto", "editor.gotoLocation.multipleDeclarations": "goto", "editor.gotoLocation.multipleImplementations": "goto", "editor.gotoLocation.multipleTypeDefinitions": "goto", Ah, there we go, now we will actually go to the file itself right away. Much better. Wrapping Up VS Code has so many powerful features. I’m a happy user of it. However, there are lots of tiny little details it gets wrong. If you dig these short little tips, I have an entire course FULL of them. In the course, we’ll completely overhaul your VS Code workflow and make you fast and efficient. Along the way we’ll also make VS Code look and behave better. Throw your email in here and get a bunch of free content emailed to you write away: My Newsletter I send out an email every so often about cool stuff I'm working on or launching. If you dig, go ahead and sign up! | 2026-01-13T08:48:43 |
https://calebporzio.com/on-designing-the-no-plans-to-merge-logo | Designing The "No Plans To Merge" Logo | Caleb Porzio Caleb Porzio Posts • Creations • Talks • Tweets Designing The "No Plans To Merge" Logo Mar 2019 Shortly after I started at Tighten , Daniel Coulbourne and I started a podcast called Twenty Percent Time . We ran it for almost two years, and had a blast. If you haven't listened to it, we have like 35 episodes or something chocked full of good dev discussion. After I left Tighten, we both wanted to keep doing the podcast, so we re-branded it (Tighten's going to do other things with TPT). The new podcast is called No Plans To Merge and we're pretty excited about it. Go check it out if you like deep/goofy developer discussion. Along with a new name, of course, comes a new logo. Designing, and agreeing upon a new logo was really hard and took a ton of time. I thought it'd be interesting to walk you through our process and why we landed where we did! The old logo We started Twenty Percent Time from scratch in I believe one single day. Daniel handled all the hosting stuff, and I banged out a logo. We ended up just going with my first attempt, lucky shot I guess: It accomplished everything we wanted it to. It conveyed that the podcast is all about development, and has a particular slant towards controversial patterns like fluency in Laravel. Unfortunately, we weren't so lucky with the new logo... The new logo Similar to the first attempt, I opened up Sketch and banged something out pretty quickly. I sent these over to Daniel to get his opinion on them. I forget which he liked best, but he didn't love any of them. And rightly so. They were too tame. Took almost no time to design and I think that showed. I just grabbed the merge icon svg from GitHub's source, wrote some words, arranged the two, and slapped it on a simple background. We also weren't sure about the red color. We were thinking the title implies rejection so red would fit, but he wasn't too keen on the look. So I sent him these: There was a difference of visions at this point. He wasn't really liking the direction, and I didn't understand why. So he sent me this: This is a logo a friend of his got done for his pickle selling business (If you've known Daniel for any time, this kind of thing is not unusual). I immediately got it. He had a vision for something less "cheap". Something that took work, vision, talent. It totally resonated with me and we immediately reached out to the illustrator to see if he'd be interested in working with us. While we were waiting to hear back I decided to try some things myself. I grabbed my tablet/pen and got to work, here's what I came up with: I developed this concept a little further and came up with this: I think crossing the merge symbols was Daniel's idea - this was totally key and I thought spoke more the tone of the podcast. I forget the exact order of things, but I recall feeling the illustration was a bit too cartoony, so I tried something more vector-looking: We both didn't really like this, lol. So I stepped away for a bit and started looking through design books I had for inspiration. I started reading Aaron Draplin's Pretty Much Everything and got inspired to take the logo in a new direction. I wanted to try something more "Industrial" and a wee-bit retro/working-class. I thought it reflected our tone of being working programmers who consider what we do a trade. In general, we try not to elevate what we do to anything beyond a trade (maybe also a craft). He liked this direction, so here was my first attempt: We both wanted something that would look good on a trucker hat, and this certainly fit that for us. It felt a bit off-balance, so he messed with it a little and so did I. Ultimately, I couldn't get it right . Here are some further attempts: I got really into Aaron Draplin during this session and really wanted to try something that felt more Field Notes y and "Thick Lines" using Futura Bold (the font Field Notes uses). I actually really dug this one and still do now. But Daniel wasn't as keen on it as I was and that's just how it goes when two people are working together. We both liked this one a bit more and thought it would make a good sticker, but it felt a little too tame (especially without the symbols being crossed). Also, it only contained the acronym "NPTM" which we both didn't love. It also kinda looks like a street sign, which is not the vibe we are after. We both started digging more into Labor Union art, like pins and patches and stuff like this: I tweaked the colors from before to be outright working-class America feeling. It was a concept we were both iffy about but intrigued by, and wanted to see: We both thought this would make a cool sticker. But the sticker had to feel cheap, none of that vinyl sticker-mule stuff all the kids are handing out these days. Something that would tear when you rip it off a lunch pale. Here's another shot at something that would go great on a steel lunch pale: Or maybe something you'd find on your electric meter. We both fealt like we weren't nailing the Industrial motif, so we decided to give the illustration another go. I spent a painstaking amount of time turning the drawing into a vector in Sketch, and got this ugly thing: We both weren't too keen on it, but I wanted to see if I could get it to a place we were both happy with. I smoothed out the lines, added a little background, and came up with this: Pretty weird colors and definitely more of a "Schoolhouse Rock" vibe, but a part of me really liked the playfulness of it. Daniel was definitely not as on-board with this design as I was. So I added a pink background and he warmed up to it: We both thought this design was a little silly and crazy, but at this point, we had tried so many things, we were kinda fine with having something a little wacky. In some weird way it was an expression of us throwing our hands up and saying "eff it, let's just run it". We both thought the background needed some texture so we went on Hero Patterns and found something we liked. Also, when I first sent him this screenshot, he liked the border created by Sketch's artboard and the filename in the top left. We both were like: "what if we designed it to look like a screenshot you just sent someone". So we did: We kinda went back and forth on whether or not to keep the border/filename joke and still don't really know which we like better. But here is the logo without it: Voila! One podcast logo delivered! Retro Here are the takeaways for me: Designing things is hard (most of the time) Designing things that two people have to both like is harder No matter how many times I've done this, I still have to tell myself not to take criticism personally or get salty about someone critiquing my work Shipped is better than perfect Working with Daniel is always fun and he reminds me of the value of collaboration constantly (thanks Buddy) So there you go, hope you liked seeing behind the curtain into how much work these things take (at least for us). If you haven't yet, go subscribe to No Plans To Merge and give it a listen! - Caleb My Newsletter I send out an email every so often about cool stuff I'm working on or launching. If you dig, go ahead and sign up! | 2026-01-13T08:48:43 |
https://calebporzio.com/sponsorware | Introducing Sponsorware: How A Small Open Source Package Increased My Salary By $11k in Two Days | Caleb Porzio Caleb Porzio Posts • Creations • Talks • Tweets Introducing Sponsorware: How A Small Open Source Package Increased My Salary By $11k in Two Days Feb 2020 After digging deep on SQLite during a pair programming session with a client/friend, I had an idea… About 45 minutes later, a proof-of-concept was tweeted it out: ( View Tweet ) Based on the number of replies containing nothing more than a single 🤯 emoji, I could tell people dug the experiment. I immediately started getting requests to share the code or publish an open-source package. At the moment, I felt like I had two options ahead of me. Publish a free, open-source package on GitHub. Somehow charge for the code. (Possibly only releasing it to people who sponsor me on GitHub) The Problem There are two problems I saw with these options. If I open source this thing, I’ll have to maintain it for free, forever. I already spend almost all my time working on open source projects like Laravel Livewire and AlpineJS and make almost nothing doing it. If I charge for it, I’ll probably not make THAT much money, and I’ll be severely limiting the package’s usage and growth. I ALSO have personally benefited so much from open source and something about putting up a pay-wall felt off to me. The Solution I talked it over with my good buddy Daniel Coulbourne on our podcast No Plans To Merge , and we (mostly he) came up with a pretty rad solution. Here’s the little snippet that started this whole thing: ( Listen To Full Episode ) After hearing me out, Daniel proposed a (brilliant) third solution: Build and release the package exclusively to people who sponsor me on GitHub, but after reaching a certain number of sponsors, make the package fully open-source and available to all. I adored the idea. It seemed like the best of both worlds. It hit all the points I wanted: Makes money (I don’t have to slave away at the keyboard for free like so many other projects I’ve started) Gives people immediate value (people could sponsor me and get access to the package right away) Doesn’t restrict future potential growth of the project and upholds the spirit of open source Two days later, “Sponsorware” was born. I wrote the first iteration of the package in one day and sent out an email and tweet the next morning. ( View Tweet ) Before the email went out, I had 23 sponsors and was making $573/mo from GitHub Sponsors. I announced I would be open-sourcing the package ( Sushi ) after I reached 75 sponsors. (decided to up it at the last minute from the original 40) By the next evening, I hit 75 sponsors and was now making $1560/mo from GitHub Sponsors 🎉! ( View Tweet ) What a ride! In two days, I increased my GitHub sponsors monthly revenue from $573 to $1560. That means, over the course of a year, I increased my earnings by $11,844! For a guy who spends most of his time programming for free, that means a whole lot. Reflecting I’m overwhelmed with gratitude towards the community. I’ve since grown to 101 sponsors and am generating $2633/mo from GitHub Sponsors (at the time of writing). Not enough to start eating avocado toast every day, but certainly enough to cover rent and groceries. (Low rent costs brought to you by Buffalo NY 🤑) Not long after, The Changelog had me on to talk about the newly coined “Sponsorware”, you can listen to the episode here . After that, WIRED magazine contacted and interviewed me for a potential article! (50/50 shot at getting published, but still pretty cool) My hope is that the word spreads and this model will provide another pathway for open source maintainers to fund their work. This way, they can keep doing what they love, and the community can continue benefiting from the work. I DEFINITELY have plans of repeating the “Sponsorware” formula very soon. Disclaimers (Your Mileage May Vary) It's worth mentioning that some stars aligned for this to happen: I already have a pretty decent following of developers that I could communicate to easily (10k Twitter Followers, and 3.4k email newsletter subscribers). The top subscription tiers include a logo in one of my project’s docs and a small amount of monthly consulting, so people who sponsored at those levels were getting more than just access to Sushi. It’s pretty rare for me to have an idea as small, yet eye-grabbing as Sushi. The Big Picture In my career as a web developer, every company and agency I’ve worked for has directly benefited from open source software, usually in a big way. A lot of times, an agency’s core business model is based on advertising proficiency in open source projects. Frameworks like Laravel and Vue have things like conference sponsorships to offer, but for someone like me with smaller projects, it’s hard to provide EXTRA value to companies and agencies on top of the work I’m already doing. It never really occurred to me as an imbalance in the force, but now working as a maintainer almost full-time, I’m face to face with the reality: It’s really effing hard to make money in open source. I went from a solid ~$90k dev salary in 2018 to a ~$40k one in 2019, and most of that is from little consulting gigs. That said, I’m very optimistic about the future. There are lots of efforts going on right now to fix the problem, projects like Open Collective , Patreon , and GitHub Sponsors to name a few. Also, media outlets seem very interested in covering stories on the topic. Here’s to a future where maintainers (even Jeb Schmidts like myself) get paid too! If you’ve seen someone attempting this model in the wild (or have even done it yourself), I’d love to hear about it. My Twitter DMs are always open! Update: There is now a dedicated GitHub repo to host the Sponsorware “recipe” and case studies: https://github.com/sponsorware/recipe Thanks for tuning in! Caleb My Newsletter I send out an email every so often about cool stuff I'm working on or launching. If you dig, go ahead and sign up! | 2026-01-13T08:48:43 |
https://porkbun.com/products/webhosting/secureStaticHosting | porkbun.com | An oddly satisfying experience. Toggle navigation porkbun $0.00 (0) products Domains Transfers Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting All Web Hosting Options Easy WordPress Link In Bio Articulation Sitebuilder Cloud WordPress Shared cPanel Hosting Static Hosting Website Builder Easy PHP Email Hosting All Email Hosting Options Proton Mail Porkbun Email Free Email Forwarding Marketing Tools Textla - SMS Marketing Free WHOIS Privacy Free SSL Certificates Free URL Forwarding transfer Free WordPress SALE! .COM SALE! About --> About Who We Are Why Choose Porkbun Porkbun vs Cloudflare FAQs Resources Knowledge Base Porkbun Blog Service Status Help $0.00 (0) sign in × Choose A Domain READ ME: If you continue, your nameservers will be updated to our defaults and any conflicting DNS records will be deleted and replaced. Cancel Submit Secure Static Hosting Don't worry, it won't zap you. If you need to host static content such as HTML, CSS, JS, etc; our blazing fast static hosting service is a perfect affordable solution for your needs. Static hosting is great for simple websites, content that changes infrequently, or custom built HTML sites. You can also connect your static hosting account to a GitHub repo for automated updates! Standard Plans Choose the plan that's right for you!. Monthly Yearly * * Save 17% with yearly That's two months FREE Most popular! Starter Monthly FREE 15 day trial then $3.00 month Find a Domain Includes: 2GB disk space 10 subdomains Pro Monthly FREE 15 day trial then $6.00 month Find a Domain Includes: 5GB disk space 20 subdomains Most popular! Starter Yearly FREE 15 day trial then $30.00 year Find a Domain Includes: 2GB disk space 10 subdomains Pro Yearly FREE 15 day trial then $60.00 year Find a Domain Includes: 5GB disk space 20 subdomains Special Offer Buy one year of hosting and get one year of domain registration free! Free domain! Starter Yearly Secure Static Hosting + Free Domain Bundle $30.00 for first year renews at $30.00 hosting + domain renewal (varies by TLD) per year Learn more Includes: FREE Domain Registration (select TLDs) 1 Year of Starter Yearly Secure Static Hosting Available domain extensions: .app, .boo, .blog, .dad, .day, .dev, .email, .esq, .foo, .info, .ing, .meme, .mov, .nexus, .page, .phd, .prof, .rsvp, .zip. Included with all paid plans Unmetered Bandwidth Free SSL certificate FTP Access Static Hosting Performance Enhancements File Browser and Editor GitHub Connect Global URL Rewrite Easily Switch Between Plans Choosing Porkbun Static Web Hosting Deploying your site is straightforward and easy with Porkbun static web hosting. Once you've built your site locally, you can upload it to your hosting account using FTP (File Transfer Protocol) credentials provided by Porkbun. Alternatively, you can use a GitHub Repository as a middle manager, which can be beneficial if you’re looking to create multiple versions of your site and may need to roll back changes in the future. Get Static Hosting Choose your static site hosting plan and get started. Choose A Plan ☝️ The Fine print: Please note that while we want you to be able to host everything you need to make your website a success, this is a shared hosting environment and resource usage must be within reason. Disk space and bandwidth is meant for files needed for your website; not for archives, personal storage, backups, unrelated files, etc. Do not host your latest and greatest crypto mining / minting scheme on our hosting platforms, chances are that it will get blocked. Caveats: * For plans that include SSH you must first pass a basic security screening before being granted access. × Modal Title Close Close × Modal Title Close porkbun Porkbun is an amazingly awesome ICANN accredited domain name registrar based out of the Pacific Northwest. We're different, we're easy, and we're affordable. Use us, you won't be sorry. If you don't use us we'll be sad, but we'll still love you. Get Pork-Puns In Your Inbox Stay in the loop on all things Porkbun by signing up for our newsletter! 21370 SW Langer Farms Parkway, Suite 142-429 Sherwood, OR 97140, US If you're looking for support, you might be able to answer your own question using our Knowledge Base . Support Hours Impacted From January 3rd to January 11th we will be holding our annual company summit which will impact live and after hours support. Our goal is to provide you with an excellent domain registration experience and support and we all appreciate your patience as the whole company works together to make Porkbun even better. Thank you. Reach our USA-Based phone support team: 1.855.PORKBUN (1.855.767.5286) 9AM - 5PM Pacific Time Other Hours: Your mileage may vary, but give it a whirl support@porkbun.com 24 / 7 Email Support Chat Support Hours Vary Your browser does not support the audio element. This plays a little Porkbun jingle. Stay up to date with Porkbun. Sign up for our cool newsletter and we'll keep you up to date with sweet deals, amazing info, and maybe even the occasional limerick or sonnet. Sign Up Products Domain Names Greatest Deals Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting Link In Bio Articulation Sitebuilder Cloud WordPress cPanel Hosting Static Hosting Easy PHP Website Builder Email Hosting WHOIS Privacy DNS Management SSL Certificates Email Forwarding URL Forwarding Quick Connect Domain Transfer Affiliate Program Handshake Names Ethereum Name Service International Domain Names API Access Support Contact Us Knowledge Base Payment Options Report Abuse Tools Domain Search Domain Suggestion Generator RDAP (WHOIS) Password Generator Service Status Don't like our name? The Buniverse Your IP Address Online DNS Lookup Our Company About Us Our Official Blog Careers Branding Guidelines Policies and Legal Privacy Policy Data Disclosure Policy Bug Bounty Program Porkbun Merchandise Awesomeness Copyright © Porkbun LLC. All rights reserved. Porkbun is a Top Level Design Company Made in the USA 🇺🇸 This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. WARNING: This site has been known to cause a mind blowing experience. We recommend you prepare yourself mentally and if possible be sitting down. Side effects may include saving money, letting out a chuckle, and sporadic oinking. 1 × Modal Title Cancel Continue | 2026-01-13T08:48:43 |
https://calebporzio.com/loading-wheel-for-ajax-data-using-vuejs | Ajax loading wheels and forgotten Promises | Caleb Porzio Caleb Porzio Posts • Creations • Talks • Tweets Ajax loading wheels and forgotten Promises Jun 2016 In the beginning... data: { beans: null }, ready: function() { this.$http.get('beans') .success(function(response) { this.beans = response; }); } <div v-if="beans"> // write a heaping pile of nested dom </div> Then I tried doing things like.... <li v-for="bean in beans"> <span v-text="bean.soup.is.da.bomb"></span> </li> and my console turned bloody red with... VM19747:1 Uncaught TypeError: Cannot read property 'soup' of null(…) so I wised up and added... v-if="bean" everywhere. Turns out this makes your html overly verbose and downright muddy, not to mention remembering to add the v-ifs every time you access nested properties. Again, I wised up... data: { loaded: false, beans: {} }, ready: function() { this.$http.get('beans') .success(function(response) { this.beans = response; this.loaded = true; }); } <div v-if="loaded"> // write a heaping pile of nested dom </div> And all was well. Until... data: { loading: true, beans: {}, lentils: {} }, ready: function() { this.$http.get('beans') .success(function(response) { this.beans = response; this.loaded = false; }); this.$http.get('lentils') .success(function(response) { this.beans = response; this.loaded = false; }); } } <div v-if="!loading"> // write a heaping pile of nested dom </div> I needed to make multiple ajax calls in the same component, and one was slower than the other. Phew, looking back can be painful. Luckily I've come a long way since then. I now am doing fancy things like writing ES6 and using stores for a lot of the data I need to fetch on page load. For demonstration purposes I will just show you the technique in a basic component setup. You can utilize this in your root instance, a component, a store, or a mixin - your preference. data() { return { ready: false, beans: {}, lentils: {} } }, ready() { Promise.all([ this.loadNetworks(), this.loadConnections() ]).then(response => { this.ready = true; }); }, methods: { loadBeans() { return this.$http.get('beans') .then(response => { this.beans = response; this.loaded = false; }); }, loadLentils() { return this.$http.get('beans') .then(response => { this.beans = response; this.loaded = false; }); } } Another thing. If you're not showing the user that something is loading - you are being bad. Stop that right now, roll your sleeves up and keep track of the state of your ajax requests - your users and your javascript will thank you. - drop the mic. My Newsletter I send out an email every so often about cool stuff I'm working on or launching. If you dig, go ahead and sign up! | 2026-01-13T08:48:43 |
https://calebporzio.com/acce | Acceptance Testing Laravel & VueJs Apps with Codeception | Caleb Porzio Caleb Porzio Posts • Creations • Talks • Tweets Acceptance Testing Laravel & VueJs Apps with Codeception Nov 2016 This tutorial is based on a fantastic tutorial by @themsaid . Laravel's testing suite is great for testing php generated views, but unfortunately it doesn't render javascript and therefore everything written in VueJs is outside the scope of Laravel's built in tests. My guess is we will see some answers to this problem in future versions of Laravel, but for now I've found that the best way to acceptance test Laravel/Vue applications is: Codeception (using selenium and a chrome driver). This tutorial covers: acceptance testing javascript-heavy apps with Codeception and Selenium setting up and tearing down a testing database with each test accessing Laravel factories, facades, and other helpers in your tests automatically authenticating users in your tests Check out this sample laravel application for more guidance: https://github.com/calebporzio/laravel-acceptance-example Installing Codeception The basics of getting up and running with Codeception are pretty simple. In your laravel app run the following commands: $ composer require "codeception/codeception:*" $ php vendor/bin/codecept bootstrap You should notice lots of new files and folders in your "tests" directory and a new codeception.yml file in your root directory. Because we are only interested in using the "Acceptance" testing features of Codeception, we can reorganize (and delete) our folder structure to look like this: tests - acceptance - _data - _output - _support - _envs - _bootstrap.php - _bootstrap.php - acceptance.suite.yml - ExampleTest.php - TestCase.php codeception.yml and modify codeception.yml to look like this: actor: Tester paths: tests: tests log: tests/acceptance/_output data: tests/acceptance/_data support: tests/acceptance/_support envs: tests/acceptance/_envs settings: ... Also, tell codeception your site url in tests/acceptance.suite.yml class_name: AcceptanceTester modules: enabled: - PhpBrowser: url: http://your-local-project.dev - \Helper\Acceptance Now you should be able to run the following and not receive errors. $ php vendor/bin/codecept run Setting Up Selenium At this point, your codeception tests will be run using "PhpBrowser" - a guzzle based, non-javascript browser, similar to Laravel / PhpUnit's Symfony DomCrawler. To be able to render javascript we need to set up Selenium. Selenium has a standalone server that needs to be running for your tests to work. The server can be manipulated in many ways, for our purposes we want to use the Chrome WebDriver for our tests. Download the following files: Selenium Standalone Server ( http://www.seleniumhq.org/download/ ) Chrome WebDriver ( https://sites.google.com/a/chromium.org/chromedriver/ ) Create a tests/acceptance/bin directory and place both files there. Then navigate to that directory and execute the following command in a separate terminal window. (rename your files or modify the command for you filenames) $ java -Dwebdriver.chrome.driver=./chromedriver -jar ./selenium-server-standalone.jar Assuming you didn't get any errors (do you have java installed?) You now should have Selenium and Chrome WebDriver installed and running on your system. Now, the last step is to tell Codeception to use Selenium in the tests/acceptance.suite.yml file: class_name: AcceptanceTester modules: enabled: - WebDriver: url: http://your-local-project.dev browser: chrome - \Helper\Acceptance Phew... your all set up! Let's keep moving... Your First Test Ok, before we get more advanced, lets get a test up and running. To do this, create a new file: tests/acceptance/ExampleCept.php <?php $I = new AcceptanceTester($scenario); $I->am('user'); // actor's role $I->wantTo('view homepage'); // feature to test $I->amOnPage('/'); $I->see('something on the page'); // replace this with something on your homepage $I->amOnPage('/'); Now run the tests $ php vendor/bin/codecept run Congratulations, you wrote an acceptance test that renders javascript. Reference the available actions here . What we have so far is great, if this is all you need then stop here. If you still want to: use model factories to seed the database set up and authenticate a user from my tests so I don't have to go through the registration / login process for every test roll back any changes to the database from the test ... then keep following along ... Using a Test Database I don't want my tests to constantly be changing my local application's database. Therefore, it would be helpful to have a totally isolated database to test from. Lets create a new testing sqlite database file: database/testing_db.sqlite Now we need a way to change the database your Laravel app uses at runtime. We are going to use cookies to detect Selenium in your middleware. We need to migrate the sqlite db and set a cookie from your test file: tests/acceptance/ExampleCept.php Note: "setCookie" must come after at least one "amOnPage" ... Artisan::call('migrate'); ... $I->amOnPage('/'); $I->setCookie('selenium_request', 'true'); ... Setup a testing database config in config/database.php ... 'testing' => [ 'driver' => 'sqlite', 'database' => database_path('testing_db.sqlite'), 'prefix' => '', ], ... Create a middleware file to detect the cookie $ php artisan make:middleware DetectSelenium Add this to it public function handle($request, Closure $next) { if (isset($_COOKIE['selenium_request']) && app()->isLocal()) { config(['database.default' => 'testing']); } return $next($request); } Now register it in app\Http\Kernel.php protected $middleware = [ \App\Http\Middleware\DetectSelenium::class, ]; Great, now your tests are using a separate database and will automatically be "rolled-back" (the database gets re-dumped every test). Using Factories The goal here is to be able to write something like this: ... $post = factory(\App\Post::class)->create(); $I->amOnPage('/posts'); $I->see($post->title); ... To do this we will need to bootstrap our Laravel app within our tests so we can access fun things like models and factories. We will leverage tests/_bootsrap.php to achieve this. Feel free to reference Laravel's public/index.php file for some context. <?php // This is global bootstrap for autoloading require 'bootstrap/autoload.php'; $app = require 'bootstrap/app.php'; $app->instance('request', new \Illuminate\Http\Request); $app->make('Illuminate\Contracts\Http\Kernel')->bootstrap(); config(['database.default' => 'testing']); Now you should be able to use factories, facades, helper functions, and any other Laravel mechanisms you're used to taking advantage of in your tests. Authenticating Users This part is pretty simple. Let's keep with the cookie method of communication to tell our app under test we want to log a specific user in. To achieve this, change your middleware from above like so: public function handle($request, Closure $next) { if (isset($_COOKIE['selenium_request']) && app()->isLocal()) { config(['database.default' => 'testing']); if (isset($_COOKIE['selenium_auth'])) { Auth::loginUsingId((int) $_COOKIE['selenium_auth']); } } return $next($request); } Now set the cookie from your test: $user = factory(\App\User::class)->create(); $I->amOnPage('/'); $I->setCookie('selenium_request', 'true'); $I->setCookie('selenium_auth', (string) $user->id); $I->amOnPage('/some/restricted/page'); You should now be able to test parts of your app that require authentication and seed your database with anything you need for the test. Warning: be careful not to degrade the value of your acceptance tests by testing too many things in isolation. The idea here is to supply you with enough to get a realistic environment up and running and test as if a user was using your app. Cleaning Things Up You probably don't want to set specific cookies and run scripts in all your test files. I recommend cracking open tests/acceptance/_support/AcceptanceTester.php and making helper functions in there. Here is what I've done for your reference: public function setUpSession() { \Artisan::call('migrate'); $this->amOnPage('/'); $this->setCookie('selenium_request', 'true'); } public function tearDownSession() { \Artisan::call('migrate:rollback'); $this->resetCookie('selenium_auth'); $this->resetCookie('selenium_request'); } public function loginUserById($id) { $this->setCookie('selenium_auth', (string) $id); } Say Thank You by starring the github repository by following @calebporzio on twitter My Newsletter I send out an email every so often about cool stuff I'm working on or launching. If you dig, go ahead and sign up! | 2026-01-13T08:48:43 |
https://docs.python.org/bn-in/3/ | 3.14.2 Documentation Theme Auto Light Dark ডাউনলোড এই ডকুমেন্টগুলো ডাউনলোড করুন সংস্করণ অনুযায়ী ডকুমেন্টেশন Python 3.15 (in development) Python 3.14 (stable) Python 3.13 (stable) Python 3.12 (security-fixes) Python 3.11 (security-fixes) Python 3.10 (security-fixes) Python 3.9 (EOL) Python 3.8 (EOL) Python 3.7 (EOL) Python 3.6 (EOL) Python 3.5 (EOL) Python 3.4 (EOL) Python 3.3 (EOL) Python 3.2 (EOL) Python 3.1 (EOL) Python 3.0 (EOL) Python 2.7 (EOL) Python 2.6 (EOL) সব সংস্করণ অন্যান্য রিসোর্স PEP Index Beginner's Guide Book List Audio/Visual Talks Python Developer’s Guide নেভিগেশন ইনডেক্স মডিউল সমূহ | Python » 3.14.2 Documentation » | Theme Auto Light Dark | Python 3.14.2 documentation স্বাগতম! এটি পাইথন 3.14.2 এর অফিসিয়াল ডকুমেন্টেশন। Documentation sections: পাইথন 3.14-এ নতুন কী আছে? অথবা পাইথন 2.0 থেকে সকল "নতুন কী আছে" ডকুমেন্ট টিউটোরিয়াল এখান থেকে শুরু করুন: পাইথনের সিনট্যাক্স ও বৈশিষ্ট্যগুলির একটি ট্যুর লাইব্রেরি রেফারেন্স স্ট্যান্ডার্ড লাইব্রেরি ও বিল্ট-ইন ভাষা রেফারেন্স সিনট্যাক্স ও ভাষার উপাদান পাইথন সেটআপ ও ব্যবহার পাইথন কীভাবে ইনস্টল, কনফিগার ও ব্যবহার করবেন পাইথন HOWTOs গভীরতর বিষয় নির্দেশিকা পাইথন মডিউল ইনস্টল করা তৃতীয় পক্ষের মডিউল ও PyPI.org পাইথন মডিউল বিতরণ অন্যদের ব্যবহারের জন্য মডিউল প্রকাশ এক্সটেনশন ও এমবেডিং For C/C++ programmers Python's C API C API reference FAQs Frequently asked questions (with answers!) Deprecations Deprecated functionality Indices, glossary, and search: গ্লোবাল মডিউল সূচি সমস্ত মডিউল ও লাইব্রেরি সাধারণ সূচি সমস্ত ফাংশন, ক্লাস এবং টার্ম শব্দকোষ টার্মের ব্যাখ্যা অনুসন্ধান পৃষ্ঠা এই ডকুমেন্টেশন অনুসন্ধান করুন সম্পূর্ণ সূচিপত্র সমস্ত বিভাগ ও উপবিভাগের তালিকা প্রকল্প সংক্রান্ত তথ্য: সমস্যা রিপোর্ট করুন ডকুমেন্টেশনে অবদান রাখুন ডকুমেন্টেশন ডাউনলোড করুন পাইথনের ইতিহাস ও লাইসেন্স কপিরাইট ডকুমেন্টেশন সম্পর্কে ডাউনলোড এই ডকুমেন্টগুলো ডাউনলোড করুন সংস্করণ অনুযায়ী ডকুমেন্টেশন Python 3.15 (in development) Python 3.14 (stable) Python 3.13 (stable) Python 3.12 (security-fixes) Python 3.11 (security-fixes) Python 3.10 (security-fixes) Python 3.9 (EOL) Python 3.8 (EOL) Python 3.7 (EOL) Python 3.6 (EOL) Python 3.5 (EOL) Python 3.4 (EOL) Python 3.3 (EOL) Python 3.2 (EOL) Python 3.1 (EOL) Python 3.0 (EOL) Python 2.7 (EOL) Python 2.6 (EOL) সব সংস্করণ অন্যান্য রিসোর্স PEP Index Beginner's Guide Book List Audio/Visual Talks Python Developer’s Guide « নেভিগেশন ইনডেক্স মডিউল সমূহ | Python » 3.14.2 Documentation » | Theme Auto Light Dark | © কপিরাইট 2001 Python Software Foundation. This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. See History and License for more information. The Python Software Foundation is a non-profit corporation. Please donate. জানু 13, 2026 (06:32 UTC) সর্বশেষ পরিবর্তন করা হয়েছে। Found a bug ? Created using Sphinx 8.2.3. | 2026-01-13T08:48:43 |
https://calebporzio.com/my-vs-code-setup-2 | My VS Code Setup | Caleb Porzio Caleb Porzio Posts • Creations • Talks • Tweets My VS Code Setup Dec 2017 Important Note: This post is an out-dated representation of my setup. I’ve since gone DEEP into the world of customizing VS Code and honing my workflow. You can find it all here I’m using VS Code as my primary editor these days and am really digging it. My setup is by no means perfect, but I've made lots of little tweaks along the way that you may benefit from. I've set up these nifty categories, so feel free to jump around and try stuff out as you go, or come back later and use it as a reference. Table of Contents My extensions Must-have settings The Zen life My look The little things Useful keybindings My extensions PHP Intelephense - The only good PHP IntelliSense package for Code out there Better PHPUnit - An easy way to run your tests from the editor - written by your’s truly ;) PHP DocBlocker - Does exactly what it’s supposed to do PHP Debug - Unlock the power of step debugging from your editor - if you came from a Sublime workflow, this is a huge level-up. Check out this post by my bud Jose to get up and running: Debugging: Configure VS Code + XDebug + PHPUnit | Tighten Vetur - Basically, this is all I’ve needed to make VS Code work well with VueJs (syntax highlighting for .vue files and probably other stuff I don’t notice but use all the time) Auto Close Tag - It’s kinda crazy that Code doesn’t do this for HTML tags by default, but this does a nice job Cobalt2 Theme Official - Wes Bos’s boss theme based on the classic Cobalt theme but with more modern colors Custom CSS and JS Loader - For those pesky situations where Code doesn’t offer a config option. Be warned, this is hacky Duplicate action - Why you can’t duplicate a file in the file explorer I don’t know… but this does it ESLint - I don’t ES Lint often… but when I do… htmltagwrap - Allows you to highlight a chunk of code and wrap it in an HTML tag. Super duper useful Settings Sync - A really nice plugin that saves all your Code settings, plugins, and keybindings to your GitHub account (via GitHub Gist) and allows you to easily load them on a new machine Sublime Text Keymap - If you’re coming from Sublime, this is a MUST vscode-icons - A nice little icon set to make your file explorer fancier Disable Ligatures - Allows you to disable ligatures under your cursor and enable/disable specific ligatures (I’m looking at you Elvis operator) Simple PHP CS Fixer - A little extension I wrote because all the other PHP CS Fixer extensions didn’t work right for me. Apparently, mine doesn’t work right for other people so ¯_(ツ)_/¯ Vim - Useful for when I decide to use VIM mode only to switch back 4 hours later. (this is a surprisingly frequent occurrence) Must-have settings Can’t live without these bad boys: IntelliSense The only IntelliSense plugin I’ve gotten to work well is PHP Intelephense. One thing that’s whacky out of the box: it puts a leading backslash after auto-complete. Disable this stat. "intelephense.completionProvider.backslashPrefix": false "php.suggest.basic": false Trim stuff on save "files.trimTrailingWhitespace": true, "files.trimFinalNewlines": true HTML autocomplete in .blade and .vue files Note: it appears VS Code does this out of the box now, but I'm keeping it here for other files you might run into. "emmet.includeLanguages": { "blade.php": "html", "vue": "html" } Syntax highlighting in non-php files "files.associations": { ".php_cs": "php", ".php_cs.dist": "php", "*.php": "php" // this is super important, otherwise intelephense will not auto-index your project. } Sensible multi-cursor trigger By default, Code ships with alt as the multi-cursor modifier. This is not ok, turn it back to Cmd before someone sees you. "editor.multiCursorModifier": "ctrlCmd" Exclude from search Note: search.exclude also instructs PHP Intelephense on what to index, so if your indexing takes too long this is the place to slim down what get’s indexed. Note: Code’s implementation of glob patterns doesn’t offer a negative match, so if you want to exclude everything in a folder except a specific file/folder, you have to do this ridiculousness shown below. "search.exclude": { "**/node_modules": true, "**/bower_components": true, // Hide everything in /public, except "index.php" "**/public/[abcdefghjklmnopqrstuvwxyz]*": true, "**/public/i[abcdefghijklmopqrstuvwxyz]*": true, // Hide everything in /vendor, except "laravel" folder. "**/vendor/[abcdefghijkmnopqrstuvwxyz]*": true, "**/vendor/l[bcdefghijklmnopqrstuvwxyz]*": true, "storage/framework/views": true } The Zen life For the minimalist developer: Better terminal toggling Code’s built-in terminal is so useful, but it takes up valuable space in your editor. By default, you can focus and hide it with this shortcut key: cmd+[backtick] . That key hurts my wrist, so I use cmd+t instead. Note: Code’s default implementation of toggling the terminal is silly. If the editor has focus, you will have to first hide, then show the terminal to get it to focus. Below is a keybinding hack you can use to make it sensible again: { "key": "cmd+t", "command": "workbench.action.terminal.toggleTerminal" }, { "key": "cmd+t", "command": "workbench.action.terminal.focus", "when": "!terminalFocus" } Better Zen mode I really like Zen mode (easy way to hide everything on the screen except your code). It’s like my panic button for in-editor clutter. Unfortunately, by default, it makes the editor full-screen (the bulky, workspace way on a mac). "zenMode.fullScreen": false Hide all the panels and junk "workbench.editor.showTabs": false, "editor.minimap.enabled": false, "editor.codeLens": false, "workbench.activityBar.visible": false Before After Clean up the code editor VS Code comes stock with all sorts of visual noise surrounding the code editing experience. Coming from sublime, this was way too cluttered for my taste. "workbench.startupEditor": "none", "editor.renderControlCharacters": false, "editor.renderIndentGuides": false, "editor.renderLineHighlight": "none", "editor.matchBrackets": false, "editor.lineNumbers": "off" Before After Hiding the title bar This is the one part of VS Code’s interface you can’t hide. Therefore, I had to resort to a “Custom CSS & JS” plugin that would allow me to inject CSS that hides this bar on load. You can find and install the plugin here. I created a css file ~/.vscode/hide-top-bar.css and pointed to it in my settings: hide-title-bar.css .editor .content .container .title { display: none !important; } VS Code settings "vscode_custom_css.imports": [ "file:///Users/calebporzio/.vscode/hide-title-bar.css" ] Before After Note: When you hide this bar you lose visibility into whether the file is dirty or not (that little white dot when a file is unsaved). You also lose the full path to the current file, which I like. Fortunately, VS Code provides settings to manually set what shows up in the top bar of the window. "window.title": "${activeEditorMedium}${separator}${rootName} ${dirty}" Cleaning up the sidebar file explorer "explorer.openEditors.visible": 0 Before After My look No, my editor didn’t wake up looking this good… Theme I’ve been a fan of Material Theme for a long time, but just recently got turned on to Wes Bos’s Cobalt2 Theme Official . For bonus points you can use the VS Code icon someone made for it here . "workbench.colorTheme": "Cobalt2", Stock Theme Cobalt2 Right sidebar If you're the “Zen” type, you probably toggle your sidebar all the time; pushing your code around every time. Do yourself a favor and embrace the stability of the right sidebar! "workbench.sideBar.location": "right" Before After Typography "workbench.fontAliasing": "antialiased", "editor.renderWhitespace": "all", "editor.fontSize": 18, "editor.lineHeight": 40, "editor.letterSpacing": 0, "editor.fontFamily": "Fira Code", "editor.suggestFontSize": 16, "editor.suggestLineHeight": 28, Before After Terminal look VS Code automatically uses your default shell. In my case, it recognizes Zsh and uses my Zsh theme. Most of the look is already taken care of, but here are some settings that aren’t. "terminal.integrated.fontSize": 15, "terminal.integrated.lineHeight": 1.5, "terminal.integrated.cursorBlinking": false, "terminal.integrated.cursorStyle": "line" Font Ligatures If you dig ligs , you're in luck! VS Code allows you to enable them in your settings: "editor.fontLigatures": true I’m a fan of ligatures, but not a fan of the weirdness that comes when you're trying to put your cursor inside them, especially on common ones like -> . Do yourself a favor, and install this extension: Disable Ligatures "disableLigatures.mode": "Cursor" The little things // When I accidentally hit copy without selecting anything and it overrides my clipboard - ugh. "editor.emptySelectionClipboard": false, // I removed the hyphen "-" from this list for better multi-cursor navigation. // @freekmurze suggested I remove "$" too for php variables - brilliant! "editor.wordSeparators": "`~!@#%^&*()=+[{]}\\|;:'\",.<>/?", // Give it to me as fast as you have it. "editor.quickSuggestionsDelay": 0, // In sublime I got used to almost exclusively using "cmd+shift+v" (format on paste) - now it will do it by default! "editor.formatOnPaste": true, // Show me whitespace in diffs, just in case some slips through, shows up in the GitHub PR, and I look like a dummy. "diffEditor.ignoreTrimWhitespace": false Useful keybindings Switching terminal tabs I’m used to the “switch tabs” shortcut keys ( alt+cmd+[left/right] ) in iTerm and Google Chrome, here’s the keybindings to bring this to VS Code’s terminal when using multiple terminals. { "key": "alt+cmd+right", "command": "workbench.action.terminal.focusNext", "when": "terminalFocus" }, { "key": "alt+cmd+left", "command": "workbench.action.terminal.focusPrevious", "when": "terminalFocus" } Zen mode I use this keybinding all the time. When things get too cluttered I panic and hit cmd+k+k . { "key": "cmd+k cmd+k", "command": "workbench.action.toggleZenMode" } Quickly access sidebar panels Because I hide the activity bar (the sidebar with icons to open file explorer, version control, etc..), I need sensible shortcuts to open those panels. Here are the ones I use to quickly access them. { "key": "cmd+k cmd+m", "command": "workbench.view.scm" }, { "key": "cmd+k cmd+e", "command": "workbench.view.explorer" }, { "key": "cmd+k cmd+d", "command": "workbench.view.debug" }, { "key": "cmd+k cmd+x", "command": "workbench.extensions.action.showInstalledExtensions" } Note: cmd+b is the stock shortcut to hide the sidebar. ( cmd+k+b with Sublime keybindings) Bring focus back to the editor If I’m in a sidebar or terminal, It’s a small annoyance to have to click the editor to get back into editing mode. This shortcut provides an easy way to focus the editor from anywhere in VS Code. { "key": "cmd+e cmd+e", "command": "workbench.action.focusActiveEditorGroup" } VS Code is an awesome editor and can adapt to PHP development pretty easily. I hope you found some fun things to try out on your own setup. Have fun coding! My Newsletter I send out an email every so often about cool stuff I'm working on or launching. If you dig, go ahead and sign up! | 2026-01-13T08:48:43 |
https://calebporzio.com/i-just-cracked-1-million-on-github-sponsors-heres-my-playbook | I just crossed $1 million on GitHub Sponsors. 💰🎉 | Caleb Porzio Caleb Porzio Posts • Creations • Talks • Tweets I just crossed $1 million on GitHub Sponsors. 💰🎉 Aug 2024 Folks, today's the day. As of this morning, I've made over a million dollars on GitHub sponsors. Wowoweewow. First, here's a quick recap of my open source journey: 5 years ago, I left my day job with no plan. 5 days later, I started working on an open source project called ( Livewire ) 1 year later I started another project: Alpine.js Within 2 years I had made a GitHub sponsors account and ramped it up to $100k/yr. Ever since I've been working on those same two projects and selling stuff along the way to fund my work on them. If you want the full scoop of the early days, read: I Just Hit $100k/yr On GitHub Sponsors! 🎉❤️ (How I Did It) Where did that milly come from exactly? Here's the back-of-a-napkin breakdown: 5k: Goodness of their hearts "buy me coffee" sponsors 5k: Sold a bunch of stickers once lol 20k: Early access to a side project called "Sushi" 25k: Hourly consulting 20k: Alpine conference (I made $0 from this though) 200k: Companies paying me to put their logos on my websites and such 725k: Livewire premium screencasts Aside: one of the reasons "companies paying me" is so high, is because of Fly.io . They reached out to me out of the blue, told me they like what I'm doing and want to support it. I sent them a sponsors link. They replied with this: I was floored. I threw a giant number on there to see what would happen, and they did it, no strings attached. One of the most gratitude-inducing experiences of my life. That company puts their money where their mouth is when it comes to open source sustainability. Thank you Fly. Alright, let's get down to business. Want some tangible strategy? Do you too want to make a million bucks in open source? It's easy! 🙄 Let's dive in TL;DR; write a bunch of code people like, then sell them screencasts of you building stuff with that code. Also write, speak, and record a lot. Give people something to buy Sounds so simple and silly, but this is the most important thing I learned. People want to support you, but (most of them) aren't going to send you a job-quitting amount for no reason. You have to give them a reason. SELL THEM SOMETHING. They are already a fan of you and your work and are super appreciative. They'll be happy to buy a course you make or screencasts you record, or stickers or coffee or whatever it is you sell them. Start by selling education Even if you're not a good educator, you're the MOST qualified person to teach people how to use your software. Just build something with your software and talk about it while recording your screen. Keep it simple at first, don't go out and buy a bunch of lights and background trinkets. Just hit record and publish that sh**. Put the videos on your documentation site. Link to them from other docs pages. Give 10-20 videos away for free. Make them log-in with GitHub and become a sponsor for the rest. Bing. Bang. Boom. I still make most of my money from this strategy and I almost never show my face or do any fancy editing or graphics. I just make the content as good as I can and that's what people ultimately care about. Your docs are your most valuable asset I kinda just said this, but it's worth repeating. You have a strong and distinct advantage over lots of other types of indie hacking businesses: you have a website that people come to every day and spend lots of time reading and searching around. You have their eyeballs. You can make contact with them. This is huge. Announce your new event in a banner at the top. Collect emails for your newsletter at the bottom of every page. Advertise your side hustle course in the sidebar. Make a few bucks from carbon ads. Whatever. Just keep it looking clean and honest. Not like a recipe website lol—developers will hate you. Also, you should do all this while the getting is still good. The GPTs and Arcs and such are coming for your site traffic. They want to become the user-facing thing and your site will just be information for them to eat. Your email list is your second most valuable asset Go sign up for convert kit right now. Offer people things for free in exchange for their email address. Send them cool ideas and thoughts every so often. Make it worth their time. Make it awesome. Reply to every single person that replies to one of those emails. Write them in an informal way. People will like the authenticity, and writing them will be much more doable for you. If you make them too polished you'll burn out and quit sending them. Then, when you have something to sell, send a couple emails leading up to it, then a launch email and just watch the magic happen. You thought your giant Twitter following was valuable. No, it's crap. Your email list is far more valuable. Keep it real Kind of the last point. Just be yourself in everything you do. Talk to people like they're already your friend. You'll end up attracting other authentic people and you'll make a bunch of friends that you'll have for years and years. Relationships are everything I used to think that most of my success was from my programming ability, marketing ability, general taste, etc... And yeah, I needed to be good at programming and talking and what not, but the thing that REALLY did it, was relationships. I put myself out there. I went to conferences, both as a speaker and attendee. I looked people up and traveled to them in person. I talked for hours on the phone with people. Started small ventures with people. I hung out on twitter for countless hours. I chilled on Zoom for more hours. And all that stuff added up to a giant pile of people I could call on for advice whenever I wanted. And a big community of people who "have my back". They'll shout out stuff I do. They'll throw opportunities my way. They're just generally rooting for me. And that's everything. Seriously. Relationships are everything. Build them. Keep them. Diversify (platform risk) I woke up to an email on Jan 23 from GitHub saying that in a month they would be cutting off PayPal sponsorships: I had literally one month's notice to switch people over from PayPal to CC and I had no idea how much money was going through PayPal, or which sponsors were sponsoring because of it. Is this going to be a blip? Or bankrupt me. At this point I had already had relationships to the sponsors team, but leadership had changed and I didn't even know who to reach out to, so I literally went to the support link on GitHub and wrote this message: They replied back right away telling me that a super high up fella I won't name wanted to hop on a call with me. He explained what he could, was insanely cool, looked up my exact numbers in the database live on the call, and personally sent me some money from his own PayPal account as a token. Hell ya. Damn GH. The number was around $4k/mo. So yeah, not great, probably docked my pay by $50k that year. But my assumption is they were in a tight spot compliance wise or something, had no choice, and did everything they could to make it good. They are forgiven lol. Nonetheless, huge lesson for me: Platform risk is a real thing: DIVERSIFY! I still use and love GH sponsors, but I've also added Stripe, Paddle, Gumroad, and Lemon Squeezy to my repertoire of payment processors for new endeavors. One huge advantage of GH over those others is their commitment to zero payment processing fees for developers. They are also way easier to deal with from a tax perspective than any of the those other ones. There are sharks. Everywhere. The hardest part about this whole OSS game hands down is the "sell people something" part. The reason it's so hard is you have to build something for people to buy ON TOP of building and maintaining your giant open source project. That's hard. It makes the competition really tough in the market part of all of this. People will scoop your ideas, rip you off, wrap your code, whatever. Most of the time it's not a big deal and you just have to remind yourself that most of these projects go nowhere. But SOMETIMES that's not the case unfortunately. Don't stress about competition A lot of people don't think this way, but I do. I'm competitive. If I'm making a course and someone makes the same thing sooner, I used to get stressed. This is a bad take. A massive lesson for me that fundamentally made my life way better: Just like people listen to multiple bands, they'll buy multiple courses and watch multiple educators. In fact, the more the merrier when it comes to education. Now there's just more people spreading the word about your project. It's a net good every time. DO stress about competition So it's all sunshine and roses when it comes to education, but when it comes to code, it's not so much. People generally use a single framework (if that's what you're building). So if someone else "wraps" your framework with a thin layer of API frosting or whatever, they'll start siphoning all the eyeballs and IP from your project. It really sucks, but hey, you're the dummy who put all this work into a repository that has an MIT license that clearly tells people: you are allowed to take this code and do anything you want with it, including calling it your own, or selling it, or literally whatever the hell you want lol This is hands down the most demoralizing part of open source. You create a thing that you and others are excited about, you embark on a years long journey of adding features and fixing bugs, then someone comes along and stands on your shoulders in a way that doesn't benefit both of you. In fact it harms you. Even worse, they'll submit GitHub issues on your repo so that you can make their project better because you're under their hood! The trouble with this model is that it will rob you of your optionality and exposure, which will rob you of your profits, which will send you back to a day job, which will kill your project slowly. Then everybody loses. I never felt this way when I was a 9-5 dev, but when I became a maintainer, I felt this hard. Good news is other people have felt the same thing and are starting to carve new paths like the Fair-code initiative: Tag new major versions This is a big one I've learned. You may be totally happy with your software and see it as a beautiful thing, but if you never release new major versions with ceremony, your project will start to feel stale. If two years goes by and you didn't hire a designer to change your docs site, add a few decent features, and slap a new vX.0 on there, you're doing it wrong. Most developers (myself included) adore the new and shiny. The recency bias is everywhere. Whatever is most new, will feel most...good? So just keep your thing feeling new, even if it's not a fundamental shift. You could literally just tag a new version, redesign your landing page, and crap out a tweet with flame, rocket, and tada emojis. Oh don't forget sparkle emojis too. Turn off GitHub issues Here's a giant lesson no one will tell you: TURN OFF GITHUB ISSUES. IT'S A BROKEN MODEL. What is this crazy job you have where random people from all over the internet get to demand your attention and hold you hostage until you they're satisfied and you can close their issue? If you close an issue because it's not a priority or a bug that's too obscure and hard to reproduce? People will take it as an act of aggression. Use GitHub discussions instead. My philosophy is this: let the community talk amongst themselves about bugs and such they're finding. Then when things have crystalized enough, a competent enough community member can submit a Pull Request and THEN I'll give it my brain and attention. Only once someone has met me half way by thinking through the problem, recreating it in an easily reproducible environment, and ideally added failing tests, will I apply my brain to it. This way, I can maintain projects well. Still engage with the community. AND build other stuff to keep the projects fresh or funded. There are certainly maintainers far better than I in this realm. They'll hang out in discord all day and keep an issues inbox zero. Good for them. That is not me. I have a wife, 2 kids, and still have a mountain of things to do on the repo WITHOUT constantly triaging issues. And discord? I wish I could engage with the community more regularly in that way, but it just robs my focus in the deepest way. It will keep me out of deep work guaranteed. I hang on twitter, respond to emails, and podcast a ton. So people still feel connected to me, but in a way that I can "opt-in" when I have the time. Have a plan for life after OSS This one I have no experience with, but it's something I'm starting to think about. Success in OSS is a fleeting thing. Your lib is the hot sh** right now, but tomorrow, there's a great chance it won't be. It likely won't all evaporate overnight of course though. Good to remember the Lindy Effect: But nonetheless, monetizing open source is uniquely difficult for all the reasons I whined about early. So ideally, you start building some business around it that is more sustainable. You know, like that SaaS everyone is gonna build someday that will save them? Yeah I have that hope too... Enjoy the perks GitHub and other companies will send you random cool swag. People will want to talk to you at conferences instead of you sitting awkwardly alone. Your Heros will know who you are and you might even become friends with them. Also YOU DON'T HAVE A REAL JOB, so yeah, enjoy that. Take a walk, go camping, just screw off and don't tell anyone. And MOST importantly: ... are you ready? ... get ready... You get to freaking write freaking code all freaking day and freaking get paid. And not that brown-field information-system crap that clients bring you. Not just tables and forms. Fresh, hot, steamy, unique programming problems that you can just gnaw on in bliss. That is why I do it. That's what it's all about. Pulling that thread and seeing where it takes me. Riding that lightening of a deep problem. It's everything. It's my favorite thing in the world. Don't get used to it. Don't forget you're not standing at a checkout or punching a clock. You're having the most fun a kid can have and it's your job. Wild. Love you. Bye. My Newsletter I send out an email every so often about cool stuff I'm working on or launching. If you dig, go ahead and sign up! | 2026-01-13T08:48:43 |
https://dev.to/t/beginners/page/3#for-questions | Beginners Page 3 - DEV Community Forem Feed Follow new Subforems to improve your feed DEV Community Follow A space to discuss and keep up software development and manage your software career Future Follow News and discussion of science and technology such as AI, VR, cryptocurrency, quantum computing, and more. Open Forem Follow A general discussion space for the Forem community. If it doesn't have a home elsewhere, it belongs here Gamers Forem Follow An inclusive community for gaming enthusiasts Music Forem Follow From composing and gigging to gear, hot music takes, and everything in between. Vibe Coding Forem Follow Discussing AI software development, and showing off what we're building. Popcorn Movies and TV Follow Movie and TV enthusiasm, criticism and everything in-between. DUMB DEV Community Follow Memes and software development shitposting Design Community Follow Web design, graphic design and everything in-between Security Forem Follow Your central hub for all things security. From ethical hacking and CTFs to GRC and career development, for beginners and pros alike Golf Forem Follow A community of golfers and golfing enthusiasts Crypto Forem Follow A collaborative community for all things Crypto—from Bitcoin to protocol development and DeFi to NFTs and market analysis. Parenting Follow A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Forem Core Follow Discussing the core forem open source software project — features, bugs, performance, self-hosting. Maker Forem Follow A community for makers, hobbyists, and professionals to discuss Arduino, Raspberry Pi, 3D printing, and much more. HMPL.js Forem Follow For developers using HMPL.js to build fast, lightweight web apps. A space to share projects, ask questions, and discuss server-driven templating Dropdown menu Dropdown menu Skip to content Navigation menu Search Powered by Algolia Search Log in Create account DEV Community Close Beginners Follow Hide "A journey of a thousand miles begins with a single step." -Chinese Proverb Create Post submission guidelines UPDATED AUGUST 2, 2019 This tag is dedicated to beginners to programming, development, networking, or to a particular language. Everything should be geared towards that! For Questions... Consider using this tag along with #help, if... You are new to a language, or to programming in general, You want an explanation with NO prerequisite knowledge required. You want insight from more experienced developers. Please do not use this tag if you are merely new to a tool, library, or framework. See also, #explainlikeimfive For Articles... Posts should be specifically geared towards true beginners (experience level 0-2 out of 10). Posts should require NO prerequisite knowledge, except perhaps general (language-agnostic) essentials of programming. Posts should NOT merely be for beginners to a tool, library, or framework. If your article does not meet these qualifications, please select a different tag. Promotional Rules Posts should NOT primarily promote an external work. This is what Listings is for. Otherwise accepable posts MAY include a brief (1-2 sentence) plug for another resource at the bottom. Resource lists ARE acceptable if they follow these rules: Include at least 3 distinct authors/creators. Clearly indicate which resources are FREE, which require PII, and which cost money. Do not use personal affiliate links to monetize. Indicate at the top that the article contains promotional links. about #beginners If you're writing for this tag, we recommend you read this article . If you're asking a question, read this article . Older #beginners posts 1 2 3 4 5 6 7 8 9 Posts Left menu 👋 Sign in for the ability to sort posts by relevant , latest , or top . Right menu How Speed Finally Made My Character Feel Alive Dinesh Dinesh Dinesh Follow Jan 12 How Speed Finally Made My Character Feel Alive # gamedev # unrealengine # beginners # animation Comments Add Comment 2 min read Unlocking the Power of Inheritance in Python Visakh Vijayan Visakh Vijayan Visakh Vijayan Follow Jan 12 Unlocking the Power of Inheritance in Python # beginners # programming # python # tutorial Comments Add Comment 2 min read **More Than a Bootcamp: Why I Chose the German 'Umschulung' Path into Tech** Ali-Funk Ali-Funk Ali-Funk Follow Jan 11 **More Than a Bootcamp: Why I Chose the German 'Umschulung' Path into Tech** # watercooler # career # devops # beginners Comments Add Comment 3 min read EU Digital Omnibus: New Requirements for Websites and Online Services Mehwish Malik Mehwish Malik Mehwish Malik Follow Jan 12 EU Digital Omnibus: New Requirements for Websites and Online Services # webdev # ai # beginners # productivity 17 reactions Comments Add Comment 3 min read Who is Krishna Mohan Kumar? | Full Stack Developer & B.Tech CSE Student Krishna Mohan Kumar Krishna Mohan Kumar Krishna Mohan Kumar Follow Jan 12 Who is Krishna Mohan Kumar? | Full Stack Developer & B.Tech CSE Student # webdev # beginners # portfolio # google Comments Add Comment 1 min read Sharing: How to Build Competitiveness and Soft Skills, and Write a Good Resume Evan Lin Evan Lin Evan Lin Follow Jan 11 Sharing: How to Build Competitiveness and Soft Skills, and Write a Good Resume # learning # beginners # writing # career Comments Add Comment 9 min read Sharing a Talk: "How to Build Your Own Open Source Project" Evan Lin Evan Lin Evan Lin Follow Jan 11 Sharing a Talk: "How to Build Your Own Open Source Project" # beginners # opensource # softwaredevelopment Comments Add Comment 7 min read Sharing: "How to Build Your Own Open Source Project" Evan Lin Evan Lin Evan Lin Follow Jan 11 Sharing: "How to Build Your Own Open Source Project" # beginners # opensource # tutorial Comments Add Comment 11 min read Singleton vs Observer Pattern: When and Why to Use Each Arun Teja Arun Teja Arun Teja Follow Jan 11 Singleton vs Observer Pattern: When and Why to Use Each # architecture # beginners # javascript Comments Add Comment 3 min read Singleton vs Observer Pattern: When and Why to Use Each Arun Teja Arun Teja Arun Teja Follow Jan 11 Singleton vs Observer Pattern: When and Why to Use Each # architecture # beginners # javascript Comments Add Comment 3 min read Observer Pattern Explained Simply With JavaScript Examples Arun Teja Arun Teja Arun Teja Follow Jan 11 Observer Pattern Explained Simply With JavaScript Examples # designpatterns # javascript # beginners # programming Comments Add Comment 3 min read The Non-Drinker's Guide to Clustering Algorithms 🎉 Seenivasa Ramadurai Seenivasa Ramadurai Seenivasa Ramadurai Follow Jan 11 The Non-Drinker's Guide to Clustering Algorithms 🎉 # algorithms # beginners # datascience # machinelearning Comments Add Comment 2 min read My First Beginner Projects Vivash Kshitiz Vivash Kshitiz Vivash Kshitiz Follow Jan 12 My First Beginner Projects # discuss # beginners # python # learning Comments Add Comment 1 min read Accounting 101: Learn how to build financial applications Favor Onuoha Favor Onuoha Favor Onuoha Follow Jan 11 Accounting 101: Learn how to build financial applications # beginners # fintech Comments Add Comment 10 min read Sitemaps & robots.txt: The Secret to Faster, Smarter Scraping Muhammad Ikramullah Khan Muhammad Ikramullah Khan Muhammad Ikramullah Khan Follow Jan 11 Sitemaps & robots.txt: The Secret to Faster, Smarter Scraping # webdev # programming # python # beginners Comments Add Comment 10 min read [TIL][Android] Common Android Studio Project Opening Issues Evan Lin Evan Lin Evan Lin Follow Jan 11 [TIL][Android] Common Android Studio Project Opening Issues # help # beginners # android # kotlin Comments Add Comment 2 min read APCSCamp 2021: How to Learn Programming and Intern at LINE Evan Lin Evan Lin Evan Lin Follow Jan 11 APCSCamp 2021: How to Learn Programming and Intern at LINE # learning # beginners # career # programming Comments Add Comment 10 min read LINE Platform and Messaging API Introduction - 2022 Evan Lin Evan Lin Evan Lin Follow Jan 11 LINE Platform and Messaging API Introduction - 2022 # beginners # api # tutorial # programming Comments Add Comment 3 min read Digital Certificate Wallet: Beginner's Guide Evan Lin Evan Lin Evan Lin Follow Jan 11 Digital Certificate Wallet: Beginner's Guide # beginners # security # privacy # mobile Comments Add Comment 2 min read JSON vs. XML for APIs: Key Differences Explained for Beginners CodeItBro CodeItBro CodeItBro Follow Jan 11 JSON vs. XML for APIs: Key Differences Explained for Beginners # webdev # programming # beginners # tutorial Comments Add Comment 10 min read My first post lol bhennyhayman bhennyhayman bhennyhayman Follow Jan 11 My first post lol # webdev # javascript # beginners Comments Add Comment 1 min read AWS IAM basics explained with real examples Sahinur Sahinur Sahinur Follow Jan 11 AWS IAM basics explained with real examples # aws # beginners # security Comments Add Comment 5 min read AWS Pricing Models Explained: (A Beginner's Guide) chandra penugonda chandra penugonda chandra penugonda Follow Jan 11 AWS Pricing Models Explained: (A Beginner's Guide) # beginners # tutorial # cloud # aws Comments Add Comment 8 min read Turning Database Schemas into Diagrams & Docs — Open for Early Feedback Rushikesh Bodakhe Rushikesh Bodakhe Rushikesh Bodakhe Follow Jan 11 Turning Database Schemas into Diagrams & Docs — Open for Early Feedback # webdev # programming # ai # beginners 1 reaction Comments Add Comment 1 min read HTTP Caching Explained (The Way I Learned It in Production) Nishar Arif Nishar Arif Nishar Arif Follow Jan 11 HTTP Caching Explained (The Way I Learned It in Production) # beginners # webdev # tutorial # performance 1 reaction Comments Add Comment 4 min read loading... 💎 DEV Diamond Sponsors Thank you to our Diamond Sponsors for supporting the DEV Community Google AI is the official AI Model and Platform Partner of DEV Neon is the official database partner of DEV Algolia is the official search partner of DEV DEV Community — A space to discuss and keep up software development and manage your software career Home DEV++ Podcasts Videos DEV Education Tracks DEV Challenges DEV Help Advertise on DEV DEV Showcase About Contact Free Postgres Database Software comparisons Forem Shop Code of Conduct Privacy Policy Terms of Use Built on Forem — the open source software that powers DEV and other inclusive communities. Made with love and Ruby on Rails . DEV Community © 2016 - 2026. We're a place where coders share, stay up-to-date and grow their careers. Log in Create account | 2026-01-13T08:48:43 |
https://www.pocketgamer.com/ahead-of-the-game/shadowborn/ | Ahead of the Game - Shadowborn is Diablo-esque dungeon-looting fun with highly customisable builds | Pocket Gamer Our Network Arrow Down PocketGamer.com AppSpy.com 148Apps.com PocketGamer.fr PocketGamer.biz PCGamesInsider.biz The Sims News PocketGamer.fun BlockchainGamer.biz PG Connects BigIndiePitch.com MobileGamesAwards.com U.GG Icy Veins The Sims Resource Fantasy Football Scout GameKnot Addicting Games Arcade Cloud EV.IO Menu PocketGamer.com Facebook X YouTube RSS Search Search Features Ahead of the Game - Shadowborn is Diablo-esque dungeon-looting fun with highly customisable builds Some shadowy shenanigans indeed By Catherine Dellosa | Jan 13 iOS + Android Twitter Facebook Reddit Fight your way through the darkness of the dungeons Loot, die, upgrade, then loot some more Plenty of build freedom and weapon customisations It's all about saving the realm in style in this week's Ahead of the Game series , where we tell you all about a new mobile endeavour that's playable in one form or another despite its unofficial launch. They say imitation is the highest form of flattery, which is probably why it's okay that Shadowborn looks and feels shamelessly Diablo-esque. Everything from the isometric view to the old-timey font seems to pay homage to one of Blizzard's flagship franchises, and that's not necessarily a bad thing. There's no shortage of these kinds of dungeon-crawling RPGs on mobile, and that's likely because the appeal is just too great to resist. I suppose we humans have an insatiable desire to torture ourselves by taking on challenging dungeons and then having a go over and over again despite failure, all so we can grab the coveted loot at the proverbial end of the tunnel. It's a fantastic loop that I feel Shadowborn executes really well - and what I appreciate about it more is that while you can pick a class from the get-go, you're not bound by that build forever. I mean, I myself picked up a katana and a throwing axe for my assassin-slash-archer just because it's fun to chuck my axe at unwitting foes willy-nilly. My favourite loot definitely was the books of spells I just happened to stumble upon though, which gave me the unholy ability to possess enemies for a limited time, as well as raise the dead for some extra chaos on the battlefield. I can't tell you how enjoyable it is to wander around and snipe demons from afar with my trusty bow, all while my undead skeleton warrior (whom I've lovingly and unoriginally named Skelly) charges headfirst (or skull-first) into battle as my tank. Yes, this little indie gem lets you do that, and all for the low, low price of free. So, how do you play Shadowborn? It's currently in early access with the latter half of the RPG coming soon, but to be honest, everything feels incredibly polished as it is, down to the lovely art style. It's safe to say you'll find plenty to immerse yourself in despite its seemingly "early stage" - but in-app purchases abound, though, so if you ever find yourself in too deep, you might have to start prepping your wallet for those special booster packs soon. Download now! Shadowborn Catherine Dellosa Twitter Instagram Catherine plays video games for a living and writes because she’s in love with words. Her Young Adult contemporary novel, For The Win: The Not-So-Epic Quest Of A Non-Playable Character, is her third book published by Penguin Random House SEA - a poignant love letter to gamer geeks, mythological creatures, teenage heartbreak, and everything in between. She one day hopes to soar the skies as a superhero, but for now, she strongly believes in saving lives through her works in fiction. Check out her books at bit.ly/catherinedellosabooks, or follow her on FB/IG/Twitter at @thenoobwife. Next Up : Definitive Apple Arcade games list - Every available title so far Related Ahead of the Game - Dungeon Random Defense tests your horde-clearing tactics (with a special New Year code too) iOS + Android Ahead of the Game - Outpost Stand: Alien Rush is roguelike sci-fi survival with StarCraft-inspired bugs iOS + Android Ahead of the Game - Star Blaster is a roguelike auto-firing shooter in spaaaaace Android Ahead of the Game - Pixel Brave: Idle RPG is auto-battling, pixel-art gacha fare plus a loyal doggo Android Ahead of the Game - Clans of London lets you conquer the city with vampiric, Marvel Snap-esque cards iOS + Android Sign up! Get Pocket Gamer tips, news & features in your inbox Daily Updates Weekly Updates Your sign up will be strictly used in accordance with our Terms of Use and Privacy Policy . Get social! Facebook X YouTube RSS | 2026-01-13T08:48:43 |
https://www.pocketgamer.com/reviews/ | Reviews | Pocket Gamer Our Network Arrow Down PocketGamer.com AppSpy.com 148Apps.com PocketGamer.fr PocketGamer.biz PCGamesInsider.biz The Sims News PocketGamer.fun BlockchainGamer.biz PG Connects BigIndiePitch.com MobileGamesAwards.com U.GG Icy Veins The Sims Resource Fantasy Football Scout GameKnot Addicting Games Arcade Cloud EV.IO Menu PocketGamer.com Facebook X YouTube RSS Search Search Reviews Highlights Handset Review Honor Magic8 Pro review - "A phone for pictures" By Jupiter Hadley Game Review Sengodai review - "Fantastic theming and aesthetics, but I wish it had a tad more depth" By Catherine Dellosa Game Review Besiege review - "Building battering rams for a better tomorrow!" By Will Quick Reviews RSS Hardware Review Status Audio Pro X review - "Great sound quality and noise cancelling" By Jupiter Hadley Hardware Review Boox Note Max review - "Top-notch productivity and gaming without the eye strain" By Catherine Dellosa Hardware Review Gunnar Cruz, Spider-Man Miles Morales Edition glasses review - "Made for teens, but oddly perfect for me" By Catherine Dellosa Game Review Fangs Breaker review - "A familiar-feeling twist" By Jupiter Hadley Game Review Cult of the Lamb review - "Pocket-sized cults!" By Jupiter Hadley Hardware Review Gunnar Roswell Alienware Glasses review - "Futuristic statement piece" By Jupiter Hadley Right Arrow Game Finder Browse our archive for thousands of game reviews across all mobile and handheld formats Game Review Trickshot Corncob Game review - "Lots of throwing!" By Jupiter Hadley Game Review Monument Valley 3: The Garden of Life review - "More puzzles, interesting story" By Jupiter Hadley Game Review The Macabre Journey review - "A charmingly dark adventure" By Jack Brassell Hardware Review The Grinch Plush Wireless Headphones review - "They sure are comfortable" By Jupiter Hadley Hardware Review Santa Jack Skellington Cable Guys review - "Large and well themed" By Jupiter Hadley Hardware Review Gunnar Mammoth Glasses review - "Larger glasses for computer use" By Jupiter Hadley Hardware Review Krafted Couch charger review - "Great way to charge!" By Jupiter Hadley Hardware Review Flydigi Vader 5 Pro Controller review - "A stylish device with performance issues" By Jack Brassell Hardware Review Sliding Sonic Cable Guy Holdems Mini review - "Gotta Go Fast!" By Jupiter Hadley Hardware Review Maono PD200W microphone review - "A versatile all-rounder with an attractive price tag" By Iwan Morris Game Review Islanders: Mobile review - " A satisfying low-key strategy experience" By Jack Brassell Hardware Review Tessan Voyager 205 travel adapter review - "Universal all-in-one charging - if you can get the outlet to fit" By Catherine Dellosa Hardware Review X Rocker Sparta RGB gaming chair review - "A comfy chair that also has lights... yay?" By Stephen Gregson-Wood Game Review Soul Hunter review - "Idle action with lots of places to explore" By Jupiter Hadley Game Review Slender Threads review - “A thrilling and ominous narrative adventure” By Jack Brassell Hardware Review Gunnar Borderlands 4 Moxxi Glasses review - "Cyberpunk fun" By Jupiter Hadley Game Review Resident Evil Survival Unit - "A standard 4X strategy" By Jack Brassell Game Review Timelie review - "A terrific time-bending puzzle adventure" By Jack Brassell Hardware Review iWALK Mini Portable Charger review - "Small but cute charger" By Jupiter Hadley Game Review Grid Ranger review - "It's the one arcade game that escaped the '80s!" By Will Quick Hardware Review TMNT Raphael Cable Guy Holdems Mini review - "Small display for your devices" By Jupiter Hadley Hardware Review OXS Thunder Pro+ gaming speakers review - "Flashy sound, with a twist on 'surround'" By Catherine Dellosa Game Review Heroes of Fortune review - "A repetitive dungeon crawler" By Jack Brassell Hardware Review Gunnar World of Warcraft Sylvanas Glasses review - "Video game-inspired but still sleek!" By Jupiter Hadley Next | 2026-01-13T08:48:43 |
https://calebporzio.com/essential-laravel-knowledge-how-a-facade-work | Essential Laravel Knowledge: How A Facade Works | Caleb Porzio Caleb Porzio Posts • Creations • Talks • Tweets Essential Laravel Knowledge: How A Facade Works Apr 2019 Facades are the gateway to the magical system at the core of Laravel. Understanding them unlocks the next level of Laravel mastery. Watch me convert a simple PHP class into a Facade and demonstrate what's going on beneath the surface. My Newsletter I send out an email every so often about cool stuff I'm working on or launching. If you dig, go ahead and sign up! | 2026-01-13T08:48:43 |
https://calebporzio.com/kicking-the-tires-on-inertiajs | Playing Around With Jonathan Reinink's InertiaJS | Caleb Porzio Caleb Porzio Posts • Creations • Talks • Tweets Playing Around With Jonathan Reinink's InertiaJS May 2019 My buddy Jonathan Reinink has been working on a cool project called InertiaJS. It attempts to provide all the UI-gravy of a SPA while handling routing and data fetching the good old-fashioned way. I think Jonathan Reinink and I are cut from the same cloth when it comes to our love of pragmatic Laravel apps and distaste for needless indirection. I gave a talk last year at Laracon called "Embrace the Backend" ( watch it here ), that captures this philosophy, and more recently, he wrote a blog post called Server-side apps with client-side rendering that gets after these same concepts. Out of this philosophy, I started working on Livewire, and he started working on Inertia, both pretty much at the same time. These tools appeal to a similar type of developer, and I can see a place for both in the ecosystem. Playing with it Warning: Inertia isn't actually "out" yet, but the repos are public. I checked with Jonathan about posting this video and he was cool with it, but be warned, it's not ready for prime-time yet. My initial motivation for playing with it was to see if Livewire could work with it. That was a derp , with Inertia, there is no Blade, so Livewire's out, but it's still a good walkthrough of Inertia, enjoy! Update: After Jonathan watched the video he had the following messages for you: My Newsletter I send out an email every so often about cool stuff I'm working on or launching. If you dig, go ahead and sign up! | 2026-01-13T08:48:43 |
https://porkbun.com/products/whois_privacy | porkbun.com | Free WHOIS Privacy Toggle navigation porkbun $0.00 (0) products Domains Transfers Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting All Web Hosting Options Easy WordPress Link In Bio Articulation Sitebuilder Cloud WordPress Shared cPanel Hosting Static Hosting Website Builder Easy PHP Email Hosting All Email Hosting Options Proton Mail Porkbun Email Free Email Forwarding Marketing Tools Textla - SMS Marketing Free WHOIS Privacy Free SSL Certificates Free URL Forwarding transfer Free WordPress SALE! .COM SALE! About --> About Who We Are Why Choose Porkbun Porkbun vs Cloudflare FAQs Resources Knowledge Base Porkbun Blog Service Status Help $0.00 (0) sign in Free Whois Privacy Spammers & scammers & fraudsters, oh my! Using a free WHOIS Privacy service helps protect your personal information from being visible on the internet by hiding your domain’s contact details, helping to block spam, scams, and more before it starts. Keep your private information private Porkbun includes FREE WHOIS Privacy for all participating domains. To get started, grab a domain name. Find New Domain Why do you need WHOIS Privacy? When you register a domain, you are required to have a registrant contact listed in a publicly searchable database called WHOIS. Unfortunately, various ne’er-do-wells can see what is listed in WHOIS, and use this information to inundate you with calls and emails. That’s where Private By Design, LLC comes in. For all domains that support it, we’ll publish in the public WHOIS database the details of Private By Design as the registrant rather than your real info, stopping bad actors in their tracks. You'll still receive any important communications related to your domain name; it'll just be forwarded to you through Private by Design. That way, all your personal information will remain private. Privacy off Name: Your Name Organization: Your Business Street: Your Street Address City: Your City State/Province: Your State Postal Code: Your Zip Code Country: Your Country Phone: Your Phone Number Email: Your Email Address Privacy ON! Name: Whois Privacy Organization: Private by Design, LLC Street: 500 Westover Dr #9816 City: Sanford State/Province: NC Postal Code: 27330 Country: US Phone: +1.9712666028 Email: https://porkbun.com/whois/contact/registrant/yourdomain.tld Our Lawyers Made Us Add This Terms and Conditions To read the full Terms and Conditions for Private By Design's Privacy Service, see the Product Terms of Service . Due to individual registry policies, Porkbun is unable to offer WHOIS Privacy for the following TLD extensions: as, tw, game.tw, ebiz.tw, club.tw, cv, gg, co.gg, net.gg, org.gg, je, co.je, net.je, org.je, tm, nz, co.nz, net.nz, org.nz, ac.nz, geek.nz, gen.nz, kiwi.nz, maori.nz, school.nz, lc, com.lc, net.lc, org.lc, co.lc, l.lc, p.lc, ag, com.ag, net.ag, org.ag, co.ag, nom.ag, mn, mu, id.au, au, music, kyoto, my, ca, nl, mx, com.mx, net.mx, org.mx, bh, de, us, am, nyc, law, abogado, uk, co.uk, org.uk, me.uk, eu, in, co.in, net.in, org.in, firm.in, gen.in, ind.in, nrw, and potentially others. Reporting Abuse If you would like to report abuse involving Private By Design's WHOIS Privacy Service, including copyright and intellectual property infringement, contact the Abuse Manager by sending a message to abuse@private.design . Private by Design, LLC Contact Information Address: 500 Westover Dr #9816, Sanford, NC, 27330, USA Phone: +1.971.266.6028 Email: contact@private.design Website: http://private.design × Modal Title Close Close × Modal Title Close porkbun Porkbun is an amazingly awesome ICANN accredited domain name registrar based out of the Pacific Northwest. We're different, we're easy, and we're affordable. Use us, you won't be sorry. If you don't use us we'll be sad, but we'll still love you. Get Pork-Puns In Your Inbox Stay in the loop on all things Porkbun by signing up for our newsletter! 21370 SW Langer Farms Parkway, Suite 142-429 Sherwood, OR 97140, US If you're looking for support, you might be able to answer your own question using our Knowledge Base . Support Hours Impacted From January 3rd to January 11th we will be holding our annual company summit which will impact live and after hours support. Our goal is to provide you with an excellent domain registration experience and support and we all appreciate your patience as the whole company works together to make Porkbun even better. Thank you. Reach our USA-Based phone support team: 1.855.PORKBUN (1.855.767.5286) 9AM - 5PM Pacific Time Other Hours: Your mileage may vary, but give it a whirl support@porkbun.com 24 / 7 Email Support Chat Support Hours Vary Your browser does not support the audio element. This plays a little Porkbun jingle. Stay up to date with Porkbun. Sign up for our cool newsletter and we'll keep you up to date with sweet deals, amazing info, and maybe even the occasional limerick or sonnet. Sign Up Products Domain Names Greatest Deals Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting Link In Bio Articulation Sitebuilder Cloud WordPress cPanel Hosting Static Hosting Easy PHP Website Builder Email Hosting WHOIS Privacy DNS Management SSL Certificates Email Forwarding URL Forwarding Quick Connect Domain Transfer Affiliate Program Handshake Names Ethereum Name Service International Domain Names API Access Support Contact Us Knowledge Base Payment Options Report Abuse Tools Domain Search Domain Suggestion Generator RDAP (WHOIS) Password Generator Service Status Don't like our name? The Buniverse Your IP Address Online DNS Lookup Our Company About Us Our Official Blog Careers Branding Guidelines Policies and Legal Privacy Policy Data Disclosure Policy Bug Bounty Program Porkbun Merchandise Awesomeness Copyright © Porkbun LLC. All rights reserved. Porkbun is a Top Level Design Company Made in the USA 🇺🇸 This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. WARNING: This site has been known to cause a mind blowing experience. We recommend you prepare yourself mentally and if possible be sitting down. Side effects may include saving money, letting out a chuckle, and sporadic oinking. 1 × Modal Title Cancel Continue | 2026-01-13T08:48:43 |
https://github.com/suprsend/suprsend-react-inbox/blob/main/docs/customization.md#action-button-custom-click-handlers | suprsend-react-inbox/docs/customization.md at main · suprsend/suprsend-react-inbox · GitHub Skip to content Navigation Menu Toggle navigation Sign in Appearance settings Platform AI CODE CREATION GitHub Copilot Write better code with AI GitHub Spark Build and deploy intelligent apps GitHub Models Manage and compare prompts MCP Registry New Integrate external tools DEVELOPER WORKFLOWS Actions Automate any workflow Codespaces Instant dev environments Issues Plan and track work Code Review Manage code changes APPLICATION SECURITY GitHub Advanced Security Find and fix vulnerabilities Code security Secure your code as you build Secret protection Stop leaks before they start EXPLORE Why GitHub Documentation Blog Changelog Marketplace View all features Solutions BY COMPANY SIZE Enterprises Small and medium teams Startups Nonprofits BY USE CASE App Modernization DevSecOps DevOps CI/CD View all use cases BY INDUSTRY Healthcare Financial services Manufacturing Government View all industries View all solutions Resources EXPLORE BY TOPIC AI Software Development DevOps Security View all topics EXPLORE BY TYPE Customer stories Events & webinars Ebooks & reports Business insights GitHub Skills SUPPORT & SERVICES Documentation Customer support Community forum Trust center Partners Open Source COMMUNITY GitHub Sponsors Fund open source developers PROGRAMS Security Lab Maintainer Community Accelerator Archive Program REPOSITORIES Topics Trending Collections Enterprise ENTERPRISE SOLUTIONS Enterprise platform AI-powered developer platform AVAILABLE ADD-ONS GitHub Advanced Security Enterprise-grade security features Copilot for Business Enterprise-grade AI features Premium Support Enterprise-grade 24/7 support Pricing Search or jump to... Search code, repositories, users, issues, pull requests... --> Search Clear Search syntax tips Provide feedback --> We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly --> Name Query To see all available qualifiers, see our documentation . Cancel Create saved search Sign in Sign up Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} suprsend / suprsend-react-inbox Public Notifications You must be signed in to change notification settings Fork 1 Star 15 Code Issues 1 Pull requests 3 Actions Projects 0 Security Uh oh! There was an error while loading. Please reload this page . Insights Additional navigation options Code Issues Pull requests Actions Projects Security Insights Footer © 2026 GitHub, Inc. Footer navigation Terms Privacy Security Status Community Docs Contact Manage cookies Do not share my personal information You can’t perform that action at this time. | 2026-01-13T08:48:43 |
https://dev.to/inushathathsara/the-features-i-killed-to-ship-the-80-percent-app-in-4-weeks-30op#comments | The Features I Killed to Ship The 80 Percent App in 4 Weeks - DEV Community Forem Feed Follow new Subforems to improve your feed DEV Community Follow A space to discuss and keep up software development and manage your software career Future Follow News and discussion of science and technology such as AI, VR, cryptocurrency, quantum computing, and more. Open Forem Follow A general discussion space for the Forem community. If it doesn't have a home elsewhere, it belongs here Gamers Forem Follow An inclusive community for gaming enthusiasts Music Forem Follow From composing and gigging to gear, hot music takes, and everything in between. Vibe Coding Forem Follow Discussing AI software development, and showing off what we're building. Popcorn Movies and TV Follow Movie and TV enthusiasm, criticism and everything in-between. DUMB DEV Community Follow Memes and software development shitposting Design Community Follow Web design, graphic design and everything in-between Security Forem Follow Your central hub for all things security. From ethical hacking and CTFs to GRC and career development, for beginners and pros alike Golf Forem Follow A community of golfers and golfing enthusiasts Crypto Forem Follow A collaborative community for all things Crypto—from Bitcoin to protocol development and DeFi to NFTs and market analysis. Parenting Follow A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Forem Core Follow Discussing the core forem open source software project — features, bugs, performance, self-hosting. Maker Forem Follow A community for makers, hobbyists, and professionals to discuss Arduino, Raspberry Pi, 3D printing, and much more. HMPL.js Forem Follow For developers using HMPL.js to build fast, lightweight web apps. A space to share projects, ask questions, and discuss server-driven templating Dropdown menu Dropdown menu Skip to content Navigation menu Search Powered by Algolia Search Log in Create account DEV Community Close Add reaction Like Unicorn Exploding Head Raised Hands Fire Jump to Comments Save Boost More... Copy link Copy link Copied to Clipboard Share to X Share to LinkedIn Share to Facebook Share to Mastodon Share Post via... Report Abuse Malawige Inusha Thathsara Gunasekara Posted on Jan 12 • Originally published at inusha-gunasekara.hashnode.dev The Features I Killed to Ship The 80 Percent App in 4 Weeks # flutter # softwareengineering # devops # learning I almost fell into a trap believing that "more features" equals a "better product." When I started building The 80% , an assistant tool which helps students to keep track of their attendance, medicals and GPA. I had a strict four-week deadline to ship a production-ready attendance tracker. I quickly realized that if I tried to build everything I wanted , I would never ship what the user needed . Then I remembered what Elon Musk said, "The Best Part is No Part." I didn't just cut features to save time; I cut them to save the architecture from unnecessary complexity. Here are the five worth-mentioning features I killed in The 80% . 1. The Backup Server Trap I wasted the first few days being obsessed with 100% uptime. I wanted to build a secondary failover server just in case Firebase went down. I realized I was solving an imaginary problem. Firebase has 99.99% uptime, while the probability of my users having poor campus Wi-Fi is high. The real risk wasn't Google servers failing. It was the connection dropping between the classroom and the cloud. I abandoned the backup server entirely and embraced an Offline-First Architecture using Hive. By treating the user's device as the primary data source, the app works perfectly regardless of server status, I learned that I shouldn't build complex distributed systems when a local database solves the actual problem. 2. The Medical Cloud Storage Nightmare I planned to add a feature allowing students to upload photos of their medical certificates to the cloud so they would never lose them. But as I designed it, two major problems appeared: the extreme cost of storing images for thousands of users on the Firebase Free Tier, and the liability of holding Personally Identifiable Information (PII) . If I held medical records, I was responsible for protecting them from data breaches. As a student developer, I didn't want the risk of a data breach hanging over my head. To solve this, I built the "The Local Wallet." within the app itself. Instead of uploading files, the app simply saves the images in the device's local sandbox and stores a link to the file path. The data stays 100% on the user's phone, resulting in zero cloud costs and zero privacy liability. I learned that the most secure data is the data you never collect. 3. The "Automated Email" Fantasy I wanted to build a productivity hack where the app would automatically send official emails from the student's university account using SMTP or OAuth. It sounded like a great productivity hack until I looked at the technical reality. University firewalls and Multi-Factor Authentication (MFA) makes this feature hard to implement. Making it work I had two bad choices. Requesting Credentials from the User: Asking users for their university passwords which leads to a a massive security violation that looks exactly like phishing. or Enterprise Verification: I would have to navigate the university's bureaucracy to get official OAuth approval. I avoided this method in order to reduce the complexity of the app. I killed this automation entirely and stuck with the traditional email flow. The app automatically opens the default email app, then the user can send the drafted email with the medical report. I learned two major lessons here. First one is "Trust is harder to build than a feature." And as developers we shouldn't compromise security for a "cool" automation. 4. All University Supported Grading System I had a plan to create a database containing the grading scales for all major universities all around the world to automate the GPA calculation process. But I quickly realized that this needs constant maintainability, which I don't have time to do as a undergraduate. It would require weeks of manual data entry and maintenance, and if a university changed their grading policy, my app would be instantly outdated. It simply wasn't worth the effort for my app. Instead, I built a feature that allows the user to configure their own grading scale . This taught me that when shipping, flexibility is often better than hard-coded perfection. 5. Sync Custom Profile Picture Across Devices I wanted users to be able to pick a photo from their gallery and have that custom profile picture sync across all their devices via Firebase. This led me to the "Cost" problem again. I would need a paid Firebase plan to store these custom images, or I would have to bloat the database by storing base64 strings, which requires unnecessary processing power and time. I compromised by removing the ability to upload custom photos and instead provided a set of high-quality, pre-defined 3D avatars. I only sync the Avatar ID (a simple integer) across devices, keeping the data transfer minimal. This was a valuable lesson in distinguishing between what is needed (identifying users) versus what is wanted (full customizability). Conclusion It is easy to add features. It is hard to remove them. By killing these features, I didn't just save time; I built a product that is faster, cheaper to run, and more secure. I learned that my job isn't to build the most complex version of an idea, but to ship the version that actually works. The 80% proved to me that sometimes, the best code is the code you delete. Top comments (0) Subscribe Personal Trusted User Create template Templates let you quickly answer FAQs or store snippets for re-use. Submit Preview Dismiss Code of Conduct • Report abuse Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink . Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse Malawige Inusha Thathsara Gunasekara Follow IT Undergrad @ University of Moratuwa. Building with Python, Flutter and so much more. I write about technical stuff and clean code. Documenting my journey one commit at a time. Location Colombo, Sri Lanka Education University of Moratuwa Joined Jan 1, 2026 More from Malawige Inusha Thathsara Gunasekara How I Built a Flutter + Gemini AI App to "Hack" My University Attendance (Open Source) # flutter # firebase # gemini # fullstack 💎 DEV Diamond Sponsors Thank you to our Diamond Sponsors for supporting the DEV Community Google AI is the official AI Model and Platform Partner of DEV Neon is the official database partner of DEV Algolia is the official search partner of DEV Forem — A space to discuss and keep up software development and manage your software career Home DEV++ Podcasts Videos DEV Education Tracks DEV Challenges DEV Help Advertise on DEV DEV Showcase About Contact Free Postgres Database Software comparisons Forem Shop Code of Conduct Privacy Policy Terms of Use Built on Forem — the open source software that powers DEV and other inclusive communities. Made with love and Ruby on Rails . Forem © 2016 - 2026. We're a place where coders share, stay up-to-date and grow their careers. Log in Create account | 2026-01-13T08:48:43 |
https://docs.python.org/3/library/select.html#module-select | select — Waiting for I/O completion — Python 3.14.2 documentation Theme Auto Light Dark Table of Contents select — Waiting for I/O completion /dev/poll Polling Objects Edge and Level Trigger Polling (epoll) Objects Polling Objects Kqueue Objects Kevent Objects Previous topic ssl — TLS/SSL wrapper for socket objects Next topic selectors — High-level I/O multiplexing This page Report a bug Show source Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Standard Library » Networking and Interprocess Communication » select — Waiting for I/O completion | Theme Auto Light Dark | select — Waiting for I/O completion ¶ This module provides access to the select() and poll() functions available in most operating systems, devpoll() available on Solaris and derivatives, epoll() available on Linux 2.5+ and kqueue() available on most BSD. Note that on Windows, it only works for sockets; on other operating systems, it also works for other file types (in particular, on Unix, it works on pipes). It cannot be used on regular files to determine whether a file has grown since it was last read. Note The selectors module allows high-level and efficient I/O multiplexing, built upon the select module primitives. Users are encouraged to use the selectors module instead, unless they want precise control over the OS-level primitives used. Availability : not WASI. This module does not work or is not available on WebAssembly. See WebAssembly platforms for more information. The module defines the following: exception select. error ¶ A deprecated alias of OSError . Changed in version 3.3: Following PEP 3151 , this class was made an alias of OSError . select. devpoll ( ) ¶ (Only supported on Solaris and derivatives.) Returns a /dev/poll polling object; see section /dev/poll Polling Objects below for the methods supported by devpoll objects. devpoll() objects are linked to the number of file descriptors allowed at the time of instantiation. If your program reduces this value, devpoll() will fail. If your program increases this value, devpoll() may return an incomplete list of active file descriptors. The new file descriptor is non-inheritable . Added in version 3.3. Changed in version 3.4: The new file descriptor is now non-inheritable. select. epoll ( sizehint = -1 , flags = 0 ) ¶ (Only supported on Linux 2.5.44 and newer.) Return an edge polling object, which can be used as Edge or Level Triggered interface for I/O events. sizehint informs epoll about the expected number of events to be registered. It must be positive, or -1 to use the default. It is only used on older systems where epoll_create1() is not available; otherwise it has no effect (though its value is still checked). flags is deprecated and completely ignored. However, when supplied, its value must be 0 or select.EPOLL_CLOEXEC , otherwise OSError is raised. See the Edge and Level Trigger Polling (epoll) Objects section below for the methods supported by epolling objects. epoll objects support the context management protocol: when used in a with statement, the new file descriptor is automatically closed at the end of the block. The new file descriptor is non-inheritable . Changed in version 3.3: Added the flags parameter. Changed in version 3.4: Support for the with statement was added. The new file descriptor is now non-inheritable. Deprecated since version 3.4: The flags parameter. select.EPOLL_CLOEXEC is used by default now. Use os.set_inheritable() to make the file descriptor inheritable. select. poll ( ) ¶ (Not supported by all operating systems.) Returns a polling object, which supports registering and unregistering file descriptors, and then polling them for I/O events; see section Polling Objects below for the methods supported by polling objects. select. kqueue ( ) ¶ (Only supported on BSD.) Returns a kernel queue object; see section Kqueue Objects below for the methods supported by kqueue objects. The new file descriptor is non-inheritable . Changed in version 3.4: The new file descriptor is now non-inheritable. select. kevent ( ident , filter = KQ_FILTER_READ , flags = KQ_EV_ADD , fflags = 0 , data = 0 , udata = 0 ) ¶ (Only supported on BSD.) Returns a kernel event object; see section Kevent Objects below for the methods supported by kevent objects. select. select ( rlist , wlist , xlist , timeout = None ) ¶ This is a straightforward interface to the Unix select() system call. The first three arguments are iterables of ‘waitable objects’: either integers representing file descriptors or objects with a parameterless method named fileno() returning such an integer: rlist : wait until ready for reading wlist : wait until ready for writing xlist : wait for an “exceptional condition” (see the manual page for what your system considers such a condition) Empty iterables are allowed, but acceptance of three empty iterables is platform-dependent. (It is known to work on Unix but not on Windows.) The optional timeout argument specifies a time-out as a floating-point number in seconds. When the timeout argument is omitted or None , the function blocks until at least one file descriptor is ready. A time-out value of zero specifies a poll and never blocks. The return value is a triple of lists of objects that are ready: subsets of the first three arguments. When the time-out is reached without a file descriptor becoming ready, three empty lists are returned. Among the acceptable object types in the iterables are Python file objects (e.g. sys.stdin , or objects returned by open() or os.popen() ), socket objects returned by socket.socket() . You may also define a wrapper class yourself, as long as it has an appropriate fileno() method (that really returns a file descriptor, not just a random integer). Note File objects on Windows are not acceptable, but sockets are. On Windows, the underlying select() function is provided by the WinSock library, and does not handle file descriptors that don’t originate from WinSock. Changed in version 3.5: The function is now retried with a recomputed timeout when interrupted by a signal, except if the signal handler raises an exception (see PEP 475 for the rationale), instead of raising InterruptedError . select. PIPE_BUF ¶ The minimum number of bytes which can be written without blocking to a pipe when the pipe has been reported as ready for writing by select() , poll() or another interface in this module. This doesn’t apply to other kind of file-like objects such as sockets. This value is guaranteed by POSIX to be at least 512. Availability : Unix Added in version 3.2. /dev/poll Polling Objects ¶ Solaris and derivatives have /dev/poll . While select() is O ( highest file descriptor ) and poll() is O ( number of file descriptors ), /dev/poll is O ( active file descriptors ). /dev/poll behaviour is very close to the standard poll() object. devpoll. close ( ) ¶ Close the file descriptor of the polling object. Added in version 3.4. devpoll. closed ¶ True if the polling object is closed. Added in version 3.4. devpoll. fileno ( ) ¶ Return the file descriptor number of the polling object. Added in version 3.4. devpoll. register ( fd [ , eventmask ] ) ¶ Register a file descriptor with the polling object. Future calls to the poll() method will then check whether the file descriptor has any pending I/O events. fd can be either an integer, or an object with a fileno() method that returns an integer. File objects implement fileno() , so they can also be used as the argument. eventmask is an optional bitmask describing the type of events you want to check for. The constants are the same that with poll() object. The default value is a combination of the constants POLLIN , POLLPRI , and POLLOUT . Warning Registering a file descriptor that’s already registered is not an error, but the result is undefined. The appropriate action is to unregister or modify it first. This is an important difference compared with poll() . devpoll. modify ( fd [ , eventmask ] ) ¶ This method does an unregister() followed by a register() . It is (a bit) more efficient that doing the same explicitly. devpoll. unregister ( fd ) ¶ Remove a file descriptor being tracked by a polling object. Just like the register() method, fd can be an integer or an object with a fileno() method that returns an integer. Attempting to remove a file descriptor that was never registered is safely ignored. devpoll. poll ( [ timeout ] ) ¶ Polls the set of registered file descriptors, and returns a possibly empty list containing (fd, event) 2-tuples for the descriptors that have events or errors to report. fd is the file descriptor, and event is a bitmask with bits set for the reported events for that descriptor — POLLIN for waiting input, POLLOUT to indicate that the descriptor can be written to, and so forth. An empty list indicates that the call timed out and no file descriptors had any events to report. If timeout is given, it specifies the length of time in milliseconds which the system will wait for events before returning. If timeout is omitted, -1, or None , the call will block until there is an event for this poll object. Changed in version 3.5: The function is now retried with a recomputed timeout when interrupted by a signal, except if the signal handler raises an exception (see PEP 475 for the rationale), instead of raising InterruptedError . Edge and Level Trigger Polling (epoll) Objects ¶ https://linux.die.net/man/4/epoll eventmask Constant Meaning EPOLLIN Available for read EPOLLOUT Available for write EPOLLPRI Urgent data for read EPOLLERR Error condition happened on the assoc. fd EPOLLHUP Hang up happened on the assoc. fd EPOLLET Set Edge Trigger behavior, the default is Level Trigger behavior EPOLLONESHOT Set one-shot behavior. After one event is pulled out, the fd is internally disabled EPOLLEXCLUSIVE Wake only one epoll object when the associated fd has an event. The default (if this flag is not set) is to wake all epoll objects polling on a fd. EPOLLRDHUP Stream socket peer closed connection or shut down writing half of connection. EPOLLRDNORM Equivalent to EPOLLIN EPOLLRDBAND Priority data band can be read. EPOLLWRNORM Equivalent to EPOLLOUT EPOLLWRBAND Priority data may be written. EPOLLMSG Ignored. EPOLLWAKEUP Prevents sleep during event waiting. Added in version 3.6: EPOLLEXCLUSIVE was added. It’s only supported by Linux Kernel 4.5 or later. Added in version 3.14: EPOLLWAKEUP was added. It’s only supported by Linux Kernel 3.5 or later. epoll. close ( ) ¶ Close the control file descriptor of the epoll object. epoll. closed ¶ True if the epoll object is closed. epoll. fileno ( ) ¶ Return the file descriptor number of the control fd. epoll. fromfd ( fd ) ¶ Create an epoll object from a given file descriptor. epoll. register ( fd [ , eventmask ] ) ¶ Register a fd descriptor with the epoll object. epoll. modify ( fd , eventmask ) ¶ Modify a registered file descriptor. epoll. unregister ( fd ) ¶ Remove a registered file descriptor from the epoll object. Changed in version 3.9: The method no longer ignores the EBADF error. epoll. poll ( timeout = None , maxevents = -1 ) ¶ Wait for events. timeout in seconds (float) Changed in version 3.5: The function is now retried with a recomputed timeout when interrupted by a signal, except if the signal handler raises an exception (see PEP 475 for the rationale), instead of raising InterruptedError . Polling Objects ¶ The poll() system call, supported on most Unix systems, provides better scalability for network servers that service many, many clients at the same time. poll() scales better because the system call only requires listing the file descriptors of interest, while select() builds a bitmap, turns on bits for the fds of interest, and then afterward the whole bitmap has to be linearly scanned again. select() is O ( highest file descriptor ), while poll() is O ( number of file descriptors ). poll. register ( fd [ , eventmask ] ) ¶ Register a file descriptor with the polling object. Future calls to the poll() method will then check whether the file descriptor has any pending I/O events. fd can be either an integer, or an object with a fileno() method that returns an integer. File objects implement fileno() , so they can also be used as the argument. eventmask is an optional bitmask describing the type of events you want to check for, and can be a combination of the constants POLLIN , POLLPRI , and POLLOUT , described in the table below. If not specified, the default value used will check for all 3 types of events. Constant Meaning POLLIN There is data to read POLLPRI There is urgent data to read POLLOUT Ready for output: writing will not block POLLERR Error condition of some sort POLLHUP Hung up POLLRDHUP Stream socket peer closed connection, or shut down writing half of connection POLLNVAL Invalid request: descriptor not open Registering a file descriptor that’s already registered is not an error, and has the same effect as registering the descriptor exactly once. poll. modify ( fd , eventmask ) ¶ Modifies an already registered fd. This has the same effect as register(fd, eventmask) . Attempting to modify a file descriptor that was never registered causes an OSError exception with errno ENOENT to be raised. poll. unregister ( fd ) ¶ Remove a file descriptor being tracked by a polling object. Just like the register() method, fd can be an integer or an object with a fileno() method that returns an integer. Attempting to remove a file descriptor that was never registered causes a KeyError exception to be raised. poll. poll ( [ timeout ] ) ¶ Polls the set of registered file descriptors, and returns a possibly empty list containing (fd, event) 2-tuples for the descriptors that have events or errors to report. fd is the file descriptor, and event is a bitmask with bits set for the reported events for that descriptor — POLLIN for waiting input, POLLOUT to indicate that the descriptor can be written to, and so forth. An empty list indicates that the call timed out and no file descriptors had any events to report. If timeout is given, it specifies the length of time in milliseconds which the system will wait for events before returning. If timeout is omitted, negative, or None , the call will block until there is an event for this poll object. Changed in version 3.5: The function is now retried with a recomputed timeout when interrupted by a signal, except if the signal handler raises an exception (see PEP 475 for the rationale), instead of raising InterruptedError . Kqueue Objects ¶ kqueue. close ( ) ¶ Close the control file descriptor of the kqueue object. kqueue. closed ¶ True if the kqueue object is closed. kqueue. fileno ( ) ¶ Return the file descriptor number of the control fd. kqueue. fromfd ( fd ) ¶ Create a kqueue object from a given file descriptor. kqueue. control ( changelist , max_events [ , timeout ] ) → eventlist ¶ Low level interface to kevent changelist must be an iterable of kevent objects or None max_events must be 0 or a positive integer timeout in seconds (floats possible); the default is None , to wait forever Changed in version 3.5: The function is now retried with a recomputed timeout when interrupted by a signal, except if the signal handler raises an exception (see PEP 475 for the rationale), instead of raising InterruptedError . Kevent Objects ¶ https://man.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2 kevent. ident ¶ Value used to identify the event. The interpretation depends on the filter but it’s usually the file descriptor. In the constructor ident can either be an int or an object with a fileno() method. kevent stores the integer internally. kevent. filter ¶ Name of the kernel filter. Constant Meaning KQ_FILTER_READ Takes a descriptor and returns whenever there is data available to read KQ_FILTER_WRITE Takes a descriptor and returns whenever there is data available to write KQ_FILTER_AIO AIO requests KQ_FILTER_VNODE Returns when one or more of the requested events watched in fflag occurs KQ_FILTER_PROC Watch for events on a process id KQ_FILTER_NETDEV Watch for events on a network device [not available on macOS] KQ_FILTER_SIGNAL Returns whenever the watched signal is delivered to the process KQ_FILTER_TIMER Establishes an arbitrary timer kevent. flags ¶ Filter action. Constant Meaning KQ_EV_ADD Adds or modifies an event KQ_EV_DELETE Removes an event from the queue KQ_EV_ENABLE Permitscontrol() to returns the event KQ_EV_DISABLE Disablesevent KQ_EV_ONESHOT Removes event after first occurrence KQ_EV_CLEAR Reset the state after an event is retrieved KQ_EV_SYSFLAGS internal event KQ_EV_FLAG1 internal event KQ_EV_EOF Filter specific EOF condition KQ_EV_ERROR See return values kevent. fflags ¶ Filter specific flags. KQ_FILTER_READ and KQ_FILTER_WRITE filter flags: Constant Meaning KQ_NOTE_LOWAT low water mark of a socket buffer KQ_FILTER_VNODE filter flags: Constant Meaning KQ_NOTE_DELETE unlink() was called KQ_NOTE_WRITE a write occurred KQ_NOTE_EXTEND the file was extended KQ_NOTE_ATTRIB an attribute was changed KQ_NOTE_LINK the link count has changed KQ_NOTE_RENAME the file was renamed KQ_NOTE_REVOKE access to the file was revoked KQ_FILTER_PROC filter flags: Constant Meaning KQ_NOTE_EXIT the process has exited KQ_NOTE_FORK the process has called fork() KQ_NOTE_EXEC the process has executed a new process KQ_NOTE_PCTRLMASK internal filter flag KQ_NOTE_PDATAMASK internal filter flag KQ_NOTE_TRACK follow a process across fork() KQ_NOTE_CHILD returned on the child process for NOTE_TRACK KQ_NOTE_TRACKERR unable to attach to a child KQ_FILTER_NETDEV filter flags (not available on macOS): Constant Meaning KQ_NOTE_LINKUP link is up KQ_NOTE_LINKDOWN link is down KQ_NOTE_LINKINV link state is invalid kevent. data ¶ Filter specific data. kevent. udata ¶ User defined value. Table of Contents select — Waiting for I/O completion /dev/poll Polling Objects Edge and Level Trigger Polling (epoll) Objects Polling Objects Kqueue Objects Kevent Objects Previous topic ssl — TLS/SSL wrapper for socket objects Next topic selectors — High-level I/O multiplexing This page Report a bug Show source « Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Standard Library » Networking and Interprocess Communication » select — Waiting for I/O completion | Theme Auto Light Dark | © Copyright 2001 Python Software Foundation. This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. See History and License for more information. The Python Software Foundation is a non-profit corporation. Please donate. Last updated on Jan 13, 2026 (06:19 UTC). Found a bug ? Created using Sphinx 8.2.3. | 2026-01-13T08:48:43 |
https://www.pocketgamer.com/chicken-vs-hotdog-trickshot/review/ | Trickshot Corncob Game review - "Lots of throwing!" | Pocket Gamer Our Network Arrow Down PocketGamer.com AppSpy.com 148Apps.com PocketGamer.fr PocketGamer.biz PCGamesInsider.biz The Sims News PocketGamer.fun BlockchainGamer.biz PG Connects BigIndiePitch.com MobileGamesAwards.com U.GG Icy Veins The Sims Resource Fantasy Football Scout GameKnot Addicting Games Arcade Cloud EV.IO Menu PocketGamer.com Facebook X YouTube RSS Search Search Game Reviews Trickshot Corncob Game review - "Lots of throwing!" By Jupiter Hadley | Dec 28, 2025 iOS + Android | Chicken vs Hotdog: Trickshot Get By Jupiter Hadley | Dec 28, 2025 iOS + Android | Chicken vs Hotdog: Trickshot Twitter Facebook Reddit You do need a physical, corn thing! Flip corn in the air It's got an app Big Potato Games are known for releasing a bunch of fun, party-centred tabletop games, though they have dabbled in puzzles and video games as well! This time, they've combined a mobile app with a physical item to create something that feels super fun for a party! Their app is called Chicken vs Hotdog: Trickshot, which was the first of these types of games, but we used it with their Trickshot Corncob Game physical item, which is a giant ear of corn. This corn has a silly face and, more importantly, a suction cup on the bottom. The goal is easy: score as many points as possible! After downloading, you and your friends need to enter your names and how long you want each round to go. We set ours to 60 seconds, which felt just right, as more time would feel boring to watch and quicker wouldn't allow people to rack up points. It is worth noting that you can set the time for individual players, so if you are playing with people who are really good at it, you can give them less time to balance it out. Sengodai review - "Fantastic theming and aesthetics, but I wish it had a tad more depth" As for the mechanics, on the screen, there is an action that you need to do with the Trickshot Corncob. This could be flipping the corn with your eyes shut, doing a single flip, spinning twice and doing a flip, etc. There are tons of different moves! If you feel the move is far too difficult, you can hit skip. Different moves have different points, and getting a move and hitting Success then gives you those points. At the end of all of the players' turns, there is a leaderboard to show who has won. Someone will need to watch the phone, as with ours, the screen would darken, then close - which closed the entire app. It's that easy, really! Trickshot Corncob is a fantastic little party game, and the corncob doesn't take up too much space. We've not played with the chicken or hotdog game parts, but we can see how those different designs would bring their own challenges. We did have a fantastic time playing, cheering each other on, and watching each other land trick shots. Download now! Chicken vs Hotdog: Trickshot Trickshot Corncob Game review - "Lots of throwing!" Trickshot Corncob is a funny little app, that does require a physical item, but can make for a silly and interesting time! Jupiter Hadley Twitter Jupiter is a prolific indie game journalist with a focus on smaller indie gems. She covers thousands of game jams and indie games on her YouTube channel, letting every game have a moment in the spotlight. She runs indiegamejams.com, a calendar of all of the game jams going on in the world, and judges many jams and events. You can find her on Twitter as @Jupiter_Hadley Next Up : Monument Valley 3: The Garden of Life review - "More puzzles, interesting story" Related Tower of Fantasy tier list - Best weapons and characters for PVE and PVP iOS + Android Daily free Monopoly Go dice links (January 2026) iOS + Android The fastest cars in CSR Racing 2, in every tier iOS + Android Seven Knights Re:BIRTH tier list iOS + Android Tap Force tier list of all characters that you can pick iOS + Android Sign up! Get Pocket Gamer tips, news & features in your inbox Daily Updates Weekly Updates Your sign up will be strictly used in accordance with our Terms of Use and Privacy Policy . Get social! Facebook X YouTube RSS | 2026-01-13T08:48:44 |
https://github.com/Nixx0328 | Nixx0328 (Programmer_Ni) · GitHub Skip to content Navigation Menu Toggle navigation Sign in Appearance settings Platform AI CODE CREATION GitHub Copilot Write better code with AI GitHub Spark Build and deploy intelligent apps GitHub Models Manage and compare prompts MCP Registry New Integrate external tools DEVELOPER WORKFLOWS Actions Automate any workflow Codespaces Instant dev environments Issues Plan and track work Code Review Manage code changes APPLICATION SECURITY GitHub Advanced Security Find and fix vulnerabilities Code security Secure your code as you build Secret protection Stop leaks before they start EXPLORE Why GitHub Documentation Blog Changelog Marketplace View all features Solutions BY COMPANY SIZE Enterprises Small and medium teams Startups Nonprofits BY USE CASE App Modernization DevSecOps DevOps CI/CD View all use cases BY INDUSTRY Healthcare Financial services Manufacturing Government View all industries View all solutions Resources EXPLORE BY TOPIC AI Software Development DevOps Security View all topics EXPLORE BY TYPE Customer stories Events & webinars Ebooks & reports Business insights GitHub Skills SUPPORT & SERVICES Documentation Customer support Community forum Trust center Partners Open Source COMMUNITY GitHub Sponsors Fund open source developers PROGRAMS Security Lab Maintainer Community Accelerator Archive Program REPOSITORIES Topics Trending Collections Enterprise ENTERPRISE SOLUTIONS Enterprise platform AI-powered developer platform AVAILABLE ADD-ONS GitHub Advanced Security Enterprise-grade security features Copilot for Business Enterprise-grade AI features Premium Support Enterprise-grade 24/7 support Pricing Search or jump to... Search code, repositories, users, issues, pull requests... --> Search Clear Search syntax tips Provide feedback --> We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly --> Name Query To see all available qualifiers, see our documentation . Cancel Create saved search Sign in Sign up Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} Nixx0328 Follow Overview Repositories 6 Projects 0 Packages 0 Stars 2 More Overview Repositories Projects Packages Stars Nixx0328 Follow Programmer_Ni Nixx0328 Follow 一个爱音乐、爱编程、爱打游戏的家伙 1 follower · 0 following https://czlj.top/ https://czlj.top/home.php?mod=space&uid=2 Block or Report Block or report Nixx0328 --> Block user Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users . You must be logged in to block users. Add an optional note Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you. Block user Report abuse Contact GitHub support about this user’s behavior. Learn more about reporting abuse . Report abuse Overview Repositories 6 Projects 0 Packages 0 Stars 2 More Overview Repositories Projects Packages Stars Popular repositories Loading C-Raylib-Project-Minecraft C-Raylib-Project-Minecraft Public C++加Raylib库的实战项目 C++ 2 Nixx0328.github.io Nixx0328.github.io Public 我的博客网站 HTML 1 CPP_AI CPP_AI Public Forked from QiangAI/AI_CPlus QiangAI的AI_CPlus存储库clone:使用C++语言做AI Jupyter Notebook WebMC-by-jerrychan7 WebMC-by-jerrychan7 Public Forked from jerrychan7/WebMC A web version of Minecraft built using js and WebGL without third-party libraries. JavaScript web-js-mc--from-minecraft.xyz web-js-mc--from-minecraft.xyz Public Forked from michaljaz/webmc PoC Minecraft client written in Javascript (1.16.5 offline mode working) JavaScript my-github-hosts my-github-hosts Public Forked from maxiaof/github-hosts 通过修改Hosts解决国内Github经常抽风访问不到,每日更新 HTML Something went wrong, please refresh the page to try again. If the problem persists, check the GitHub status page or contact support . Uh oh! There was an error while loading. Please reload this page . Footer © 2026 GitHub, Inc. Footer navigation Terms Privacy Security Status Community Docs Contact Manage cookies Do not share my personal information You can’t perform that action at this time. | 2026-01-13T08:48:44 |
https://www.pocketgamer.com/cult-of-the-lamb/review/ | Cult of the Lamb review - "Pocket-sized cults!" | Pocket Gamer Our Network Arrow Down PocketGamer.com AppSpy.com 148Apps.com PocketGamer.fr PocketGamer.biz PCGamesInsider.biz The Sims News PocketGamer.fun BlockchainGamer.biz PG Connects BigIndiePitch.com MobileGamesAwards.com U.GG Icy Veins The Sims Resource Fantasy Football Scout GameKnot Addicting Games Arcade Cloud EV.IO Menu PocketGamer.com Facebook X YouTube RSS Search Search Game Reviews Cult of the Lamb review - "Pocket-sized cults!" By Jupiter Hadley | Dec 30 iOS | Cult of the Lamb Get By Jupiter Hadley | Dec 30 iOS | Cult of the Lamb Twitter Facebook Reddit Cult management simulator with lots of options Bite-sized runs that are easy to manage Lots of content! I gotta say, even before Cult of the Lamb brought itself to mobile, I already loved it on PC. I enjoyed it so much that I included it in my book, The Best Life Adventure Games . With that in mind, I wanted to see if it could hold up to mobile phones, with their smaller screens and limited buttons. For those who have not played the PC or console version, Cult of the Lamb is a sort of run-based, cult management sim that is split into two parts: looking after your cult and going into dungeons so that you can fight off a bunch of enemies and picking paths to follow towards mini-bosses or large bosses. The fighting aspect is run-based, with runs averaging about six minutes for me, so it feels like an ideal amount of time to really focus while still being on your mobile phone. The runs are simple in construction - you get a weapon at the start and then go through a bunch of procedurally generated rooms. These often have enemies in them, though sometimes they have other characters who might have tarot cards that affect that specific run or people who need saving for your cult, or just people who want to give you advice. It's interesting seeing what you end up with! After each dungeon, you can start following a path towards whatever is at the end of the run. Monument Valley 3: The Garden of Life review - "More puzzles, interesting story" Sometimes, these paths allow you to see one-shot rooms that heal you or that are markets to purchase from, for example. Sometimes, the option gives you a new cult member, and other times, you can pick an option that has a lot of a resource you might need. At the end of each run, there is a mini-boss or full boss to take on, which are often quite challenging compared to the rooms. However, you've likely levelled up your items by then and might even have a few decent stat changes, so it's not too bad! You'll be collecting resources and coins as you get through the rooms, which you can bring back to your cult. The actual fighting in Cult of the Lamb feels good on mobile. The on-screen, controller-style layout makes sense for this type of experience and is easy to interact with. The only real issue with the small screen size, for me, was when I was trying to talk to other characters. Often the text box felt very large, going over the creature's head, which doesn't really affect gameplay but isn't as polished as it might feel. When it comes to the cult aspect, you can visit your cult after your runs. There, you can make food, build new buildings (or decorations), run sermons, and interact with your followers. There is also a platform where new followers you have unlocked will appear, where you can change how they look before they are converted, which is so strange to me! Once they are in your cult, you need to make sure their needs are met, and they are being used properly to continue with your growth. The management aspect isn't too tough. On mobile, I did find the button to start building to be a little difficult to understand at first, as I primarily just wanted to tap the build place on my campground, not go up to it and tap my hand. Building items on the grid is also something to get used to - I'm not sure why I can't just tap exactly where I want each item, but otherwise, the controls feel really good. Cult of the Lamb has a bunch of quests, which do get too long. This has a little scroll bar, which isn't the end of the world, but if you complete a quest that's not at the top, it doesn't show you what you have completed and instead just pops up the quest box, which is a little strange. I do find that having these quests as goals to work towards gives a lot of direction and becomes an easy way to figure out what you are doing next, especially if you need to put it down for a bit. Cult of the Lamb is a very well-made, polished, fun cult-based management sim with a lot of general content. I do feel bringing it to mobile is a smart choice, especially with how short the runs are. The whole thing still feels fluid, and it's interesting manning decisions that affect my cult and shape my cult to work in the way I want them to. If you haven't played Cult of the Lamb for whatever reason, now's the time to get in on it, especially if you have Apple Arcade! Download now! Cult of the Lamb Cult of the Lamb review - "Pocket-sized cults!" Cult of the Lamb is a fantastic cult simulator with a lot of management and action elements to it. The port to mobile feels smooth and polished, bringing a lot of fun to this pocket-sized cult. Jupiter Hadley Twitter Jupiter is a prolific indie game journalist with a focus on smaller indie gems. She covers thousands of game jams and indie games on her YouTube channel, letting every game have a moment in the spotlight. She runs indiegamejams.com, a calendar of all of the game jams going on in the world, and judges many jams and events. You can find her on Twitter as @Jupiter_Hadley Next Up : Gunnar Roswell Alienware Glasses review - "Futuristic statement piece" Related The Wrapp - Jazz cats a-leaping, giant bugs a-slaying, and a kaiju in a pear tree iOS + Android Apple Arcade update: Power Wash Simulator, Cult of the Lamb and Naruto: Ultimate Ninja Storm arrive iOS + Apple Arcade Cult of the Lamb will soon bring eldritch horror and action to Apple Arcade iOS + Apple Arcade Ahead of the Game - Outpost Stand: Alien Rush is roguelike sci-fi survival with StarCraft-inspired bugs iOS + Android Bleach: Brave Souls is ringing in the New Year with another round of Thousand-Year Blood War Zenith Summons iOS + Android Sign up! Get Pocket Gamer tips, news & features in your inbox Daily Updates Weekly Updates Your sign up will be strictly used in accordance with our Terms of Use and Privacy Policy . Get social! Facebook X YouTube RSS | 2026-01-13T08:48:44 |
https://docs.python.org/3/tutorial/controlflow.html#positional-only-parameters | 4. More Control Flow Tools — Python 3.14.2 documentation Theme Auto Light Dark Table of Contents 4. More Control Flow Tools 4.1. if Statements 4.2. for Statements 4.3. The range() Function 4.4. break and continue Statements 4.5. else Clauses on Loops 4.6. pass Statements 4.7. match Statements 4.8. Defining Functions 4.9. More on Defining Functions 4.9.1. Default Argument Values 4.9.2. Keyword Arguments 4.9.3. Special parameters 4.9.3.1. Positional-or-Keyword Arguments 4.9.3.2. Positional-Only Parameters 4.9.3.3. Keyword-Only Arguments 4.9.3.4. Function Examples 4.9.3.5. Recap 4.9.4. Arbitrary Argument Lists 4.9.5. Unpacking Argument Lists 4.9.6. Lambda Expressions 4.9.7. Documentation Strings 4.9.8. Function Annotations 4.10. Intermezzo: Coding Style Previous topic 3. An Informal Introduction to Python Next topic 5. Data Structures This page Report a bug Show source Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 4. More Control Flow Tools | Theme Auto Light Dark | 4. More Control Flow Tools ¶ As well as the while statement just introduced, Python uses a few more that we will encounter in this chapter. 4.1. if Statements ¶ Perhaps the most well-known statement type is the if statement. For example: >>> x = int ( input ( "Please enter an integer: " )) Please enter an integer: 42 >>> if x < 0 : ... x = 0 ... print ( 'Negative changed to zero' ) ... elif x == 0 : ... print ( 'Zero' ) ... elif x == 1 : ... print ( 'Single' ) ... else : ... print ( 'More' ) ... More There can be zero or more elif parts, and the else part is optional. The keyword ‘ elif ’ is short for ‘else if’, and is useful to avoid excessive indentation. An if … elif … elif … sequence is a substitute for the switch or case statements found in other languages. If you’re comparing the same value to several constants, or checking for specific types or attributes, you may also find the match statement useful. For more details see match Statements . 4.2. for Statements ¶ The for statement in Python differs a bit from what you may be used to in C or Pascal. Rather than always iterating over an arithmetic progression of numbers (like in Pascal), or giving the user the ability to define both the iteration step and halting condition (as C), Python’s for statement iterates over the items of any sequence (a list or a string), in the order that they appear in the sequence. For example (no pun intended): >>> # Measure some strings: >>> words = [ 'cat' , 'window' , 'defenestrate' ] >>> for w in words : ... print ( w , len ( w )) ... cat 3 window 6 defenestrate 12 Code that modifies a collection while iterating over that same collection can be tricky to get right. Instead, it is usually more straight-forward to loop over a copy of the collection or to create a new collection: # Create a sample collection users = { 'Hans' : 'active' , 'Éléonore' : 'inactive' , '景太郎' : 'active' } # Strategy: Iterate over a copy for user , status in users . copy () . items (): if status == 'inactive' : del users [ user ] # Strategy: Create a new collection active_users = {} for user , status in users . items (): if status == 'active' : active_users [ user ] = status 4.3. The range() Function ¶ If you do need to iterate over a sequence of numbers, the built-in function range() comes in handy. It generates arithmetic progressions: >>> for i in range ( 5 ): ... print ( i ) ... 0 1 2 3 4 The given end point is never part of the generated sequence; range(10) generates 10 values, the legal indices for items of a sequence of length 10. It is possible to let the range start at another number, or to specify a different increment (even negative; sometimes this is called the ‘step’): >>> list ( range ( 5 , 10 )) [5, 6, 7, 8, 9] >>> list ( range ( 0 , 10 , 3 )) [0, 3, 6, 9] >>> list ( range ( - 10 , - 100 , - 30 )) [-10, -40, -70] To iterate over the indices of a sequence, you can combine range() and len() as follows: >>> a = [ 'Mary' , 'had' , 'a' , 'little' , 'lamb' ] >>> for i in range ( len ( a )): ... print ( i , a [ i ]) ... 0 Mary 1 had 2 a 3 little 4 lamb In most such cases, however, it is convenient to use the enumerate() function, see Looping Techniques . A strange thing happens if you just print a range: >>> range ( 10 ) range(0, 10) In many ways the object returned by range() behaves as if it is a list, but in fact it isn’t. It is an object which returns the successive items of the desired sequence when you iterate over it, but it doesn’t really make the list, thus saving space. We say such an object is iterable , that is, suitable as a target for functions and constructs that expect something from which they can obtain successive items until the supply is exhausted. We have seen that the for statement is such a construct, while an example of a function that takes an iterable is sum() : >>> sum ( range ( 4 )) # 0 + 1 + 2 + 3 6 Later we will see more functions that return iterables and take iterables as arguments. In chapter Data Structures , we will discuss in more detail about list() . 4.4. break and continue Statements ¶ The break statement breaks out of the innermost enclosing for or while loop: >>> for n in range ( 2 , 10 ): ... for x in range ( 2 , n ): ... if n % x == 0 : ... print ( f " { n } equals { x } * { n // x } " ) ... break ... 4 equals 2 * 2 6 equals 2 * 3 8 equals 2 * 4 9 equals 3 * 3 The continue statement continues with the next iteration of the loop: >>> for num in range ( 2 , 10 ): ... if num % 2 == 0 : ... print ( f "Found an even number { num } " ) ... continue ... print ( f "Found an odd number { num } " ) ... Found an even number 2 Found an odd number 3 Found an even number 4 Found an odd number 5 Found an even number 6 Found an odd number 7 Found an even number 8 Found an odd number 9 4.5. else Clauses on Loops ¶ In a for or while loop the break statement may be paired with an else clause. If the loop finishes without executing the break , the else clause executes. In a for loop, the else clause is executed after the loop finishes its final iteration, that is, if no break occurred. In a while loop, it’s executed after the loop’s condition becomes false. In either kind of loop, the else clause is not executed if the loop was terminated by a break . Of course, other ways of ending the loop early, such as a return or a raised exception, will also skip execution of the else clause. This is exemplified in the following for loop, which searches for prime numbers: >>> for n in range ( 2 , 10 ): ... for x in range ( 2 , n ): ... if n % x == 0 : ... print ( n , 'equals' , x , '*' , n // x ) ... break ... else : ... # loop fell through without finding a factor ... print ( n , 'is a prime number' ) ... 2 is a prime number 3 is a prime number 4 equals 2 * 2 5 is a prime number 6 equals 2 * 3 7 is a prime number 8 equals 2 * 4 9 equals 3 * 3 (Yes, this is the correct code. Look closely: the else clause belongs to the for loop, not the if statement.) One way to think of the else clause is to imagine it paired with the if inside the loop. As the loop executes, it will run a sequence like if/if/if/else. The if is inside the loop, encountered a number of times. If the condition is ever true, a break will happen. If the condition is never true, the else clause outside the loop will execute. When used with a loop, the else clause has more in common with the else clause of a try statement than it does with that of if statements: a try statement’s else clause runs when no exception occurs, and a loop’s else clause runs when no break occurs. For more on the try statement and exceptions, see Handling Exceptions . 4.6. pass Statements ¶ The pass statement does nothing. It can be used when a statement is required syntactically but the program requires no action. For example: >>> while True : ... pass # Busy-wait for keyboard interrupt (Ctrl+C) ... This is commonly used for creating minimal classes: >>> class MyEmptyClass : ... pass ... Another place pass can be used is as a place-holder for a function or conditional body when you are working on new code, allowing you to keep thinking at a more abstract level. The pass is silently ignored: >>> def initlog ( * args ): ... pass # Remember to implement this! ... For this last case, many people use the ellipsis literal ... instead of pass . This use has no special meaning to Python, and is not part of the language definition (you could use any constant expression here), but ... is used conventionally as a placeholder body as well. See The Ellipsis Object . 4.7. match Statements ¶ A match statement takes an expression and compares its value to successive patterns given as one or more case blocks. This is superficially similar to a switch statement in C, Java or JavaScript (and many other languages), but it’s more similar to pattern matching in languages like Rust or Haskell. Only the first pattern that matches gets executed and it can also extract components (sequence elements or object attributes) from the value into variables. If no case matches, none of the branches is executed. The simplest form compares a subject value against one or more literals: def http_error ( status ): match status : case 400 : return "Bad request" case 404 : return "Not found" case 418 : return "I'm a teapot" case _ : return "Something's wrong with the internet" Note the last block: the “variable name” _ acts as a wildcard and never fails to match. You can combine several literals in a single pattern using | (“or”): case 401 | 403 | 404 : return "Not allowed" Patterns can look like unpacking assignments, and can be used to bind variables: # point is an (x, y) tuple match point : case ( 0 , 0 ): print ( "Origin" ) case ( 0 , y ): print ( f "Y= { y } " ) case ( x , 0 ): print ( f "X= { x } " ) case ( x , y ): print ( f "X= { x } , Y= { y } " ) case _ : raise ValueError ( "Not a point" ) Study that one carefully! The first pattern has two literals, and can be thought of as an extension of the literal pattern shown above. But the next two patterns combine a literal and a variable, and the variable binds a value from the subject ( point ). The fourth pattern captures two values, which makes it conceptually similar to the unpacking assignment (x, y) = point . If you are using classes to structure your data you can use the class name followed by an argument list resembling a constructor, but with the ability to capture attributes into variables: class Point : def __init__ ( self , x , y ): self . x = x self . y = y def where_is ( point ): match point : case Point ( x = 0 , y = 0 ): print ( "Origin" ) case Point ( x = 0 , y = y ): print ( f "Y= { y } " ) case Point ( x = x , y = 0 ): print ( f "X= { x } " ) case Point (): print ( "Somewhere else" ) case _ : print ( "Not a point" ) You can use positional parameters with some builtin classes that provide an ordering for their attributes (e.g. dataclasses). You can also define a specific position for attributes in patterns by setting the __match_args__ special attribute in your classes. If it’s set to (“x”, “y”), the following patterns are all equivalent (and all bind the y attribute to the var variable): Point ( 1 , var ) Point ( 1 , y = var ) Point ( x = 1 , y = var ) Point ( y = var , x = 1 ) A recommended way to read patterns is to look at them as an extended form of what you would put on the left of an assignment, to understand which variables would be set to what. Only the standalone names (like var above) are assigned to by a match statement. Dotted names (like foo.bar ), attribute names (the x= and y= above) or class names (recognized by the “(…)” next to them like Point above) are never assigned to. Patterns can be arbitrarily nested. For example, if we have a short list of Points, with __match_args__ added, we could match it like this: class Point : __match_args__ = ( 'x' , 'y' ) def __init__ ( self , x , y ): self . x = x self . y = y match points : case []: print ( "No points" ) case [ Point ( 0 , 0 )]: print ( "The origin" ) case [ Point ( x , y )]: print ( f "Single point { x } , { y } " ) case [ Point ( 0 , y1 ), Point ( 0 , y2 )]: print ( f "Two on the Y axis at { y1 } , { y2 } " ) case _ : print ( "Something else" ) We can add an if clause to a pattern, known as a “guard”. If the guard is false, match goes on to try the next case block. Note that value capture happens before the guard is evaluated: match point : case Point ( x , y ) if x == y : print ( f "Y=X at { x } " ) case Point ( x , y ): print ( f "Not on the diagonal" ) Several other key features of this statement: Like unpacking assignments, tuple and list patterns have exactly the same meaning and actually match arbitrary sequences. An important exception is that they don’t match iterators or strings. Sequence patterns support extended unpacking: [x, y, *rest] and (x, y, *rest) work similar to unpacking assignments. The name after * may also be _ , so (x, y, *_) matches a sequence of at least two items without binding the remaining items. Mapping patterns: {"bandwidth": b, "latency": l} captures the "bandwidth" and "latency" values from a dictionary. Unlike sequence patterns, extra keys are ignored. An unpacking like **rest is also supported. (But **_ would be redundant, so it is not allowed.) Subpatterns may be captured using the as keyword: case ( Point ( x1 , y1 ), Point ( x2 , y2 ) as p2 ): ... will capture the second element of the input as p2 (as long as the input is a sequence of two points) Most literals are compared by equality, however the singletons True , False and None are compared by identity. Patterns may use named constants. These must be dotted names to prevent them from being interpreted as capture variable: from enum import Enum class Color ( Enum ): RED = 'red' GREEN = 'green' BLUE = 'blue' color = Color ( input ( "Enter your choice of 'red', 'blue' or 'green': " )) match color : case Color . RED : print ( "I see red!" ) case Color . GREEN : print ( "Grass is green" ) case Color . BLUE : print ( "I'm feeling the blues :(" ) For a more detailed explanation and additional examples, you can look into PEP 636 which is written in a tutorial format. 4.8. Defining Functions ¶ We can create a function that writes the Fibonacci series to an arbitrary boundary: >>> def fib ( n ): # write Fibonacci series less than n ... """Print a Fibonacci series less than n.""" ... a , b = 0 , 1 ... while a < n : ... print ( a , end = ' ' ) ... a , b = b , a + b ... print () ... >>> # Now call the function we just defined: >>> fib ( 2000 ) 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 The keyword def introduces a function definition . It must be followed by the function name and the parenthesized list of formal parameters. The statements that form the body of the function start at the next line, and must be indented. The first statement of the function body can optionally be a string literal; this string literal is the function’s documentation string, or docstring . (More about docstrings can be found in the section Documentation Strings .) There are tools which use docstrings to automatically produce online or printed documentation, or to let the user interactively browse through code; it’s good practice to include docstrings in code that you write, so make a habit of it. The execution of a function introduces a new symbol table used for the local variables of the function. More precisely, all variable assignments in a function store the value in the local symbol table; whereas variable references first look in the local symbol table, then in the local symbol tables of enclosing functions, then in the global symbol table, and finally in the table of built-in names. Thus, global variables and variables of enclosing functions cannot be directly assigned a value within a function (unless, for global variables, named in a global statement, or, for variables of enclosing functions, named in a nonlocal statement), although they may be referenced. The actual parameters (arguments) to a function call are introduced in the local symbol table of the called function when it is called; thus, arguments are passed using call by value (where the value is always an object reference , not the value of the object). [ 1 ] When a function calls another function, or calls itself recursively, a new local symbol table is created for that call. A function definition associates the function name with the function object in the current symbol table. The interpreter recognizes the object pointed to by that name as a user-defined function. Other names can also point to that same function object and can also be used to access the function: >>> fib <function fib at 10042ed0> >>> f = fib >>> f ( 100 ) 0 1 1 2 3 5 8 13 21 34 55 89 Coming from other languages, you might object that fib is not a function but a procedure since it doesn’t return a value. In fact, even functions without a return statement do return a value, albeit a rather boring one. This value is called None (it’s a built-in name). Writing the value None is normally suppressed by the interpreter if it would be the only value written. You can see it if you really want to using print() : >>> fib ( 0 ) >>> print ( fib ( 0 )) None It is simple to write a function that returns a list of the numbers of the Fibonacci series, instead of printing it: >>> def fib2 ( n ): # return Fibonacci series up to n ... """Return a list containing the Fibonacci series up to n.""" ... result = [] ... a , b = 0 , 1 ... while a < n : ... result . append ( a ) # see below ... a , b = b , a + b ... return result ... >>> f100 = fib2 ( 100 ) # call it >>> f100 # write the result [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] 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 . The statement result.append(a) calls a method of the list object result . A method is a function that ‘belongs’ to an object and is named obj.methodname , where obj is some object (this may be an expression), and methodname is the name of a method that is defined by the object’s type. Different types define different methods. Methods of different types may have the same name without causing ambiguity. (It is possible to define your own object types and methods, using classes , see Classes ) The method append() shown in the example is defined for list objects; it adds a new element at the end of the list. In this example it is equivalent to result = result + [a] , but more efficient. 4.9. More on Defining Functions ¶ It is also possible to define functions with a variable number of arguments. There are three forms, which can be combined. 4.9.1. Default Argument Values ¶ The most useful form is to specify a default value for one or more arguments. This creates a function that can be called with fewer arguments than it is defined to allow. For example: def ask_ok ( prompt , retries = 4 , reminder = 'Please try again!' ): while True : reply = input ( prompt ) if reply in { 'y' , 'ye' , 'yes' }: return True if reply in { 'n' , 'no' , 'nop' , 'nope' }: return False retries = retries - 1 if retries < 0 : raise ValueError ( 'invalid user response' ) print ( reminder ) This function can be called in several ways: giving only the mandatory argument: ask_ok('Do you really want to quit?') giving one of the optional arguments: ask_ok('OK to overwrite the file?', 2) or even giving all arguments: ask_ok('OK to overwrite the file?', 2, 'Come on, only yes or no!') This example also introduces the in keyword. This tests whether or not a sequence contains a certain value. The default values are evaluated at the point of function definition in the defining scope, so that i = 5 def f ( arg = i ): print ( arg ) i = 6 f () will print 5 . Important warning: The default value is evaluated only once. This makes a difference when the default is a mutable object such as a list, dictionary, or instances of most classes. For example, the following function accumulates the arguments passed to it on subsequent calls: def f ( a , L = []): L . append ( a ) return L print ( f ( 1 )) print ( f ( 2 )) print ( f ( 3 )) This will print [ 1 ] [ 1 , 2 ] [ 1 , 2 , 3 ] If you don’t want the default to be shared between subsequent calls, you can write the function like this instead: def f ( a , L = None ): if L is None : L = [] L . append ( a ) return L 4.9.2. Keyword Arguments ¶ Functions can also be called using keyword arguments of the form kwarg=value . For instance, the following function: def parrot ( voltage , state = 'a stiff' , action = 'voom' , type = 'Norwegian Blue' ): print ( "-- This parrot wouldn't" , action , end = ' ' ) print ( "if you put" , voltage , "volts through it." ) print ( "-- Lovely plumage, the" , type ) print ( "-- It's" , state , "!" ) accepts one required argument ( voltage ) and three optional arguments ( state , action , and type ). This function can be called in any of the following ways: parrot ( 1000 ) # 1 positional argument parrot ( voltage = 1000 ) # 1 keyword argument parrot ( voltage = 1000000 , action = 'VOOOOOM' ) # 2 keyword arguments parrot ( action = 'VOOOOOM' , voltage = 1000000 ) # 2 keyword arguments parrot ( 'a million' , 'bereft of life' , 'jump' ) # 3 positional arguments parrot ( 'a thousand' , state = 'pushing up the daisies' ) # 1 positional, 1 keyword but all the following calls would be invalid: parrot () # required argument missing parrot ( voltage = 5.0 , 'dead' ) # non-keyword argument after a keyword argument parrot ( 110 , voltage = 220 ) # duplicate value for the same argument parrot ( actor = 'John Cleese' ) # unknown keyword argument In a function call, keyword arguments must follow positional arguments. All the keyword arguments passed must match one of the arguments accepted by the function (e.g. actor is not a valid argument for the parrot function), and their order is not important. This also includes non-optional arguments (e.g. parrot(voltage=1000) is valid too). No argument may receive a value more than once. Here’s an example that fails due to this restriction: >>> def function ( a ): ... pass ... >>> function ( 0 , a = 0 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : function() got multiple values for argument 'a' When a final formal parameter of the form **name is present, it receives a dictionary (see Mapping Types — dict ) containing all keyword arguments except for those corresponding to a formal parameter. This may be combined with a formal parameter of the form *name (described in the next subsection) which receives a tuple containing the positional arguments beyond the formal parameter list. ( *name must occur before **name .) For example, if we define a function like this: def cheeseshop ( kind , * arguments , ** keywords ): print ( "-- Do you have any" , kind , "?" ) print ( "-- I'm sorry, we're all out of" , kind ) for arg in arguments : print ( arg ) print ( "-" * 40 ) for kw in keywords : print ( kw , ":" , keywords [ kw ]) It could be called like this: cheeseshop ( "Limburger" , "It's very runny, sir." , "It's really very, VERY runny, sir." , shopkeeper = "Michael Palin" , client = "John Cleese" , sketch = "Cheese Shop Sketch" ) and of course it would print: -- Do you have any Limburger ? -- I'm sorry, we're all out of Limburger It's very runny, sir. It's really very, VERY runny, sir. ---------------------------------------- shopkeeper : Michael Palin client : John Cleese sketch : Cheese Shop Sketch Note that the order in which the keyword arguments are printed is guaranteed to match the order in which they were provided in the function call. 4.9.3. Special parameters ¶ By default, arguments may be passed to a Python function either by position or explicitly by keyword. For readability and performance, it makes sense to restrict the way arguments can be passed so that a developer need only look at the function definition to determine if items are passed by position, by position or keyword, or by keyword. A function definition may look like: def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2): ----------- ---------- ---------- | | | | Positional or keyword | | - Keyword only -- Positional only where / and * are optional. If used, these symbols indicate the kind of parameter by how the arguments may be passed to the function: positional-only, positional-or-keyword, and keyword-only. Keyword parameters are also referred to as named parameters. 4.9.3.1. Positional-or-Keyword Arguments ¶ If / and * are not present in the function definition, arguments may be passed to a function by position or by keyword. 4.9.3.2. Positional-Only Parameters ¶ Looking at this in a bit more detail, it is possible to mark certain parameters as positional-only . If positional-only , the parameters’ order matters, and the parameters cannot be passed by keyword. Positional-only parameters are placed before a / (forward-slash). The / is used to logically separate the positional-only parameters from the rest of the parameters. If there is no / in the function definition, there are no positional-only parameters. Parameters following the / may be positional-or-keyword or keyword-only . 4.9.3.3. Keyword-Only Arguments ¶ To mark parameters as keyword-only , indicating the parameters must be passed by keyword argument, place an * in the arguments list just before the first keyword-only parameter. 4.9.3.4. Function Examples ¶ Consider the following example function definitions paying close attention to the markers / and * : >>> def standard_arg ( arg ): ... print ( arg ) ... >>> def pos_only_arg ( arg , / ): ... print ( arg ) ... >>> def kwd_only_arg ( * , arg ): ... print ( arg ) ... >>> def combined_example ( pos_only , / , standard , * , kwd_only ): ... print ( pos_only , standard , kwd_only ) The first function definition, standard_arg , the most familiar form, places no restrictions on the calling convention and arguments may be passed by position or keyword: >>> standard_arg ( 2 ) 2 >>> standard_arg ( arg = 2 ) 2 The second function pos_only_arg is restricted to only use positional parameters as there is a / in the function definition: >>> pos_only_arg ( 1 ) 1 >>> pos_only_arg ( arg = 1 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : pos_only_arg() got some positional-only arguments passed as keyword arguments: 'arg' The third function kwd_only_arg only allows keyword arguments as indicated by a * in the function definition: >>> kwd_only_arg ( 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : kwd_only_arg() takes 0 positional arguments but 1 was given >>> kwd_only_arg ( arg = 3 ) 3 And the last uses all three calling conventions in the same function definition: >>> combined_example ( 1 , 2 , 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : combined_example() takes 2 positional arguments but 3 were given >>> combined_example ( 1 , 2 , kwd_only = 3 ) 1 2 3 >>> combined_example ( 1 , standard = 2 , kwd_only = 3 ) 1 2 3 >>> combined_example ( pos_only = 1 , standard = 2 , kwd_only = 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : combined_example() got some positional-only arguments passed as keyword arguments: 'pos_only' Finally, consider this function definition which has a potential collision between the positional argument name and **kwds which has name as a key: def foo ( name , ** kwds ): return 'name' in kwds There is no possible call that will make it return True as the keyword 'name' will always bind to the first parameter. For example: >>> foo ( 1 , ** { 'name' : 2 }) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : foo() got multiple values for argument 'name' >>> But using / (positional only arguments), it is possible since it allows name as a positional argument and 'name' as a key in the keyword arguments: >>> def foo ( name , / , ** kwds ): ... return 'name' in kwds ... >>> foo ( 1 , ** { 'name' : 2 }) True In other words, the names of positional-only parameters can be used in **kwds without ambiguity. 4.9.3.5. Recap ¶ The use case will determine which parameters to use in the function definition: def f ( pos1 , pos2 , / , pos_or_kwd , * , kwd1 , kwd2 ): As guidance: Use positional-only if you want the name of the parameters to not be available to the user. This is useful when parameter names have no real meaning, if you want to enforce the order of the arguments when the function is called or if you need to take some positional parameters and arbitrary keywords. Use keyword-only when names have meaning and the function definition is more understandable by being explicit with names or you want to prevent users relying on the position of the argument being passed. For an API, use positional-only to prevent breaking API changes if the parameter’s name is modified in the future. 4.9.4. Arbitrary Argument Lists ¶ Finally, the least frequently used option is to specify that a function can be called with an arbitrary number of arguments. These arguments will be wrapped up in a tuple (see Tuples and Sequences ). Before the variable number of arguments, zero or more normal arguments may occur. def write_multiple_items ( file , separator , * args ): file . write ( separator . join ( args )) Normally, these variadic arguments will be last in the list of formal parameters, because they scoop up all remaining input arguments that are passed to the function. Any formal parameters which occur after the *args parameter are ‘keyword-only’ arguments, meaning that they can only be used as keywords rather than positional arguments. >>> def concat ( * args , sep = "/" ): ... return sep . join ( args ) ... >>> concat ( "earth" , "mars" , "venus" ) 'earth/mars/venus' >>> concat ( "earth" , "mars" , "venus" , sep = "." ) 'earth.mars.venus' 4.9.5. Unpacking Argument Lists ¶ The reverse situation occurs when the arguments are already in a list or tuple but need to be unpacked for a function call requiring separate positional arguments. For instance, the built-in range() function expects separate start and stop arguments. If they are not available separately, write the function call with the * -operator to unpack the arguments out of a list or tuple: >>> list ( range ( 3 , 6 )) # normal call with separate arguments [3, 4, 5] >>> args = [ 3 , 6 ] >>> list ( range ( * args )) # call with arguments unpacked from a list [3, 4, 5] In the same fashion, dictionaries can deliver keyword arguments with the ** -operator: >>> def parrot ( voltage , state = 'a stiff' , action = 'voom' ): ... print ( "-- This parrot wouldn't" , action , end = ' ' ) ... print ( "if you put" , voltage , "volts through it." , end = ' ' ) ... print ( "E's" , state , "!" ) ... >>> d = { "voltage" : "four million" , "state" : "bleedin' demised" , "action" : "VOOM" } >>> parrot ( ** d ) -- This parrot wouldn't VOOM if you put four million volts through it. E's bleedin' demised ! 4.9.6. Lambda Expressions ¶ Small anonymous functions can be created with the lambda keyword. This function returns the sum of its two arguments: lambda a, b: a+b . Lambda functions can be used wherever function objects are required. They are syntactically restricted to a single expression. Semantically, they are just syntactic sugar for a normal function definition. Like nested function definitions, lambda functions can reference variables from the containing scope: >>> def make_incrementor ( n ): ... return lambda x : x + n ... >>> f = make_incrementor ( 42 ) >>> f ( 0 ) 42 >>> f ( 1 ) 43 The above example uses a lambda expression to return a function. Another use is to pass a small function as an argument. For instance, list.sort() takes a sorting key function key which can be a lambda function: >>> pairs = [( 1 , 'one' ), ( 2 , 'two' ), ( 3 , 'three' ), ( 4 , 'four' )] >>> pairs . sort ( key = lambda pair : pair [ 1 ]) >>> pairs [(4, 'four'), (1, 'one'), (3, 'three'), (2, 'two')] 4.9.7. Documentation Strings ¶ Here are some conventions about the content and formatting of documentation strings. The first line should always be a short, concise summary of the object’s purpose. For brevity, it should not explicitly state the object’s name or type, since these are available by other means (except if the name happens to be a verb describing a function’s operation). This line should begin with a capital letter and end with a period. If there are more lines in the documentation string, the second line should be blank, visually separating the summary from the rest of the description. The following lines should be one or more paragraphs describing the object’s calling conventions, its side effects, etc. The Python parser strips indentation from multi-line string literals when they serve as module, class, or function docstrings. Here is an example of a multi-line docstring: >>> def my_function (): ... """Do nothing, but document it. ... ... No, really, it doesn't do anything: ... ... >>> my_function() ... >>> ... """ ... pass ... >>> print ( my_function . __doc__ ) Do nothing, but document it. No, really, it doesn't do anything: >>> my_function() >>> 4.9.8. Function Annotations ¶ Function annotations are completely optional metadata information about the types used by user-defined functions (see PEP 3107 and PEP 484 for more information). Annotations are stored in the __annotations__ attribute of the function as a dictionary and have no effect on any other part of the function. Parameter annotations are defined by a colon after the parameter name, followed by an expression evaluating to the value of the annotation. Return annotations are defined by a literal -> , followed by an expression, between the parameter list and the colon denoting the end of the def statement. The following example has a required argument, an optional argument, and the return value annotated: >>> def f ( ham : str , eggs : str = 'eggs' ) -> str : ... print ( "Annotations:" , f . __annotations__ ) ... print ( "Arguments:" , ham , eggs ) ... return ham + ' and ' + eggs ... >>> f ( 'spam' ) Annotations: {'ham': <class 'str'>, 'return': <class 'str'>, 'eggs': <class 'str'>} Arguments: spam eggs 'spam and eggs' 4.10. Intermezzo: Coding Style ¶ Now that you are about to write longer, more complex pieces of Python, it is a good time to talk about coding style . Most languages can be written (or more concise, formatted ) in different styles; some are more readable than others. Making it easy for others to read your code is always a good idea, and adopting a nice coding style helps tremendously for that. For Python, PEP 8 has emerged as the style guide that most projects adhere to; it promotes a very readable and eye-pleasing coding style. Every Python developer should read it at some point; here are the most important points extracted for you: Use 4-space indentation, and no tabs. 4 spaces are a good compromise between small indentation (allows greater nesting depth) and large indentation (easier to read). Tabs introduce confusion, and are best left out. Wrap lines so that they don’t exceed 79 characters. This helps users with small displays and makes it possible to have several code files side-by-side on larger displays. Use blank lines to separate functions and classes, and larger blocks of code inside functions. When possible, put comments on a line of their own. Use docstrings. Use spaces around operators and after commas, but not directly inside bracketing constructs: a = f(1, 2) + g(3, 4) . Name your classes and functions consistently; the convention is to use UpperCamelCase for classes and lowercase_with_underscores for functions and methods. Always use self as the name for the first method argument (see A First Look at Classes for more on classes and methods). Don’t use fancy encodings if your code is meant to be used in international environments. Python’s default, UTF-8, or even plain ASCII work best in any case. Likewise, don’t use non-ASCII characters in identifiers if there is only the slightest chance people speaking a different language will read or maintain the code. Footnotes [ 1 ] Actually, call by object reference would be a better description, since if a mutable object is passed, the caller will see any changes the callee makes to it (items inserted into a list). Table of Contents 4. More Control Flow Tools 4.1. if Statements 4.2. for Statements 4.3. The range() Function 4.4. break and continue Statements 4.5. else Clauses on Loops 4.6. pass Statements 4.7. match Statements 4.8. Defining Functions 4.9. More on Defining Functions 4.9.1. Default Argument Values 4.9.2. Keyword Arguments 4.9.3. Special parameters 4.9.3.1. Positional-or-Keyword Arguments 4.9.3.2. Positional-Only Parameters 4.9.3.3. Keyword-Only Arguments 4.9.3.4. Function Examples 4.9.3.5. Recap 4.9.4. Arbitrary Argument Lists 4.9.5. Unpacking Argument Lists 4.9.6. Lambda Expressions 4.9.7. Documentation Strings 4.9.8. Function Annotations 4.10. Intermezzo: Coding Style Previous topic 3. An Informal Introduction to Python Next topic 5. Data Structures This page Report a bug Show source « Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 4. More Control Flow Tools | Theme Auto Light Dark | © Copyright 2001 Python Software Foundation. This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. See History and License for more information. The Python Software Foundation is a non-profit corporation. Please donate. Last updated on Jan 13, 2026 (06:19 UTC). Found a bug ? Created using Sphinx 8.2.3. | 2026-01-13T08:48:44 |
https://docs.python.org/3/tutorial/controlflow.html#else-clauses-on-loops | 4. More Control Flow Tools — Python 3.14.2 documentation Theme Auto Light Dark Table of Contents 4. More Control Flow Tools 4.1. if Statements 4.2. for Statements 4.3. The range() Function 4.4. break and continue Statements 4.5. else Clauses on Loops 4.6. pass Statements 4.7. match Statements 4.8. Defining Functions 4.9. More on Defining Functions 4.9.1. Default Argument Values 4.9.2. Keyword Arguments 4.9.3. Special parameters 4.9.3.1. Positional-or-Keyword Arguments 4.9.3.2. Positional-Only Parameters 4.9.3.3. Keyword-Only Arguments 4.9.3.4. Function Examples 4.9.3.5. Recap 4.9.4. Arbitrary Argument Lists 4.9.5. Unpacking Argument Lists 4.9.6. Lambda Expressions 4.9.7. Documentation Strings 4.9.8. Function Annotations 4.10. Intermezzo: Coding Style Previous topic 3. An Informal Introduction to Python Next topic 5. Data Structures This page Report a bug Show source Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 4. More Control Flow Tools | Theme Auto Light Dark | 4. More Control Flow Tools ¶ As well as the while statement just introduced, Python uses a few more that we will encounter in this chapter. 4.1. if Statements ¶ Perhaps the most well-known statement type is the if statement. For example: >>> x = int ( input ( "Please enter an integer: " )) Please enter an integer: 42 >>> if x < 0 : ... x = 0 ... print ( 'Negative changed to zero' ) ... elif x == 0 : ... print ( 'Zero' ) ... elif x == 1 : ... print ( 'Single' ) ... else : ... print ( 'More' ) ... More There can be zero or more elif parts, and the else part is optional. The keyword ‘ elif ’ is short for ‘else if’, and is useful to avoid excessive indentation. An if … elif … elif … sequence is a substitute for the switch or case statements found in other languages. If you’re comparing the same value to several constants, or checking for specific types or attributes, you may also find the match statement useful. For more details see match Statements . 4.2. for Statements ¶ The for statement in Python differs a bit from what you may be used to in C or Pascal. Rather than always iterating over an arithmetic progression of numbers (like in Pascal), or giving the user the ability to define both the iteration step and halting condition (as C), Python’s for statement iterates over the items of any sequence (a list or a string), in the order that they appear in the sequence. For example (no pun intended): >>> # Measure some strings: >>> words = [ 'cat' , 'window' , 'defenestrate' ] >>> for w in words : ... print ( w , len ( w )) ... cat 3 window 6 defenestrate 12 Code that modifies a collection while iterating over that same collection can be tricky to get right. Instead, it is usually more straight-forward to loop over a copy of the collection or to create a new collection: # Create a sample collection users = { 'Hans' : 'active' , 'Éléonore' : 'inactive' , '景太郎' : 'active' } # Strategy: Iterate over a copy for user , status in users . copy () . items (): if status == 'inactive' : del users [ user ] # Strategy: Create a new collection active_users = {} for user , status in users . items (): if status == 'active' : active_users [ user ] = status 4.3. The range() Function ¶ If you do need to iterate over a sequence of numbers, the built-in function range() comes in handy. It generates arithmetic progressions: >>> for i in range ( 5 ): ... print ( i ) ... 0 1 2 3 4 The given end point is never part of the generated sequence; range(10) generates 10 values, the legal indices for items of a sequence of length 10. It is possible to let the range start at another number, or to specify a different increment (even negative; sometimes this is called the ‘step’): >>> list ( range ( 5 , 10 )) [5, 6, 7, 8, 9] >>> list ( range ( 0 , 10 , 3 )) [0, 3, 6, 9] >>> list ( range ( - 10 , - 100 , - 30 )) [-10, -40, -70] To iterate over the indices of a sequence, you can combine range() and len() as follows: >>> a = [ 'Mary' , 'had' , 'a' , 'little' , 'lamb' ] >>> for i in range ( len ( a )): ... print ( i , a [ i ]) ... 0 Mary 1 had 2 a 3 little 4 lamb In most such cases, however, it is convenient to use the enumerate() function, see Looping Techniques . A strange thing happens if you just print a range: >>> range ( 10 ) range(0, 10) In many ways the object returned by range() behaves as if it is a list, but in fact it isn’t. It is an object which returns the successive items of the desired sequence when you iterate over it, but it doesn’t really make the list, thus saving space. We say such an object is iterable , that is, suitable as a target for functions and constructs that expect something from which they can obtain successive items until the supply is exhausted. We have seen that the for statement is such a construct, while an example of a function that takes an iterable is sum() : >>> sum ( range ( 4 )) # 0 + 1 + 2 + 3 6 Later we will see more functions that return iterables and take iterables as arguments. In chapter Data Structures , we will discuss in more detail about list() . 4.4. break and continue Statements ¶ The break statement breaks out of the innermost enclosing for or while loop: >>> for n in range ( 2 , 10 ): ... for x in range ( 2 , n ): ... if n % x == 0 : ... print ( f " { n } equals { x } * { n // x } " ) ... break ... 4 equals 2 * 2 6 equals 2 * 3 8 equals 2 * 4 9 equals 3 * 3 The continue statement continues with the next iteration of the loop: >>> for num in range ( 2 , 10 ): ... if num % 2 == 0 : ... print ( f "Found an even number { num } " ) ... continue ... print ( f "Found an odd number { num } " ) ... Found an even number 2 Found an odd number 3 Found an even number 4 Found an odd number 5 Found an even number 6 Found an odd number 7 Found an even number 8 Found an odd number 9 4.5. else Clauses on Loops ¶ In a for or while loop the break statement may be paired with an else clause. If the loop finishes without executing the break , the else clause executes. In a for loop, the else clause is executed after the loop finishes its final iteration, that is, if no break occurred. In a while loop, it’s executed after the loop’s condition becomes false. In either kind of loop, the else clause is not executed if the loop was terminated by a break . Of course, other ways of ending the loop early, such as a return or a raised exception, will also skip execution of the else clause. This is exemplified in the following for loop, which searches for prime numbers: >>> for n in range ( 2 , 10 ): ... for x in range ( 2 , n ): ... if n % x == 0 : ... print ( n , 'equals' , x , '*' , n // x ) ... break ... else : ... # loop fell through without finding a factor ... print ( n , 'is a prime number' ) ... 2 is a prime number 3 is a prime number 4 equals 2 * 2 5 is a prime number 6 equals 2 * 3 7 is a prime number 8 equals 2 * 4 9 equals 3 * 3 (Yes, this is the correct code. Look closely: the else clause belongs to the for loop, not the if statement.) One way to think of the else clause is to imagine it paired with the if inside the loop. As the loop executes, it will run a sequence like if/if/if/else. The if is inside the loop, encountered a number of times. If the condition is ever true, a break will happen. If the condition is never true, the else clause outside the loop will execute. When used with a loop, the else clause has more in common with the else clause of a try statement than it does with that of if statements: a try statement’s else clause runs when no exception occurs, and a loop’s else clause runs when no break occurs. For more on the try statement and exceptions, see Handling Exceptions . 4.6. pass Statements ¶ The pass statement does nothing. It can be used when a statement is required syntactically but the program requires no action. For example: >>> while True : ... pass # Busy-wait for keyboard interrupt (Ctrl+C) ... This is commonly used for creating minimal classes: >>> class MyEmptyClass : ... pass ... Another place pass can be used is as a place-holder for a function or conditional body when you are working on new code, allowing you to keep thinking at a more abstract level. The pass is silently ignored: >>> def initlog ( * args ): ... pass # Remember to implement this! ... For this last case, many people use the ellipsis literal ... instead of pass . This use has no special meaning to Python, and is not part of the language definition (you could use any constant expression here), but ... is used conventionally as a placeholder body as well. See The Ellipsis Object . 4.7. match Statements ¶ A match statement takes an expression and compares its value to successive patterns given as one or more case blocks. This is superficially similar to a switch statement in C, Java or JavaScript (and many other languages), but it’s more similar to pattern matching in languages like Rust or Haskell. Only the first pattern that matches gets executed and it can also extract components (sequence elements or object attributes) from the value into variables. If no case matches, none of the branches is executed. The simplest form compares a subject value against one or more literals: def http_error ( status ): match status : case 400 : return "Bad request" case 404 : return "Not found" case 418 : return "I'm a teapot" case _ : return "Something's wrong with the internet" Note the last block: the “variable name” _ acts as a wildcard and never fails to match. You can combine several literals in a single pattern using | (“or”): case 401 | 403 | 404 : return "Not allowed" Patterns can look like unpacking assignments, and can be used to bind variables: # point is an (x, y) tuple match point : case ( 0 , 0 ): print ( "Origin" ) case ( 0 , y ): print ( f "Y= { y } " ) case ( x , 0 ): print ( f "X= { x } " ) case ( x , y ): print ( f "X= { x } , Y= { y } " ) case _ : raise ValueError ( "Not a point" ) Study that one carefully! The first pattern has two literals, and can be thought of as an extension of the literal pattern shown above. But the next two patterns combine a literal and a variable, and the variable binds a value from the subject ( point ). The fourth pattern captures two values, which makes it conceptually similar to the unpacking assignment (x, y) = point . If you are using classes to structure your data you can use the class name followed by an argument list resembling a constructor, but with the ability to capture attributes into variables: class Point : def __init__ ( self , x , y ): self . x = x self . y = y def where_is ( point ): match point : case Point ( x = 0 , y = 0 ): print ( "Origin" ) case Point ( x = 0 , y = y ): print ( f "Y= { y } " ) case Point ( x = x , y = 0 ): print ( f "X= { x } " ) case Point (): print ( "Somewhere else" ) case _ : print ( "Not a point" ) You can use positional parameters with some builtin classes that provide an ordering for their attributes (e.g. dataclasses). You can also define a specific position for attributes in patterns by setting the __match_args__ special attribute in your classes. If it’s set to (“x”, “y”), the following patterns are all equivalent (and all bind the y attribute to the var variable): Point ( 1 , var ) Point ( 1 , y = var ) Point ( x = 1 , y = var ) Point ( y = var , x = 1 ) A recommended way to read patterns is to look at them as an extended form of what you would put on the left of an assignment, to understand which variables would be set to what. Only the standalone names (like var above) are assigned to by a match statement. Dotted names (like foo.bar ), attribute names (the x= and y= above) or class names (recognized by the “(…)” next to them like Point above) are never assigned to. Patterns can be arbitrarily nested. For example, if we have a short list of Points, with __match_args__ added, we could match it like this: class Point : __match_args__ = ( 'x' , 'y' ) def __init__ ( self , x , y ): self . x = x self . y = y match points : case []: print ( "No points" ) case [ Point ( 0 , 0 )]: print ( "The origin" ) case [ Point ( x , y )]: print ( f "Single point { x } , { y } " ) case [ Point ( 0 , y1 ), Point ( 0 , y2 )]: print ( f "Two on the Y axis at { y1 } , { y2 } " ) case _ : print ( "Something else" ) We can add an if clause to a pattern, known as a “guard”. If the guard is false, match goes on to try the next case block. Note that value capture happens before the guard is evaluated: match point : case Point ( x , y ) if x == y : print ( f "Y=X at { x } " ) case Point ( x , y ): print ( f "Not on the diagonal" ) Several other key features of this statement: Like unpacking assignments, tuple and list patterns have exactly the same meaning and actually match arbitrary sequences. An important exception is that they don’t match iterators or strings. Sequence patterns support extended unpacking: [x, y, *rest] and (x, y, *rest) work similar to unpacking assignments. The name after * may also be _ , so (x, y, *_) matches a sequence of at least two items without binding the remaining items. Mapping patterns: {"bandwidth": b, "latency": l} captures the "bandwidth" and "latency" values from a dictionary. Unlike sequence patterns, extra keys are ignored. An unpacking like **rest is also supported. (But **_ would be redundant, so it is not allowed.) Subpatterns may be captured using the as keyword: case ( Point ( x1 , y1 ), Point ( x2 , y2 ) as p2 ): ... will capture the second element of the input as p2 (as long as the input is a sequence of two points) Most literals are compared by equality, however the singletons True , False and None are compared by identity. Patterns may use named constants. These must be dotted names to prevent them from being interpreted as capture variable: from enum import Enum class Color ( Enum ): RED = 'red' GREEN = 'green' BLUE = 'blue' color = Color ( input ( "Enter your choice of 'red', 'blue' or 'green': " )) match color : case Color . RED : print ( "I see red!" ) case Color . GREEN : print ( "Grass is green" ) case Color . BLUE : print ( "I'm feeling the blues :(" ) For a more detailed explanation and additional examples, you can look into PEP 636 which is written in a tutorial format. 4.8. Defining Functions ¶ We can create a function that writes the Fibonacci series to an arbitrary boundary: >>> def fib ( n ): # write Fibonacci series less than n ... """Print a Fibonacci series less than n.""" ... a , b = 0 , 1 ... while a < n : ... print ( a , end = ' ' ) ... a , b = b , a + b ... print () ... >>> # Now call the function we just defined: >>> fib ( 2000 ) 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 The keyword def introduces a function definition . It must be followed by the function name and the parenthesized list of formal parameters. The statements that form the body of the function start at the next line, and must be indented. The first statement of the function body can optionally be a string literal; this string literal is the function’s documentation string, or docstring . (More about docstrings can be found in the section Documentation Strings .) There are tools which use docstrings to automatically produce online or printed documentation, or to let the user interactively browse through code; it’s good practice to include docstrings in code that you write, so make a habit of it. The execution of a function introduces a new symbol table used for the local variables of the function. More precisely, all variable assignments in a function store the value in the local symbol table; whereas variable references first look in the local symbol table, then in the local symbol tables of enclosing functions, then in the global symbol table, and finally in the table of built-in names. Thus, global variables and variables of enclosing functions cannot be directly assigned a value within a function (unless, for global variables, named in a global statement, or, for variables of enclosing functions, named in a nonlocal statement), although they may be referenced. The actual parameters (arguments) to a function call are introduced in the local symbol table of the called function when it is called; thus, arguments are passed using call by value (where the value is always an object reference , not the value of the object). [ 1 ] When a function calls another function, or calls itself recursively, a new local symbol table is created for that call. A function definition associates the function name with the function object in the current symbol table. The interpreter recognizes the object pointed to by that name as a user-defined function. Other names can also point to that same function object and can also be used to access the function: >>> fib <function fib at 10042ed0> >>> f = fib >>> f ( 100 ) 0 1 1 2 3 5 8 13 21 34 55 89 Coming from other languages, you might object that fib is not a function but a procedure since it doesn’t return a value. In fact, even functions without a return statement do return a value, albeit a rather boring one. This value is called None (it’s a built-in name). Writing the value None is normally suppressed by the interpreter if it would be the only value written. You can see it if you really want to using print() : >>> fib ( 0 ) >>> print ( fib ( 0 )) None It is simple to write a function that returns a list of the numbers of the Fibonacci series, instead of printing it: >>> def fib2 ( n ): # return Fibonacci series up to n ... """Return a list containing the Fibonacci series up to n.""" ... result = [] ... a , b = 0 , 1 ... while a < n : ... result . append ( a ) # see below ... a , b = b , a + b ... return result ... >>> f100 = fib2 ( 100 ) # call it >>> f100 # write the result [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] 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 . The statement result.append(a) calls a method of the list object result . A method is a function that ‘belongs’ to an object and is named obj.methodname , where obj is some object (this may be an expression), and methodname is the name of a method that is defined by the object’s type. Different types define different methods. Methods of different types may have the same name without causing ambiguity. (It is possible to define your own object types and methods, using classes , see Classes ) The method append() shown in the example is defined for list objects; it adds a new element at the end of the list. In this example it is equivalent to result = result + [a] , but more efficient. 4.9. More on Defining Functions ¶ It is also possible to define functions with a variable number of arguments. There are three forms, which can be combined. 4.9.1. Default Argument Values ¶ The most useful form is to specify a default value for one or more arguments. This creates a function that can be called with fewer arguments than it is defined to allow. For example: def ask_ok ( prompt , retries = 4 , reminder = 'Please try again!' ): while True : reply = input ( prompt ) if reply in { 'y' , 'ye' , 'yes' }: return True if reply in { 'n' , 'no' , 'nop' , 'nope' }: return False retries = retries - 1 if retries < 0 : raise ValueError ( 'invalid user response' ) print ( reminder ) This function can be called in several ways: giving only the mandatory argument: ask_ok('Do you really want to quit?') giving one of the optional arguments: ask_ok('OK to overwrite the file?', 2) or even giving all arguments: ask_ok('OK to overwrite the file?', 2, 'Come on, only yes or no!') This example also introduces the in keyword. This tests whether or not a sequence contains a certain value. The default values are evaluated at the point of function definition in the defining scope, so that i = 5 def f ( arg = i ): print ( arg ) i = 6 f () will print 5 . Important warning: The default value is evaluated only once. This makes a difference when the default is a mutable object such as a list, dictionary, or instances of most classes. For example, the following function accumulates the arguments passed to it on subsequent calls: def f ( a , L = []): L . append ( a ) return L print ( f ( 1 )) print ( f ( 2 )) print ( f ( 3 )) This will print [ 1 ] [ 1 , 2 ] [ 1 , 2 , 3 ] If you don’t want the default to be shared between subsequent calls, you can write the function like this instead: def f ( a , L = None ): if L is None : L = [] L . append ( a ) return L 4.9.2. Keyword Arguments ¶ Functions can also be called using keyword arguments of the form kwarg=value . For instance, the following function: def parrot ( voltage , state = 'a stiff' , action = 'voom' , type = 'Norwegian Blue' ): print ( "-- This parrot wouldn't" , action , end = ' ' ) print ( "if you put" , voltage , "volts through it." ) print ( "-- Lovely plumage, the" , type ) print ( "-- It's" , state , "!" ) accepts one required argument ( voltage ) and three optional arguments ( state , action , and type ). This function can be called in any of the following ways: parrot ( 1000 ) # 1 positional argument parrot ( voltage = 1000 ) # 1 keyword argument parrot ( voltage = 1000000 , action = 'VOOOOOM' ) # 2 keyword arguments parrot ( action = 'VOOOOOM' , voltage = 1000000 ) # 2 keyword arguments parrot ( 'a million' , 'bereft of life' , 'jump' ) # 3 positional arguments parrot ( 'a thousand' , state = 'pushing up the daisies' ) # 1 positional, 1 keyword but all the following calls would be invalid: parrot () # required argument missing parrot ( voltage = 5.0 , 'dead' ) # non-keyword argument after a keyword argument parrot ( 110 , voltage = 220 ) # duplicate value for the same argument parrot ( actor = 'John Cleese' ) # unknown keyword argument In a function call, keyword arguments must follow positional arguments. All the keyword arguments passed must match one of the arguments accepted by the function (e.g. actor is not a valid argument for the parrot function), and their order is not important. This also includes non-optional arguments (e.g. parrot(voltage=1000) is valid too). No argument may receive a value more than once. Here’s an example that fails due to this restriction: >>> def function ( a ): ... pass ... >>> function ( 0 , a = 0 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : function() got multiple values for argument 'a' When a final formal parameter of the form **name is present, it receives a dictionary (see Mapping Types — dict ) containing all keyword arguments except for those corresponding to a formal parameter. This may be combined with a formal parameter of the form *name (described in the next subsection) which receives a tuple containing the positional arguments beyond the formal parameter list. ( *name must occur before **name .) For example, if we define a function like this: def cheeseshop ( kind , * arguments , ** keywords ): print ( "-- Do you have any" , kind , "?" ) print ( "-- I'm sorry, we're all out of" , kind ) for arg in arguments : print ( arg ) print ( "-" * 40 ) for kw in keywords : print ( kw , ":" , keywords [ kw ]) It could be called like this: cheeseshop ( "Limburger" , "It's very runny, sir." , "It's really very, VERY runny, sir." , shopkeeper = "Michael Palin" , client = "John Cleese" , sketch = "Cheese Shop Sketch" ) and of course it would print: -- Do you have any Limburger ? -- I'm sorry, we're all out of Limburger It's very runny, sir. It's really very, VERY runny, sir. ---------------------------------------- shopkeeper : Michael Palin client : John Cleese sketch : Cheese Shop Sketch Note that the order in which the keyword arguments are printed is guaranteed to match the order in which they were provided in the function call. 4.9.3. Special parameters ¶ By default, arguments may be passed to a Python function either by position or explicitly by keyword. For readability and performance, it makes sense to restrict the way arguments can be passed so that a developer need only look at the function definition to determine if items are passed by position, by position or keyword, or by keyword. A function definition may look like: def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2): ----------- ---------- ---------- | | | | Positional or keyword | | - Keyword only -- Positional only where / and * are optional. If used, these symbols indicate the kind of parameter by how the arguments may be passed to the function: positional-only, positional-or-keyword, and keyword-only. Keyword parameters are also referred to as named parameters. 4.9.3.1. Positional-or-Keyword Arguments ¶ If / and * are not present in the function definition, arguments may be passed to a function by position or by keyword. 4.9.3.2. Positional-Only Parameters ¶ Looking at this in a bit more detail, it is possible to mark certain parameters as positional-only . If positional-only , the parameters’ order matters, and the parameters cannot be passed by keyword. Positional-only parameters are placed before a / (forward-slash). The / is used to logically separate the positional-only parameters from the rest of the parameters. If there is no / in the function definition, there are no positional-only parameters. Parameters following the / may be positional-or-keyword or keyword-only . 4.9.3.3. Keyword-Only Arguments ¶ To mark parameters as keyword-only , indicating the parameters must be passed by keyword argument, place an * in the arguments list just before the first keyword-only parameter. 4.9.3.4. Function Examples ¶ Consider the following example function definitions paying close attention to the markers / and * : >>> def standard_arg ( arg ): ... print ( arg ) ... >>> def pos_only_arg ( arg , / ): ... print ( arg ) ... >>> def kwd_only_arg ( * , arg ): ... print ( arg ) ... >>> def combined_example ( pos_only , / , standard , * , kwd_only ): ... print ( pos_only , standard , kwd_only ) The first function definition, standard_arg , the most familiar form, places no restrictions on the calling convention and arguments may be passed by position or keyword: >>> standard_arg ( 2 ) 2 >>> standard_arg ( arg = 2 ) 2 The second function pos_only_arg is restricted to only use positional parameters as there is a / in the function definition: >>> pos_only_arg ( 1 ) 1 >>> pos_only_arg ( arg = 1 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : pos_only_arg() got some positional-only arguments passed as keyword arguments: 'arg' The third function kwd_only_arg only allows keyword arguments as indicated by a * in the function definition: >>> kwd_only_arg ( 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : kwd_only_arg() takes 0 positional arguments but 1 was given >>> kwd_only_arg ( arg = 3 ) 3 And the last uses all three calling conventions in the same function definition: >>> combined_example ( 1 , 2 , 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : combined_example() takes 2 positional arguments but 3 were given >>> combined_example ( 1 , 2 , kwd_only = 3 ) 1 2 3 >>> combined_example ( 1 , standard = 2 , kwd_only = 3 ) 1 2 3 >>> combined_example ( pos_only = 1 , standard = 2 , kwd_only = 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : combined_example() got some positional-only arguments passed as keyword arguments: 'pos_only' Finally, consider this function definition which has a potential collision between the positional argument name and **kwds which has name as a key: def foo ( name , ** kwds ): return 'name' in kwds There is no possible call that will make it return True as the keyword 'name' will always bind to the first parameter. For example: >>> foo ( 1 , ** { 'name' : 2 }) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : foo() got multiple values for argument 'name' >>> But using / (positional only arguments), it is possible since it allows name as a positional argument and 'name' as a key in the keyword arguments: >>> def foo ( name , / , ** kwds ): ... return 'name' in kwds ... >>> foo ( 1 , ** { 'name' : 2 }) True In other words, the names of positional-only parameters can be used in **kwds without ambiguity. 4.9.3.5. Recap ¶ The use case will determine which parameters to use in the function definition: def f ( pos1 , pos2 , / , pos_or_kwd , * , kwd1 , kwd2 ): As guidance: Use positional-only if you want the name of the parameters to not be available to the user. This is useful when parameter names have no real meaning, if you want to enforce the order of the arguments when the function is called or if you need to take some positional parameters and arbitrary keywords. Use keyword-only when names have meaning and the function definition is more understandable by being explicit with names or you want to prevent users relying on the position of the argument being passed. For an API, use positional-only to prevent breaking API changes if the parameter’s name is modified in the future. 4.9.4. Arbitrary Argument Lists ¶ Finally, the least frequently used option is to specify that a function can be called with an arbitrary number of arguments. These arguments will be wrapped up in a tuple (see Tuples and Sequences ). Before the variable number of arguments, zero or more normal arguments may occur. def write_multiple_items ( file , separator , * args ): file . write ( separator . join ( args )) Normally, these variadic arguments will be last in the list of formal parameters, because they scoop up all remaining input arguments that are passed to the function. Any formal parameters which occur after the *args parameter are ‘keyword-only’ arguments, meaning that they can only be used as keywords rather than positional arguments. >>> def concat ( * args , sep = "/" ): ... return sep . join ( args ) ... >>> concat ( "earth" , "mars" , "venus" ) 'earth/mars/venus' >>> concat ( "earth" , "mars" , "venus" , sep = "." ) 'earth.mars.venus' 4.9.5. Unpacking Argument Lists ¶ The reverse situation occurs when the arguments are already in a list or tuple but need to be unpacked for a function call requiring separate positional arguments. For instance, the built-in range() function expects separate start and stop arguments. If they are not available separately, write the function call with the * -operator to unpack the arguments out of a list or tuple: >>> list ( range ( 3 , 6 )) # normal call with separate arguments [3, 4, 5] >>> args = [ 3 , 6 ] >>> list ( range ( * args )) # call with arguments unpacked from a list [3, 4, 5] In the same fashion, dictionaries can deliver keyword arguments with the ** -operator: >>> def parrot ( voltage , state = 'a stiff' , action = 'voom' ): ... print ( "-- This parrot wouldn't" , action , end = ' ' ) ... print ( "if you put" , voltage , "volts through it." , end = ' ' ) ... print ( "E's" , state , "!" ) ... >>> d = { "voltage" : "four million" , "state" : "bleedin' demised" , "action" : "VOOM" } >>> parrot ( ** d ) -- This parrot wouldn't VOOM if you put four million volts through it. E's bleedin' demised ! 4.9.6. Lambda Expressions ¶ Small anonymous functions can be created with the lambda keyword. This function returns the sum of its two arguments: lambda a, b: a+b . Lambda functions can be used wherever function objects are required. They are syntactically restricted to a single expression. Semantically, they are just syntactic sugar for a normal function definition. Like nested function definitions, lambda functions can reference variables from the containing scope: >>> def make_incrementor ( n ): ... return lambda x : x + n ... >>> f = make_incrementor ( 42 ) >>> f ( 0 ) 42 >>> f ( 1 ) 43 The above example uses a lambda expression to return a function. Another use is to pass a small function as an argument. For instance, list.sort() takes a sorting key function key which can be a lambda function: >>> pairs = [( 1 , 'one' ), ( 2 , 'two' ), ( 3 , 'three' ), ( 4 , 'four' )] >>> pairs . sort ( key = lambda pair : pair [ 1 ]) >>> pairs [(4, 'four'), (1, 'one'), (3, 'three'), (2, 'two')] 4.9.7. Documentation Strings ¶ Here are some conventions about the content and formatting of documentation strings. The first line should always be a short, concise summary of the object’s purpose. For brevity, it should not explicitly state the object’s name or type, since these are available by other means (except if the name happens to be a verb describing a function’s operation). This line should begin with a capital letter and end with a period. If there are more lines in the documentation string, the second line should be blank, visually separating the summary from the rest of the description. The following lines should be one or more paragraphs describing the object’s calling conventions, its side effects, etc. The Python parser strips indentation from multi-line string literals when they serve as module, class, or function docstrings. Here is an example of a multi-line docstring: >>> def my_function (): ... """Do nothing, but document it. ... ... No, really, it doesn't do anything: ... ... >>> my_function() ... >>> ... """ ... pass ... >>> print ( my_function . __doc__ ) Do nothing, but document it. No, really, it doesn't do anything: >>> my_function() >>> 4.9.8. Function Annotations ¶ Function annotations are completely optional metadata information about the types used by user-defined functions (see PEP 3107 and PEP 484 for more information). Annotations are stored in the __annotations__ attribute of the function as a dictionary and have no effect on any other part of the function. Parameter annotations are defined by a colon after the parameter name, followed by an expression evaluating to the value of the annotation. Return annotations are defined by a literal -> , followed by an expression, between the parameter list and the colon denoting the end of the def statement. The following example has a required argument, an optional argument, and the return value annotated: >>> def f ( ham : str , eggs : str = 'eggs' ) -> str : ... print ( "Annotations:" , f . __annotations__ ) ... print ( "Arguments:" , ham , eggs ) ... return ham + ' and ' + eggs ... >>> f ( 'spam' ) Annotations: {'ham': <class 'str'>, 'return': <class 'str'>, 'eggs': <class 'str'>} Arguments: spam eggs 'spam and eggs' 4.10. Intermezzo: Coding Style ¶ Now that you are about to write longer, more complex pieces of Python, it is a good time to talk about coding style . Most languages can be written (or more concise, formatted ) in different styles; some are more readable than others. Making it easy for others to read your code is always a good idea, and adopting a nice coding style helps tremendously for that. For Python, PEP 8 has emerged as the style guide that most projects adhere to; it promotes a very readable and eye-pleasing coding style. Every Python developer should read it at some point; here are the most important points extracted for you: Use 4-space indentation, and no tabs. 4 spaces are a good compromise between small indentation (allows greater nesting depth) and large indentation (easier to read). Tabs introduce confusion, and are best left out. Wrap lines so that they don’t exceed 79 characters. This helps users with small displays and makes it possible to have several code files side-by-side on larger displays. Use blank lines to separate functions and classes, and larger blocks of code inside functions. When possible, put comments on a line of their own. Use docstrings. Use spaces around operators and after commas, but not directly inside bracketing constructs: a = f(1, 2) + g(3, 4) . Name your classes and functions consistently; the convention is to use UpperCamelCase for classes and lowercase_with_underscores for functions and methods. Always use self as the name for the first method argument (see A First Look at Classes for more on classes and methods). Don’t use fancy encodings if your code is meant to be used in international environments. Python’s default, UTF-8, or even plain ASCII work best in any case. Likewise, don’t use non-ASCII characters in identifiers if there is only the slightest chance people speaking a different language will read or maintain the code. Footnotes [ 1 ] Actually, call by object reference would be a better description, since if a mutable object is passed, the caller will see any changes the callee makes to it (items inserted into a list). Table of Contents 4. More Control Flow Tools 4.1. if Statements 4.2. for Statements 4.3. The range() Function 4.4. break and continue Statements 4.5. else Clauses on Loops 4.6. pass Statements 4.7. match Statements 4.8. Defining Functions 4.9. More on Defining Functions 4.9.1. Default Argument Values 4.9.2. Keyword Arguments 4.9.3. Special parameters 4.9.3.1. Positional-or-Keyword Arguments 4.9.3.2. Positional-Only Parameters 4.9.3.3. Keyword-Only Arguments 4.9.3.4. Function Examples 4.9.3.5. Recap 4.9.4. Arbitrary Argument Lists 4.9.5. Unpacking Argument Lists 4.9.6. Lambda Expressions 4.9.7. Documentation Strings 4.9.8. Function Annotations 4.10. Intermezzo: Coding Style Previous topic 3. An Informal Introduction to Python Next topic 5. Data Structures This page Report a bug Show source « Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 4. More Control Flow Tools | Theme Auto Light Dark | © Copyright 2001 Python Software Foundation. This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. See History and License for more information. The Python Software Foundation is a non-profit corporation. Please donate. Last updated on Jan 13, 2026 (06:19 UTC). Found a bug ? Created using Sphinx 8.2.3. | 2026-01-13T08:48:44 |
https://dev.to/inushathathsara/the-features-i-killed-to-ship-the-80-percent-app-in-4-weeks-30op | The Features I Killed to Ship The 80 Percent App in 4 Weeks - DEV Community Forem Feed Follow new Subforems to improve your feed DEV Community Follow A space to discuss and keep up software development and manage your software career Future Follow News and discussion of science and technology such as AI, VR, cryptocurrency, quantum computing, and more. Open Forem Follow A general discussion space for the Forem community. If it doesn't have a home elsewhere, it belongs here Gamers Forem Follow An inclusive community for gaming enthusiasts Music Forem Follow From composing and gigging to gear, hot music takes, and everything in between. Vibe Coding Forem Follow Discussing AI software development, and showing off what we're building. Popcorn Movies and TV Follow Movie and TV enthusiasm, criticism and everything in-between. DUMB DEV Community Follow Memes and software development shitposting Design Community Follow Web design, graphic design and everything in-between Security Forem Follow Your central hub for all things security. From ethical hacking and CTFs to GRC and career development, for beginners and pros alike Golf Forem Follow A community of golfers and golfing enthusiasts Crypto Forem Follow A collaborative community for all things Crypto—from Bitcoin to protocol development and DeFi to NFTs and market analysis. Parenting Follow A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Forem Core Follow Discussing the core forem open source software project — features, bugs, performance, self-hosting. Maker Forem Follow A community for makers, hobbyists, and professionals to discuss Arduino, Raspberry Pi, 3D printing, and much more. HMPL.js Forem Follow For developers using HMPL.js to build fast, lightweight web apps. A space to share projects, ask questions, and discuss server-driven templating Dropdown menu Dropdown menu Skip to content Navigation menu Search Powered by Algolia Search Log in Create account DEV Community Close Add reaction Like Unicorn Exploding Head Raised Hands Fire Jump to Comments Save Boost More... Copy link Copy link Copied to Clipboard Share to X Share to LinkedIn Share to Facebook Share to Mastodon Share Post via... Report Abuse Malawige Inusha Thathsara Gunasekara Posted on Jan 12 • Originally published at inusha-gunasekara.hashnode.dev The Features I Killed to Ship The 80 Percent App in 4 Weeks # flutter # softwareengineering # devops # learning I almost fell into a trap believing that "more features" equals a "better product." When I started building The 80% , an assistant tool which helps students to keep track of their attendance, medicals and GPA. I had a strict four-week deadline to ship a production-ready attendance tracker. I quickly realized that if I tried to build everything I wanted , I would never ship what the user needed . Then I remembered what Elon Musk said, "The Best Part is No Part." I didn't just cut features to save time; I cut them to save the architecture from unnecessary complexity. Here are the five worth-mentioning features I killed in The 80% . 1. The Backup Server Trap I wasted the first few days being obsessed with 100% uptime. I wanted to build a secondary failover server just in case Firebase went down. I realized I was solving an imaginary problem. Firebase has 99.99% uptime, while the probability of my users having poor campus Wi-Fi is high. The real risk wasn't Google servers failing. It was the connection dropping between the classroom and the cloud. I abandoned the backup server entirely and embraced an Offline-First Architecture using Hive. By treating the user's device as the primary data source, the app works perfectly regardless of server status, I learned that I shouldn't build complex distributed systems when a local database solves the actual problem. 2. The Medical Cloud Storage Nightmare I planned to add a feature allowing students to upload photos of their medical certificates to the cloud so they would never lose them. But as I designed it, two major problems appeared: the extreme cost of storing images for thousands of users on the Firebase Free Tier, and the liability of holding Personally Identifiable Information (PII) . If I held medical records, I was responsible for protecting them from data breaches. As a student developer, I didn't want the risk of a data breach hanging over my head. To solve this, I built the "The Local Wallet." within the app itself. Instead of uploading files, the app simply saves the images in the device's local sandbox and stores a link to the file path. The data stays 100% on the user's phone, resulting in zero cloud costs and zero privacy liability. I learned that the most secure data is the data you never collect. 3. The "Automated Email" Fantasy I wanted to build a productivity hack where the app would automatically send official emails from the student's university account using SMTP or OAuth. It sounded like a great productivity hack until I looked at the technical reality. University firewalls and Multi-Factor Authentication (MFA) makes this feature hard to implement. Making it work I had two bad choices. Requesting Credentials from the User: Asking users for their university passwords which leads to a a massive security violation that looks exactly like phishing. or Enterprise Verification: I would have to navigate the university's bureaucracy to get official OAuth approval. I avoided this method in order to reduce the complexity of the app. I killed this automation entirely and stuck with the traditional email flow. The app automatically opens the default email app, then the user can send the drafted email with the medical report. I learned two major lessons here. First one is "Trust is harder to build than a feature." And as developers we shouldn't compromise security for a "cool" automation. 4. All University Supported Grading System I had a plan to create a database containing the grading scales for all major universities all around the world to automate the GPA calculation process. But I quickly realized that this needs constant maintainability, which I don't have time to do as a undergraduate. It would require weeks of manual data entry and maintenance, and if a university changed their grading policy, my app would be instantly outdated. It simply wasn't worth the effort for my app. Instead, I built a feature that allows the user to configure their own grading scale . This taught me that when shipping, flexibility is often better than hard-coded perfection. 5. Sync Custom Profile Picture Across Devices I wanted users to be able to pick a photo from their gallery and have that custom profile picture sync across all their devices via Firebase. This led me to the "Cost" problem again. I would need a paid Firebase plan to store these custom images, or I would have to bloat the database by storing base64 strings, which requires unnecessary processing power and time. I compromised by removing the ability to upload custom photos and instead provided a set of high-quality, pre-defined 3D avatars. I only sync the Avatar ID (a simple integer) across devices, keeping the data transfer minimal. This was a valuable lesson in distinguishing between what is needed (identifying users) versus what is wanted (full customizability). Conclusion It is easy to add features. It is hard to remove them. By killing these features, I didn't just save time; I built a product that is faster, cheaper to run, and more secure. I learned that my job isn't to build the most complex version of an idea, but to ship the version that actually works. The 80% proved to me that sometimes, the best code is the code you delete. Top comments (0) Subscribe Personal Trusted User Create template Templates let you quickly answer FAQs or store snippets for re-use. Submit Preview Dismiss Code of Conduct • Report abuse Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink . Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse Malawige Inusha Thathsara Gunasekara Follow IT Undergrad @ University of Moratuwa. Building with Python, Flutter and so much more. I write about technical stuff and clean code. Documenting my journey one commit at a time. Location Colombo, Sri Lanka Education University of Moratuwa Joined Jan 1, 2026 More from Malawige Inusha Thathsara Gunasekara How I Built a Flutter + Gemini AI App to "Hack" My University Attendance (Open Source) # flutter # firebase # gemini # fullstack 💎 DEV Diamond Sponsors Thank you to our Diamond Sponsors for supporting the DEV Community Google AI is the official AI Model and Platform Partner of DEV Neon is the official database partner of DEV Algolia is the official search partner of DEV Forem — A space to discuss and keep up software development and manage your software career Home DEV++ Podcasts Videos DEV Education Tracks DEV Challenges DEV Help Advertise on DEV DEV Showcase About Contact Free Postgres Database Software comparisons Forem Shop Code of Conduct Privacy Policy Terms of Use Built on Forem — the open source software that powers DEV and other inclusive communities. Made with love and Ruby on Rails . Forem © 2016 - 2026. We're a place where coders share, stay up-to-date and grow their careers. Log in Create account | 2026-01-13T08:48:44 |
https://docs.python.org/3/library/stdtypes.html#typesnumeric | Built-in Types — Python 3.14.2 documentation Theme Auto Light Dark Table of Contents Built-in Types Truth Value Testing Boolean Operations — and , or , not Comparisons Numeric Types — int , float , complex Bitwise Operations on Integer Types Additional Methods on Integer Types Additional Methods on Float Additional Methods on Complex Hashing of numeric types Boolean Type - bool Iterator Types Generator Types Sequence Types — list , tuple , range Common Sequence Operations Immutable Sequence Types Mutable Sequence Types Lists Tuples Ranges Text and Binary Sequence Type Methods Summary Text Sequence Type — str String Methods Formatted String Literals (f-strings) Debug specifier Conversion specifier Format specifier Template String Literals (t-strings) printf -style String Formatting Binary Sequence Types — bytes , bytearray , memoryview Bytes Objects Bytearray Objects Bytes and Bytearray Operations printf -style Bytes Formatting Memory Views Set Types — set , frozenset Mapping Types — dict Dictionary view objects Context Manager Types Type Annotation Types — Generic Alias , Union Generic Alias Type Standard Generic Classes Special Attributes of GenericAlias objects Union Type Other Built-in Types Modules Classes and Class Instances Functions Methods Code Objects Type Objects The Null Object The Ellipsis Object The NotImplemented Object Internal Objects Special Attributes Integer string conversion length limitation Affected APIs Configuring the limit Recommended configuration Previous topic Built-in Constants Next topic Built-in Exceptions This page Report a bug Show source Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Standard Library » Built-in Types | Theme Auto Light Dark | Built-in Types ¶ The following sections describe the standard types that are built into the interpreter. The principal built-in types are numerics, sequences, mappings, classes, instances and exceptions. Some collection classes are mutable. The methods that add, subtract, or rearrange their members in place, and don’t return a specific item, never return the collection instance itself but None . Some operations are supported by several object types; in particular, practically all objects can be compared for equality, tested for truth value, and converted to a string (with the repr() function or the slightly different str() function). The latter function is implicitly used when an object is written by the print() function. Truth Value Testing ¶ Any object can be tested for truth value, for use in an if or while condition or as operand of the Boolean operations below. By default, an object is considered true unless its class defines either a __bool__() method that returns False or a __len__() method that returns zero, when called with the object. [ 1 ] If one of the methods raises an exception when called, the exception is propagated and the object does not have a truth value (for example, NotImplemented ). Here are most of the built-in objects considered false: constants defined to be false: None and False zero of any numeric type: 0 , 0.0 , 0j , Decimal(0) , Fraction(0, 1) empty sequences and collections: '' , () , [] , {} , set() , range(0) Operations and built-in functions that have a Boolean result always return 0 or False for false and 1 or True for true, unless otherwise stated. (Important exception: the Boolean operations or and and always return one of their operands.) Boolean Operations — and , or , not ¶ These are the Boolean operations, ordered by ascending priority: Operation Result Notes x or y if x is true, then x , else y (1) x and y if x is false, then x , else y (2) not x if x is false, then True , else False (3) Notes: This is a short-circuit operator, so it only evaluates the second argument if the first one is false. This is a short-circuit operator, so it only evaluates the second argument if the first one is true. not has a lower priority than non-Boolean operators, so not a == b is interpreted as not (a == b) , and a == not b is a syntax error. Comparisons ¶ There are eight comparison operations in Python. They all have the same priority (which is higher than that of the Boolean operations). Comparisons can be chained arbitrarily; for example, x < y <= z is equivalent to x < y and y <= z , except that y is evaluated only once (but in both cases z is not evaluated at all when x < y is found to be false). This table summarizes the comparison operations: Operation Meaning < strictly less than <= less than or equal > strictly greater than >= greater than or equal == equal != not equal is object identity is not negated object identity Unless stated otherwise, objects of different types never compare equal. The == operator is always defined but for some object types (for example, class objects) is equivalent to is . The < , <= , > and >= operators are only defined where they make sense; for example, they raise a TypeError exception when one of the arguments is a complex number. Non-identical instances of a class normally compare as non-equal unless the class defines the __eq__() method. Instances of a class cannot be ordered with respect to other instances of the same class, or other types of object, unless the class defines enough of the methods __lt__() , __le__() , __gt__() , and __ge__() (in general, __lt__() and __eq__() are sufficient, if you want the conventional meanings of the comparison operators). The behavior of the is and is not operators cannot be customized; also they can be applied to any two objects and never raise an exception. Two more operations with the same syntactic priority, in and not in , are supported by types that are iterable or implement the __contains__() method. Numeric Types — int , float , complex ¶ There are three distinct numeric types: integers , floating-point numbers , and complex numbers . In addition, Booleans are a subtype of integers. Integers have unlimited precision. Floating-point numbers are usually implemented using double in C; information about the precision and internal representation of floating-point numbers for the machine on which your program is running is available in sys.float_info . Complex numbers have a real and imaginary part, which are each a floating-point number. To extract these parts from a complex number z , use z.real and z.imag . (The standard library includes the additional numeric types fractions.Fraction , for rationals, and decimal.Decimal , for floating-point numbers with user-definable precision.) Numbers are created by numeric literals or as the result of built-in functions and operators. Unadorned integer literals (including hex, octal and binary numbers) yield integers. Numeric literals containing a decimal point or an exponent sign yield floating-point numbers. Appending 'j' or 'J' to a numeric literal yields an imaginary number (a complex number with a zero real part) which you can add to an integer or float to get a complex number with real and imaginary parts. The constructors int() , float() , and complex() can be used to produce numbers of a specific type. Python fully supports mixed arithmetic: when a binary arithmetic operator has operands of different numeric types, the operand with the “narrower” type is widened to that of the other, where integer is narrower than floating point. Arithmetic with complex and real operands is defined by the usual mathematical formula, for example: x + complex ( u , v ) = complex ( x + u , v ) x * complex ( u , v ) = complex ( x * u , x * v ) A comparison between numbers of different types behaves as though the exact values of those numbers were being compared. [ 2 ] All numeric types (except complex) support the following operations (for priorities of the operations, see Operator precedence ): Operation Result Notes Full documentation x + y sum of x and y x - y difference of x and y x * y product of x and y x / y quotient of x and y x // y floored quotient of x and y (1)(2) x % y remainder of x / y (2) -x x negated +x x unchanged abs(x) absolute value or magnitude of x abs() int(x) x converted to integer (3)(6) int() float(x) x converted to floating point (4)(6) float() complex(re, im) a complex number with real part re , imaginary part im . im defaults to zero. (6) complex() c.conjugate() conjugate of the complex number c divmod(x, y) the pair (x // y, x % y) (2) divmod() pow(x, y) x to the power y (5) pow() x ** y x to the power y (5) Notes: Also referred to as integer division. For operands of type int , the result has type int . For operands of type float , the result has type float . In general, the result is a whole integer, though the result’s type is not necessarily int . The result is always rounded towards minus infinity: 1//2 is 0 , (-1)//2 is -1 , 1//(-2) is -1 , and (-1)//(-2) is 0 . Not for complex numbers. Instead convert to floats using abs() if appropriate. Conversion from float to int truncates, discarding the fractional part. See functions math.floor() and math.ceil() for alternative conversions. float also accepts the strings “nan” and “inf” with an optional prefix “+” or “-” for Not a Number (NaN) and positive or negative infinity. Python defines pow(0, 0) and 0 ** 0 to be 1 , as is common for programming languages. The numeric literals accepted include the digits 0 to 9 or any Unicode equivalent (code points with the Nd property). See the Unicode Standard for a complete list of code points with the Nd property. All numbers.Real types ( int and float ) also include the following operations: Operation Result math.trunc(x) x truncated to Integral round(x[, n]) x rounded to n digits, rounding half to even. If n is omitted, it defaults to 0. math.floor(x) the greatest Integral <= x math.ceil(x) the least Integral >= x For additional numeric operations see the math and cmath modules. Bitwise Operations on Integer Types ¶ Bitwise operations only make sense for integers. The result of bitwise operations is calculated as though carried out in two’s complement with an infinite number of sign bits. The priorities of the binary bitwise operations are all lower than the numeric operations and higher than the comparisons; the unary operation ~ has the same priority as the other unary numeric operations ( + and - ). This table lists the bitwise operations sorted in ascending priority: Operation Result Notes x | y bitwise or of x and y (4) x ^ y bitwise exclusive or of x and y (4) x & y bitwise and of x and y (4) x << n x shifted left by n bits (1)(2) x >> n x shifted right by n bits (1)(3) ~x the bits of x inverted Notes: Negative shift counts are illegal and cause a ValueError to be raised. A left shift by n bits is equivalent to multiplication by pow(2, n) . A right shift by n bits is equivalent to floor division by pow(2, n) . Performing these calculations with at least one extra sign extension bit in a finite two’s complement representation (a working bit-width of 1 + max(x.bit_length(), y.bit_length()) or more) is sufficient to get the same result as if there were an infinite number of sign bits. Additional Methods on Integer Types ¶ The int type implements the numbers.Integral abstract base class . In addition, it provides a few more methods: int. bit_length ( ) ¶ Return the number of bits necessary to represent an integer in binary, excluding the sign and leading zeros: >>> n = - 37 >>> bin ( n ) '-0b100101' >>> n . bit_length () 6 More precisely, if x is nonzero, then x.bit_length() is the unique positive integer k such that 2**(k-1) <= abs(x) < 2**k . Equivalently, when abs(x) is small enough to have a correctly rounded logarithm, then k = 1 + int(log(abs(x), 2)) . If x is zero, then x.bit_length() returns 0 . Equivalent to: def bit_length ( self ): s = bin ( self ) # binary representation: bin(-37) --> '-0b100101' s = s . lstrip ( '-0b' ) # remove leading zeros and minus sign return len ( s ) # len('100101') --> 6 Added in version 3.1. int. bit_count ( ) ¶ Return the number of ones in the binary representation of the absolute value of the integer. This is also known as the population count. Example: >>> n = 19 >>> bin ( n ) '0b10011' >>> n . bit_count () 3 >>> ( - n ) . bit_count () 3 Equivalent to: def bit_count ( self ): return bin ( self ) . count ( "1" ) Added in version 3.10. int. to_bytes ( length = 1 , byteorder = 'big' , * , signed = False ) ¶ Return an array of bytes representing an integer. >>> ( 1024 ) . to_bytes ( 2 , byteorder = 'big' ) b'\x04\x00' >>> ( 1024 ) . to_bytes ( 10 , byteorder = 'big' ) b'\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00' >>> ( - 1024 ) . to_bytes ( 10 , byteorder = 'big' , signed = True ) b'\xff\xff\xff\xff\xff\xff\xff\xff\xfc\x00' >>> x = 1000 >>> x . to_bytes (( x . bit_length () + 7 ) // 8 , byteorder = 'little' ) b'\xe8\x03' The integer is represented using length bytes, and defaults to 1. An OverflowError is raised if the integer is not representable with the given number of bytes. The byteorder argument determines the byte order used to represent the integer, and defaults to "big" . If byteorder is "big" , the most significant byte is at the beginning of the byte array. If byteorder is "little" , the most significant byte is at the end of the byte array. The signed argument determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised. The default value for signed is False . The default values can be used to conveniently turn an integer into a single byte object: >>> ( 65 ) . to_bytes () b'A' However, when using the default arguments, don’t try to convert a value greater than 255 or you’ll get an OverflowError . Equivalent to: def to_bytes ( n , length = 1 , byteorder = 'big' , signed = False ): if byteorder == 'little' : order = range ( length ) elif byteorder == 'big' : order = reversed ( range ( length )) else : raise ValueError ( "byteorder must be either 'little' or 'big'" ) return bytes (( n >> i * 8 ) & 0xff for i in order ) Added in version 3.2. Changed in version 3.11: Added default argument values for length and byteorder . classmethod int. from_bytes ( bytes , byteorder = 'big' , * , signed = False ) ¶ Return the integer represented by the given array of bytes. >>> int . from_bytes ( b ' \x00\x10 ' , byteorder = 'big' ) 16 >>> int . from_bytes ( b ' \x00\x10 ' , byteorder = 'little' ) 4096 >>> int . from_bytes ( b ' \xfc\x00 ' , byteorder = 'big' , signed = True ) -1024 >>> int . from_bytes ( b ' \xfc\x00 ' , byteorder = 'big' , signed = False ) 64512 >>> int . from_bytes ([ 255 , 0 , 0 ], byteorder = 'big' ) 16711680 The argument bytes must either be a bytes-like object or an iterable producing bytes. The byteorder argument determines the byte order used to represent the integer, and defaults to "big" . If byteorder is "big" , the most significant byte is at the beginning of the byte array. If byteorder is "little" , the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. The signed argument indicates whether two’s complement is used to represent the integer. Equivalent to: def from_bytes ( bytes , byteorder = 'big' , signed = False ): if byteorder == 'little' : little_ordered = list ( bytes ) elif byteorder == 'big' : little_ordered = list ( reversed ( bytes )) else : raise ValueError ( "byteorder must be either 'little' or 'big'" ) n = sum ( b << i * 8 for i , b in enumerate ( little_ordered )) if signed and little_ordered and ( little_ordered [ - 1 ] & 0x80 ): n -= 1 << 8 * len ( little_ordered ) return n Added in version 3.2. Changed in version 3.11: Added default argument value for byteorder . int. as_integer_ratio ( ) ¶ Return a pair of integers whose ratio is equal to the original integer and has a positive denominator. The integer ratio of integers (whole numbers) is always the integer as the numerator and 1 as the denominator. Added in version 3.8. int. is_integer ( ) ¶ Returns True . Exists for duck type compatibility with float.is_integer() . Added in version 3.12. Additional Methods on Float ¶ The float type implements the numbers.Real abstract base class . float also has the following additional methods. classmethod float. from_number ( x ) ¶ Class method to return a floating-point number constructed from a number x . If the argument is an integer or a floating-point number, a floating-point number with the same value (within Python’s floating-point precision) is returned. If the argument is outside the range of a Python float, an OverflowError will be raised. For a general Python object x , float.from_number(x) delegates to x.__float__() . If __float__() is not defined then it falls back to __index__() . Added in version 3.14. float. as_integer_ratio ( ) ¶ Return a pair of integers whose ratio is exactly equal to the original float. The ratio is in lowest terms and has a positive denominator. Raises OverflowError on infinities and a ValueError on NaNs. float. is_integer ( ) ¶ Return True if the float instance is finite with integral value, and False otherwise: >>> ( - 2.0 ) . is_integer () True >>> ( 3.2 ) . is_integer () False Two methods support conversion to and from hexadecimal strings. Since Python’s floats are stored internally as binary numbers, converting a float to or from a decimal string usually involves a small rounding error. In contrast, hexadecimal strings allow exact representation and specification of floating-point numbers. This can be useful when debugging, and in numerical work. float. hex ( ) ¶ Return a representation of a floating-point number as a hexadecimal string. For finite floating-point numbers, this representation will always include a leading 0x and a trailing p and exponent. classmethod float. fromhex ( s ) ¶ Class method to return the float represented by a hexadecimal string s . The string s may have leading and trailing whitespace. Note that float.hex() is an instance method, while float.fromhex() is a class method. A hexadecimal string takes the form: [ sign ] [ '0x' ] integer [ '.' fraction ] [ 'p' exponent ] where the optional sign may by either + or - , integer and fraction are strings of hexadecimal digits, and exponent is a decimal integer with an optional leading sign. Case is not significant, and there must be at least one hexadecimal digit in either the integer or the fraction. This syntax is similar to the syntax specified in section 6.4.4.2 of the C99 standard, and also to the syntax used in Java 1.5 onwards. In particular, the output of float.hex() is usable as a hexadecimal floating-point literal in C or Java code, and hexadecimal strings produced by C’s %a format character or Java’s Double.toHexString are accepted by float.fromhex() . Note that the exponent is written in decimal rather than hexadecimal, and that it gives the power of 2 by which to multiply the coefficient. For example, the hexadecimal string 0x3.a7p10 represents the floating-point number (3 + 10./16 + 7./16**2) * 2.0**10 , or 3740.0 : >>> float . fromhex ( '0x3.a7p10' ) 3740.0 Applying the reverse conversion to 3740.0 gives a different hexadecimal string representing the same number: >>> float . hex ( 3740.0 ) '0x1.d380000000000p+11' Additional Methods on Complex ¶ The complex type implements the numbers.Complex abstract base class . complex also has the following additional methods. classmethod complex. from_number ( x ) ¶ Class method to convert a number to a complex number. For a general Python object x , complex.from_number(x) delegates to x.__complex__() . If __complex__() is not defined then it falls back to __float__() . If __float__() is not defined then it falls back to __index__() . Added in version 3.14. Hashing of numeric types ¶ For numbers x and y , possibly of different types, it’s a requirement that hash(x) == hash(y) whenever x == y (see the __hash__() method documentation for more details). For ease of implementation and efficiency across a variety of numeric types (including int , float , decimal.Decimal and fractions.Fraction ) Python’s hash for numeric types is based on a single mathematical function that’s defined for any rational number, and hence applies to all instances of int and fractions.Fraction , and all finite instances of float and decimal.Decimal . Essentially, this function is given by reduction modulo P for a fixed prime P . The value of P is made available to Python as the modulus attribute of sys.hash_info . CPython implementation detail: Currently, the prime used is P = 2**31 - 1 on machines with 32-bit C longs and P = 2**61 - 1 on machines with 64-bit C longs. Here are the rules in detail: If x = m / n is a nonnegative rational number and n is not divisible by P , define hash(x) as m * invmod(n, P) % P , where invmod(n, P) gives the inverse of n modulo P . If x = m / n is a nonnegative rational number and n is divisible by P (but m is not) then n has no inverse modulo P and the rule above doesn’t apply; in this case define hash(x) to be the constant value sys.hash_info.inf . If x = m / n is a negative rational number define hash(x) as -hash(-x) . If the resulting hash is -1 , replace it with -2 . The particular values sys.hash_info.inf and -sys.hash_info.inf are used as hash values for positive infinity or negative infinity (respectively). For a complex number z , the hash values of the real and imaginary parts are combined by computing hash(z.real) + sys.hash_info.imag * hash(z.imag) , reduced modulo 2**sys.hash_info.width so that it lies in range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width - 1)) . Again, if the result is -1 , it’s replaced with -2 . To clarify the above rules, here’s some example Python code, equivalent to the built-in hash, for computing the hash of a rational number, float , or complex : import sys , math def hash_fraction ( m , n ): """Compute the hash of a rational number m / n. Assumes m and n are integers, with n positive. Equivalent to hash(fractions.Fraction(m, n)). """ P = sys . hash_info . modulus # Remove common factors of P. (Unnecessary if m and n already coprime.) while m % P == n % P == 0 : m , n = m // P , n // P if n % P == 0 : hash_value = sys . hash_info . inf else : # Fermat's Little Theorem: pow(n, P-1, P) is 1, so # pow(n, P-2, P) gives the inverse of n modulo P. hash_value = ( abs ( m ) % P ) * pow ( n , P - 2 , P ) % P if m < 0 : hash_value = - hash_value if hash_value == - 1 : hash_value = - 2 return hash_value def hash_float ( x ): """Compute the hash of a float x.""" if math . isnan ( x ): return object . __hash__ ( x ) elif math . isinf ( x ): return sys . hash_info . inf if x > 0 else - sys . hash_info . inf else : return hash_fraction ( * x . as_integer_ratio ()) def hash_complex ( z ): """Compute the hash of a complex number z.""" hash_value = hash_float ( z . real ) + sys . hash_info . imag * hash_float ( z . imag ) # do a signed reduction modulo 2**sys.hash_info.width M = 2 ** ( sys . hash_info . width - 1 ) hash_value = ( hash_value & ( M - 1 )) - ( hash_value & M ) if hash_value == - 1 : hash_value = - 2 return hash_value Boolean Type - bool ¶ Booleans represent truth values. The bool type has exactly two constant instances: True and False . The built-in function bool() converts any value to a boolean, if the value can be interpreted as a truth value (see section Truth Value Testing above). For logical operations, use the boolean operators and , or and not . When applying the bitwise operators & , | , ^ to two booleans, they return a bool equivalent to the logical operations “and”, “or”, “xor”. However, the logical operators and , or and != should be preferred over & , | and ^ . Deprecated since version 3.12: The use of the bitwise inversion operator ~ is deprecated and will raise an error in Python 3.16. bool is a subclass of int (see Numeric Types — int, float, complex ). In many numeric contexts, False and True behave like the integers 0 and 1, respectively. However, relying on this is discouraged; explicitly convert using int() instead. Iterator Types ¶ Python supports a concept of iteration over containers. This is implemented using two distinct methods; these are used to allow user-defined classes to support iteration. Sequences, described below in more detail, always support the iteration methods. One method needs to be defined for container objects to provide iterable support: container. __iter__ ( ) ¶ Return an iterator object. The object is required to support the iterator protocol described below. If a container supports different types of iteration, additional methods can be provided to specifically request iterators for those iteration types. (An example of an object supporting multiple forms of iteration would be a tree structure which supports both breadth-first and depth-first traversal.) This method corresponds to the tp_iter slot of the type structure for Python objects in the Python/C API. The iterator objects themselves are required to support the following two methods, which together form the iterator protocol : iterator. __iter__ ( ) ¶ Return the iterator object itself. This is required to allow both containers and iterators to be used with the for and in statements. This method corresponds to the tp_iter slot of the type structure for Python objects in the Python/C API. iterator. __next__ ( ) ¶ Return the next item from the iterator . If there are no further items, raise the StopIteration exception. This method corresponds to the tp_iternext slot of the type structure for Python objects in the Python/C API. Python defines several iterator objects to support iteration over general and specific sequence types, dictionaries, and other more specialized forms. The specific types are not important beyond their implementation of the iterator protocol. Once an iterator’s __next__() method raises StopIteration , it must continue to do so on subsequent calls. Implementations that do not obey this property are deemed broken. Generator Types ¶ Python’s generator s provide a convenient way to implement the iterator protocol. If a container object’s __iter__() method is implemented as a generator, it will automatically return an iterator object (technically, a generator object) supplying the __iter__() and __next__() methods. More information about generators can be found in the documentation for the yield expression . Sequence Types — list , tuple , range ¶ There are three basic sequence types: lists, tuples, and range objects. Additional sequence types tailored for processing of binary data and text strings are described in dedicated sections. Common Sequence Operations ¶ The operations in the following table are supported by most sequence types, both mutable and immutable. The collections.abc.Sequence ABC is provided to make it easier to correctly implement these operations on custom sequence types. This table lists the sequence operations sorted in ascending priority. In the table, s and t are sequences of the same type, n , i , j and k are integers and x is an arbitrary object that meets any type and value restrictions imposed by s . The in and not in operations have the same priorities as the comparison operations. The + (concatenation) and * (repetition) operations have the same priority as the corresponding numeric operations. [ 3 ] Operation Result Notes x in s True if an item of s is equal to x , else False (1) x not in s False if an item of s is equal to x , else True (1) s + t the concatenation of s and t (6)(7) s * n or n * s equivalent to adding s to itself n times (2)(7) s[i] i th item of s , origin 0 (3)(8) s[i:j] slice of s from i to j (3)(4) s[i:j:k] slice of s from i to j with step k (3)(5) len(s) length of s min(s) smallest item of s max(s) largest item of s Sequences of the same type also support comparisons. In particular, tuples and lists are compared lexicographically by comparing corresponding elements. This means that to compare equal, every element must compare equal and the two sequences must be of the same type and have the same length. (For full details see Comparisons in the language reference.) Forward and reversed iterators over mutable sequences access values using an index. That index will continue to march forward (or backward) even if the underlying sequence is mutated. The iterator terminates only when an IndexError or a StopIteration is encountered (or when the index drops below zero). Notes: While the in and not in operations are used only for simple containment testing in the general case, some specialised sequences (such as str , bytes and bytearray ) also use them for subsequence testing: >>> "gg" in "eggs" True Values of n less than 0 are treated as 0 (which yields an empty sequence of the same type as s ). Note that items in the sequence s are not copied; they are referenced multiple times. This often haunts new Python programmers; consider: >>> lists = [[]] * 3 >>> lists [[], [], []] >>> lists [ 0 ] . append ( 3 ) >>> lists [[3], [3], [3]] What has happened is that [[]] is a one-element list containing an empty list, so all three elements of [[]] * 3 are references to this single empty list. Modifying any of the elements of lists modifies this single list. You can create a list of different lists this way: >>> lists = [[] for i in range ( 3 )] >>> lists [ 0 ] . append ( 3 ) >>> lists [ 1 ] . append ( 5 ) >>> lists [ 2 ] . append ( 7 ) >>> lists [[3], [5], [7]] Further explanation is available in the FAQ entry How do I create a multidimensional list? . If i or j is negative, the index is relative to the end of sequence s : len(s) + i or len(s) + j is substituted. But note that -0 is still 0 . The slice of s from i to j is defined as the sequence of items with index k such that i <= k < j . If i is omitted or None , use 0 . If j is omitted or None , use len(s) . If i or j is less than -len(s) , use 0 . If i or j is greater than len(s) , use len(s) . If i is greater than or equal to j , the slice is empty. The slice of s from i to j with step k is defined as the sequence of items with index x = i + n*k such that 0 <= n < (j-i)/k . In other words, the indices are i , i+k , i+2*k , i+3*k and so on, stopping when j is reached (but never including j ). When k is positive, i and j are reduced to len(s) if they are greater. When k is negative, i and j are reduced to len(s) - 1 if they are greater. If i or j are omitted or None , they become “end” values (which end depends on the sign of k ). Note, k cannot be zero. If k is None , it is treated like 1 . Concatenating immutable sequences always results in a new object. This means that building up a sequence by repeated concatenation will have a quadratic runtime cost in the total sequence length. To get a linear runtime cost, you must switch to one of the alternatives below: if concatenating str objects, you can build a list and use str.join() at the end or else write to an io.StringIO instance and retrieve its value when complete if concatenating bytes objects, you can similarly use bytes.join() or io.BytesIO , or you can do in-place concatenation with a bytearray object. bytearray objects are mutable and have an efficient overallocation mechanism if concatenating tuple objects, extend a list instead for other types, investigate the relevant class documentation Some sequence types (such as range ) only support item sequences that follow specific patterns, and hence don’t support sequence concatenation or repetition. An IndexError is raised if i is outside the sequence range. Sequence Methods Sequence types also support the following methods: sequence. count ( value , / ) ¶ Return the total number of occurrences of value in sequence . sequence. index ( value[, start[, stop] ) ¶ Return the index of the first occurrence of value in sequence . Raises ValueError if value is not found in sequence . The start or stop arguments allow for efficient searching of subsections of the sequence, beginning at start and ending at stop . This is roughly equivalent to start + sequence[start:stop].index(value) , only without copying any data. Caution Not all sequence types support passing the start and stop arguments. Immutable Sequence Types ¶ The only operation that immutable sequence types generally implement that is not also implemented by mutable sequence types is support for the hash() built-in. This support allows immutable sequences, such as tuple instances, to be used as dict keys and stored in set and frozenset instances. Attempting to hash an immutable sequence that contains unhashable values will result in TypeError . Mutable Sequence Types ¶ The operations in the following table are defined on mutable sequence types. The collections.abc.MutableSequence ABC is provided to make it easier to correctly implement these operations on custom sequence types. In the table s is an instance of a mutable sequence type, t is any iterable object and x is an arbitrary object that meets any type and value restrictions imposed by s (for example, bytearray only accepts integers that meet the value restriction 0 <= x <= 255 ). Operation Result Notes s[i] = x item i of s is replaced by x del s[i] removes item i of s s[i:j] = t slice of s from i to j is replaced by the contents of the iterable t del s[i:j] removes the elements of s[i:j] from the list (same as s[i:j] = [] ) s[i:j:k] = t the elements of s[i:j:k] are replaced by those of t (1) del s[i:j:k] removes the elements of s[i:j:k] from the list s += t extends s with the contents of t (for the most part the same as s[len(s):len(s)] = t ) s *= n updates s with its contents repeated n times (2) Notes: If k is not equal to 1 , t must have the same length as the slice it is replacing. The value n is an integer, or an object implementing __index__() . Zero and negative values of n clear the sequence. Items in the sequence are not copied; they are referenced multiple times, as explained for s * n under Common Sequence Operations . Mutable Sequence Methods Mutable sequence types also support the following methods: sequence. append ( value , / ) ¶ Append value to the end of the sequence This is equivalent to writing seq[len(seq):len(seq)] = [value] . sequence. clear ( ) ¶ Added in version 3.3. Remove all items from sequence . This is equivalent to writing del sequence[:] . sequence. copy ( ) ¶ Added in version 3.3. Create a shallow copy of sequence . This is equivalent to writing sequence[:] . Hint The copy() method is not part of the MutableSequence ABC , but most concrete mutable sequence types provide it. sequence. extend ( iterable , / ) ¶ Extend sequence with the contents of iterable . For the most part, this is the same as writing seq[len(seq):len(seq)] = iterable . sequence. insert ( index , value , / ) ¶ Insert value into sequence at the given index . This is equivalent to writing sequence[index:index] = [value] . sequence. pop ( index = -1 , / ) ¶ Retrieve the item at index and also removes it from sequence . By default, the last item in sequence is removed and returned. sequence. remove ( value , / ) ¶ Remove the first item from sequence where sequence[i] == value . Raises ValueError if value is not found in sequence . sequence. reverse ( ) ¶ Reverse the items of sequence in place. This method maintains economy of space when reversing a large sequence. To remind users that it operates by side-effect, it returns None . Lists ¶ Lists are mutable sequences, typically used to store collections of homogeneous items (where the precise degree of similarity will vary by application). class list ( iterable = () , / ) ¶ Lists may be constructed in several ways: Using a pair of square brackets to denote the empty list: [] Using square brackets, separating items with commas: [a] , [a, b, c] Using a list comprehension: [x for x in iterable] Using the type constructor: list() or list(iterable) The constructor builds a list whose items are the same and in the same order as iterable ’s items. iterable may be either a sequence, a container that supports iteration, or an iterator object. If iterable is already a list, a copy is made and returned, similar to iterable[:] . For example, list('abc') returns ['a', 'b', 'c'] and list( (1, 2, 3) ) returns [1, 2, 3] . If no argument is given, the constructor creates a new empty list, [] . Many other operations also produce lists, including the sorted() built-in. Lists implement all of the common and mutable sequence operations. Lists also provide the following additional method: sort ( * , key = None , reverse = False ) ¶ This method sorts the list in place, using only < comparisons between items. Exceptions are not suppressed - if any comparison operations fail, the entire sort operation will fail (and the list will likely be left in a partially modified state). sort() accepts two arguments that can only be passed by keyword ( keyword-only arguments ): key specifies a function of one argument that is used to extract a comparison key from each list element (for example, key=str.lower ). The key corresponding to each item in the list is calculated once and then used for the entire sorting process. The default value of None means that list items are sorted directly without calculating a separate key value. The functools.cmp_to_key() utility is available to convert a 2.x style cmp function to a key function. reverse is a boolean value. If set to True , then the list elements are sorted as if each comparison were reversed. This method modifies the sequence in place for economy of space when sorting a large sequence. To remind users that it operates by side effect, it does not return the sorted sequence (use sorted() to explicitly request a new sorted list instance). The sort() method is guaranteed to be stable. A sort is stable if it guarantees not to change the relative order of elements that compare equal — this is helpful for sorting in multiple passes (for example, sort by department, then by salary grade). For sorting examples and a brief sorting tutorial, see Sorting Techniques . CPython implementation detail: While a list is being sorted, the effect of attempting to mutate, or even inspect, the list is undefined. The C implementation of Python makes the list appear empty for the duration, and raises ValueError if it can detect that the list has been mutated during a sort. Thread safety Reading a single element from a list is atomic : lst [ i ] # list.__getitem__ The following methods traverse the list and use atomic reads of each item to perform their function. That means that they may return results affected by concurrent modifications: item in lst lst . index ( item ) lst . count ( item ) All of the above methods/operations are also lock-free. They do not block concurrent modifications. Other operations that hold a lock will not block these from observing intermediate states. All other operations from here on block using the per-object lock. Writing a single item via lst[i] = x is safe to call from multiple threads and will not corrupt the list. The following operations return new objects and appear atomic to other threads: lst1 + lst2 # concatenates two lists into a new list x * lst # repeats lst x times into a new list lst . copy () # returns a shallow copy of the list Methods that only operate on a single elements with no shifting required are atomic : lst . append ( x ) # append to the end of the list, no shifting required lst . pop () # pop element from the end of the list, no shifting required The clear() method is also atomic . Other threads cannot observe elements being removed. The sort() method is not atomic . Other threads cannot observe intermediate states during sorting, but the list appears empty for the duration of the sort. The following operations may allow lock-free operations to observe intermediate states since they modify multiple elements in place: lst . insert ( idx , item ) # shifts elements lst . pop ( idx ) # idx not at the end of the list, shifts elements lst *= x # copies elements in place The remove() method may allow concurrent modifications since element comparison may execute arbitrary Python code (via __eq__() ). extend() is safe to call from multiple threads. However, its guarantees depend on the iterable passed to it. If it is a list , a tuple , a set , a frozenset , a dict or a dictionary view object (but not their subclasses), the extend operation is safe from concurrent modifications to the iterable. Otherwise, an iterator is created which can be concurrently modified by another thread. The same applies to inplace concatenation of a list with other iterables when using lst += iterable . Similarly, assigning to a list slice with lst[i:j] = iterable is safe to call from multiple threads, but iterable is only locked when it is also a list (but not its subclasses). Operations that involve multiple accesses, as well as iteration, are never atomic. For example: # NOT atomic: read-modify-write lst [ i ] = lst [ i ] + 1 # NOT atomic: check-then-act if lst : item = lst . pop () # NOT thread-safe: iteration while modifying for item in lst : process ( item ) # another thread may modify lst Consider external synchronization when sharing list instances across threads. See Python support for free threading for more information. Tuples ¶ Tuples are immutable sequences, typically used to store collections of heterogeneous data (such as the 2-tuples produced by the enumerate() built-in). Tuples are also used for cases where an immutable sequence of homogeneous data is needed (such as allowing storage in a set or dict instance). class tuple ( iterable = () , / ) ¶ Tuples may be constructed in a number of ways: Using a pair of parentheses to denote the empty tuple: () Using a trailing comma for a singleton tuple: a, or (a,) Separating items with commas: a, b, c or (a, b, c) Using the tuple() built-in: tuple() or tuple(iterable) The constructor builds a tuple whose items are the same and in the same order as iterable ’s items. iterable may be either a sequence, a container that supports iteration, or an iterator object. If iterable is already a tuple, it is returned unchanged. For example, tuple('abc') returns ('a', 'b', 'c') and tuple( [1, 2, 3] ) returns (1, 2, 3) . If no argument is given, the constructor creates a new empty tuple, () . Note that it is actually the comma which makes a tuple, not the parentheses. The parentheses are optional, except in the empty tuple case, or when they are needed to avoid syntactic ambiguity. For example, f(a, b, c) is a function call with three arguments, while f((a, b, c)) is a function call with a 3-tuple as the sole argument. Tuples implement all of the common sequence operations. For heterogeneous collections of data where access by name is clearer than access by index, collections.namedtuple() may be a more appropriate choice than a simple tuple object. Ranges ¶ The range type represents an immutable sequence of numbers and is commonly used for looping a specific number of times in for loops. class range ( stop , / ) ¶ class range ( start , stop , step = 1 , / ) The arguments to the range constructor must be integers (either built-in int or any object that implements the __index__() special method). If the step argument is omitted, it defaults to 1 . If the start argument is omitted, it defaults to 0 . If step is zero, ValueError is raised. For a positive step , the contents of a range r are determined by the formula r[i] = start + step*i where i >= 0 and r[i] < stop . For a negative step , the contents of the range are still determined by the formula r[i] = start + step*i , but the constraints are i >= 0 and r[i] > stop . A range object will be empty if r[0] does not meet the value constraint. Ranges do support negative indices, but these are interpreted as indexing from the end of the sequence determined by the positive indices. Ranges containing absolute values larger than sys.maxsize are permitted but some features (such as len() ) may raise OverflowError . Range examples: >>> list ( range ( 10 )) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> list ( range ( 1 , 11 )) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] >>> list ( range ( 0 , 30 , 5 )) [0, 5, 10, 15, 20, 25] >>> list ( range ( 0 , 10 , 3 )) [0, 3, 6, 9] >>> list ( range ( 0 , - 10 , - 1 )) [0, -1, -2, -3, -4, -5, -6, -7, -8, -9] >>> list ( range ( 0 )) [] >>> list ( range ( 1 , 0 )) [] Ranges implement all of the common sequence operations except concatenation and repetition (due to the fact that range objects can only represent sequences that follow a strict pattern and repetition and concatenation will usually violate that pattern). start ¶ The value of the start parameter (or 0 if the parameter was not supplied) stop ¶ The value of the stop parameter step ¶ The value of the step parameter (or 1 if the parameter was not supplied) The advantage of the range type over a regular list or tuple is that a range object will always take the same (small) amount of memory, no matter the size of the range it represents (as it only stores the start , stop and step values, calculating individual items and subranges as needed). Range objects implement the collections.abc.Sequence ABC, and provide features such as containment tests, element index lookup, slicing and support for negative indices (see Sequence Types — list, tuple, range ): >>> r = range ( 0 , 20 , 2 ) >>> r range(0, 20, 2) >>> 11 in r False >>> 10 in r True >>> r . index ( 10 ) 5 >>> r [ 5 ] 10 >>> r [: 5 ] range(0, 10, 2) >>> r [ - 1 ] 18 Testing range objects for equality with == and != compares them as sequences. That is, two range objects are considered equal if they represent the same sequence of values. (Note that two range objects that compare equal might have different start , stop and step attributes, for example range(0) == range(2, 1, 3) or range(0, 3, 2) == range(0, 4, 2) .) Changed in version 3.2: Implement the Sequence ABC. Support slicing and negative indices. Test int objects for membership in constant time instead of iterating through all items. Changed in version 3.3: Define ‘==’ and ‘!=’ to compare range objects based on the sequence of values they define (instead of comparing based on object identity). Added the start , stop and step attributes. See also The linspace recipe shows how to implement a lazy version of range suitable for floating-point applications. Text and Binary Sequence Type Methods Summary ¶ The following table summarizes the text and binary sequence types methods by category. Category str methods bytes and bytearray methods Formatting str.format() str.format_map() f-strings printf-style String Formatting printf-style Bytes Formatting Searching and Replacing str.find() str.rfind() bytes.find() bytes.rfind() str.index() str.rindex() bytes.index() bytes.rindex() str.startswith() bytes.startswith() str.endswith() bytes.endswith() str.count() bytes.count() str.replace() bytes.replace() Splitting and Joining str.split() str.rsplit() bytes.split() bytes.rsplit() str.splitlines() bytes.splitlines() str.partition() bytes.partition() str.rpartition() bytes.rpartition() str.join() bytes.join() String Classification str.isalpha() bytes.isalpha() str.isdecimal() str.isdigit() bytes.isdigit() str.isnumeric() str.isalnum() bytes.isalnum() str.isidentifier() str.islower() bytes.islower() str.isupper() bytes.isupper() str.istitle() bytes.istitle() str.isspace() bytes.isspace() str.isprintable() Case Manipulation str.lower() bytes.lower() str.upper() bytes.upper() str.casefold() str.capitalize() bytes.capitalize() str.title() bytes.title() str.swapcase() bytes.swapcase() Padding and Stripping str.ljust() str.rjust() bytes.ljust() bytes.rjust() str.center() bytes.center() str.expandtabs() bytes.expandtabs() str.strip() bytes.strip() str.lstrip() str.rstrip() bytes.lstrip() bytes.rstrip() Translation and Encoding str.translate() bytes.translate() str.maketrans() bytes.maketrans() str.encode() bytes.decode() Text Sequence Type — str ¶ Textual data in Python is handled with str objects, or strings . Strings are immutable sequences of Unicode code points. String literals are written in a variety of ways: Single quotes: 'allows embedded "double" quotes' Double quotes: "allows embedded 'single' quotes" Triple quoted: '''Three single quotes''' , """Three double quotes""" Triple quoted strings may span multiple lines - all associated whitespace will be included in the string literal. String literals that are part of a single expression and have only whitespace between them will be implicitly converted to a single string literal. That is, ("spam " "eggs") == "spam eggs" . See String and Bytes literals for more about the various forms of string literal | 2026-01-13T08:48:44 |
https://docs.python.org/3/library/random.html#module-random | random — Generate pseudo-random numbers — Python 3.14.2 documentation Theme Auto Light Dark Table of Contents random — Generate pseudo-random numbers Bookkeeping functions Functions for bytes Functions for integers Functions for sequences Discrete distributions Real-valued distributions Alternative Generator Notes on Reproducibility Examples Recipes Command-line usage Command-line example Previous topic fractions — Rational numbers Next topic statistics — Mathematical statistics functions This page Report a bug Show source Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Standard Library » Numeric and Mathematical Modules » random — Generate pseudo-random numbers | Theme Auto Light Dark | random — Generate pseudo-random numbers ¶ Source code: Lib/random.py This module implements pseudo-random number generators for various distributions. For integers, there is uniform selection from a range. For sequences, there is uniform selection of a random element, a function to generate a random permutation of a list in-place, and a function for random sampling without replacement. On the real line, there are functions to compute uniform, normal (Gaussian), lognormal, negative exponential, gamma, and beta distributions. For generating distributions of angles, the von Mises distribution is available. Almost all module functions depend on the basic function random() , which generates a random float uniformly in the half-open range 0.0 <= X < 1.0 . Python uses the Mersenne Twister as the core generator. It produces 53-bit precision floats and has a period of 2**19937-1. The underlying implementation in C is both fast and threadsafe. The Mersenne Twister is one of the most extensively tested random number generators in existence. However, being completely deterministic, it is not suitable for all purposes, and is completely unsuitable for cryptographic purposes. The functions supplied by this module are actually bound methods of a hidden instance of the random.Random class. You can instantiate your own instances of Random to get generators that don’t share state. Class Random can also be subclassed if you want to use a different basic generator of your own devising: see the documentation on that class for more details. The random module also provides the SystemRandom class which uses the system function os.urandom() to generate random numbers from sources provided by the operating system. Warning The pseudo-random generators of this module should not be used for security purposes. For security or cryptographic uses, see the secrets module. See also M. Matsumoto and T. Nishimura, “Mersenne Twister: A 623-dimensionally equidistributed uniform pseudorandom number generator”, ACM Transactions on Modeling and Computer Simulation Vol. 8, No. 1, January pp.3–30 1998. Complementary-Multiply-with-Carry recipe for a compatible alternative random number generator with a long period and comparatively simple update operations. Note The global random number generator and instances of Random are thread-safe. However, in the free-threaded build, concurrent calls to the global generator or to the same instance of Random may encounter contention and poor performance. Consider using separate instances of Random per thread instead. Bookkeeping functions ¶ random. seed ( a = None , version = 2 ) ¶ Initialize the random number generator. If a is omitted or None , the current system time is used. If randomness sources are provided by the operating system, they are used instead of the system time (see the os.urandom() function for details on availability). If a is an int, its absolute value is used directly. With version 2 (the default), a str , bytes , or bytearray object gets converted to an int and all of its bits are used. With version 1 (provided for reproducing random sequences from older versions of Python), the algorithm for str and bytes generates a narrower range of seeds. Changed in version 3.2: Moved to the version 2 scheme which uses all of the bits in a string seed. Changed in version 3.11: The seed must be one of the following types: None , int , float , str , bytes , or bytearray . random. getstate ( ) ¶ Return an object capturing the current internal state of the generator. This object can be passed to setstate() to restore the state. random. setstate ( state ) ¶ state should have been obtained from a previous call to getstate() , and setstate() restores the internal state of the generator to what it was at the time getstate() was called. Functions for bytes ¶ random. randbytes ( n ) ¶ Generate n random bytes. This method should not be used for generating security tokens. Use secrets.token_bytes() instead. Added in version 3.9. Functions for integers ¶ random. randrange ( stop ) ¶ random. randrange ( start , stop [ , step ] ) Return a randomly selected element from range(start, stop, step) . This is roughly equivalent to choice(range(start, stop, step)) but supports arbitrarily large ranges and is optimized for common cases. The positional argument pattern matches the range() function. Keyword arguments should not be used because they can be interpreted in unexpected ways. For example randrange(start=100) is interpreted as randrange(0, 100, 1) . Changed in version 3.2: randrange() is more sophisticated about producing equally distributed values. Formerly it used a style like int(random()*n) which could produce slightly uneven distributions. Changed in version 3.12: Automatic conversion of non-integer types is no longer supported. Calls such as randrange(10.0) and randrange(Fraction(10, 1)) now raise a TypeError . random. randint ( a , b ) ¶ Return a random integer N such that a <= N <= b . Alias for randrange(a, b+1) . random. getrandbits ( k ) ¶ Returns a non-negative Python integer with k random bits. This method is supplied with the Mersenne Twister generator and some other generators may also provide it as an optional part of the API. When available, getrandbits() enables randrange() to handle arbitrarily large ranges. Changed in version 3.9: This method now accepts zero for k . Functions for sequences ¶ random. choice ( seq ) ¶ Return a random element from the non-empty sequence seq . If seq is empty, raises IndexError . random. choices ( population , weights = None , * , cum_weights = None , k = 1 ) ¶ Return a k sized list of elements chosen from the population with replacement. If the population is empty, raises IndexError . If a weights sequence is specified, selections are made according to the relative weights. Alternatively, if a cum_weights sequence is given, the selections are made according to the cumulative weights (perhaps computed using itertools.accumulate() ). For example, the relative weights [10, 5, 30, 5] are equivalent to the cumulative weights [10, 15, 45, 50] . Internally, the relative weights are converted to cumulative weights before making selections, so supplying the cumulative weights saves work. If neither weights nor cum_weights are specified, selections are made with equal probability. If a weights sequence is supplied, it must be the same length as the population sequence. It is a TypeError to specify both weights and cum_weights . The weights or cum_weights can use any numeric type that interoperates with the float values returned by random() (that includes integers, floats, and fractions but excludes decimals). Weights are assumed to be non-negative and finite. A ValueError is raised if all weights are zero. For a given seed, the choices() function with equal weighting typically produces a different sequence than repeated calls to choice() . The algorithm used by choices() uses floating-point arithmetic for internal consistency and speed. The algorithm used by choice() defaults to integer arithmetic with repeated selections to avoid small biases from round-off error. Added in version 3.6. Changed in version 3.9: Raises a ValueError if all weights are zero. random. shuffle ( x ) ¶ Shuffle the sequence x in place. To shuffle an immutable sequence and return a new shuffled list, use sample(x, k=len(x)) instead. Note that even for small len(x) , the total number of permutations of x can quickly grow larger than the period of most random number generators. This implies that most permutations of a long sequence can never be generated. For example, a sequence of length 2080 is the largest that can fit within the period of the Mersenne Twister random number generator. Changed in version 3.11: Removed the optional parameter random . random. sample ( population , k , * , counts = None ) ¶ Return a k length list of unique elements chosen from the population sequence. Used for random sampling without replacement. Returns a new list containing elements from the population while leaving the original population unchanged. The resulting list is in selection order so that all sub-slices will also be valid random samples. This allows raffle winners (the sample) to be partitioned into grand prize and second place winners (the subslices). Members of the population need not be hashable or unique. If the population contains repeats, then each occurrence is a possible selection in the sample. Repeated elements can be specified one at a time or with the optional keyword-only counts parameter. For example, sample(['red', 'blue'], counts=[4, 2], k=5) is equivalent to sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5) . To choose a sample from a range of integers, use a range() object as an argument. This is especially fast and space efficient for sampling from a large population: sample(range(10000000), k=60) . If the sample size is larger than the population size, a ValueError is raised. Changed in version 3.9: Added the counts parameter. Changed in version 3.11: The population must be a sequence. Automatic conversion of sets to lists is no longer supported. Discrete distributions ¶ The following function generates a discrete distribution. random. binomialvariate ( n = 1 , p = 0.5 ) ¶ Binomial distribution . Return the number of successes for n independent trials with the probability of success in each trial being p : Mathematically equivalent to: sum ( random () < p for i in range ( n )) The number of trials n should be a non-negative integer. The probability of success p should be between 0.0 <= p <= 1.0 . The result is an integer in the range 0 <= X <= n . Added in version 3.12. Real-valued distributions ¶ The following functions generate specific real-valued distributions. Function parameters are named after the corresponding variables in the distribution’s equation, as used in common mathematical practice; most of these equations can be found in any statistics text. random. random ( ) ¶ Return the next random floating-point number in the range 0.0 <= X < 1.0 random. uniform ( a , b ) ¶ Return a random floating-point number N such that a <= N <= b for a <= b and b <= N <= a for b < a . The end-point value b may or may not be included in the range depending on floating-point rounding in the expression a + (b-a) * random() . random. triangular ( low , high , mode ) ¶ Return a random floating-point number N such that low <= N <= high and with the specified mode between those bounds. The low and high bounds default to zero and one. The mode argument defaults to the midpoint between the bounds, giving a symmetric distribution. random. betavariate ( alpha , beta ) ¶ Beta distribution. Conditions on the parameters are alpha > 0 and beta > 0 . Returned values range between 0 and 1. random. expovariate ( lambd = 1.0 ) ¶ Exponential distribution. lambd is 1.0 divided by the desired mean. It should be nonzero. (The parameter would be called “lambda”, but that is a reserved word in Python.) Returned values range from 0 to positive infinity if lambd is positive, and from negative infinity to 0 if lambd is negative. Changed in version 3.12: Added the default value for lambd . random. gammavariate ( alpha , beta ) ¶ Gamma distribution. ( Not the gamma function!) The shape and scale parameters, alpha and beta , must have positive values. (Calling conventions vary and some sources define ‘beta’ as the inverse of the scale). The probability distribution function is: x ** ( alpha - 1 ) * math . exp ( - x / beta ) pdf ( x ) = -------------------------------------- math . gamma ( alpha ) * beta ** alpha random. gauss ( mu = 0.0 , sigma = 1.0 ) ¶ Normal distribution, also called the Gaussian distribution. mu is the mean, and sigma is the standard deviation. This is slightly faster than the normalvariate() function defined below. Multithreading note: When two threads call this function simultaneously, it is possible that they will receive the same return value. This can be avoided in three ways. 1) Have each thread use a different instance of the random number generator. 2) Put locks around all calls. 3) Use the slower, but thread-safe normalvariate() function instead. Changed in version 3.11: mu and sigma now have default arguments. random. lognormvariate ( mu , sigma ) ¶ Log normal distribution. If you take the natural logarithm of this distribution, you’ll get a normal distribution with mean mu and standard deviation sigma . mu can have any value, and sigma must be greater than zero. random. normalvariate ( mu = 0.0 , sigma = 1.0 ) ¶ Normal distribution. mu is the mean, and sigma is the standard deviation. Changed in version 3.11: mu and sigma now have default arguments. random. vonmisesvariate ( mu , kappa ) ¶ mu is the mean angle, expressed in radians between 0 and 2* pi , and kappa is the concentration parameter, which must be greater than or equal to zero. If kappa is equal to zero, this distribution reduces to a uniform random angle over the range 0 to 2* pi . random. paretovariate ( alpha ) ¶ Pareto distribution. alpha is the shape parameter. random. weibullvariate ( alpha , beta ) ¶ Weibull distribution. alpha is the scale parameter and beta is the shape parameter. Alternative Generator ¶ class random. Random ( [ seed ] ) ¶ Class that implements the default pseudo-random number generator used by the random module. Changed in version 3.11: Formerly the seed could be any hashable object. Now it is limited to: None , int , float , str , bytes , or bytearray . Subclasses of Random should override the following methods if they wish to make use of a different basic generator: seed ( a = None , version = 2 ) ¶ Override this method in subclasses to customise the seed() behaviour of Random instances. getstate ( ) ¶ Override this method in subclasses to customise the getstate() behaviour of Random instances. setstate ( state ) ¶ Override this method in subclasses to customise the setstate() behaviour of Random instances. random ( ) ¶ Override this method in subclasses to customise the random() behaviour of Random instances. Optionally, a custom generator subclass can also supply the following method: getrandbits ( k ) ¶ Override this method in subclasses to customise the getrandbits() behaviour of Random instances. randbytes ( n ) ¶ Override this method in subclasses to customise the randbytes() behaviour of Random instances. class random. SystemRandom ( [ seed ] ) ¶ Class that uses the os.urandom() function for generating random numbers from sources provided by the operating system. Not available on all systems. Does not rely on software state, and sequences are not reproducible. Accordingly, the seed() method has no effect and is ignored. The getstate() and setstate() methods raise NotImplementedError if called. Notes on Reproducibility ¶ Sometimes it is useful to be able to reproduce the sequences given by a pseudo-random number generator. By reusing a seed value, the same sequence should be reproducible from run to run as long as multiple threads are not running. Most of the random module’s algorithms and seeding functions are subject to change across Python versions, but two aspects are guaranteed not to change: If a new seeding method is added, then a backward compatible seeder will be offered. The generator’s random() method will continue to produce the same sequence when the compatible seeder is given the same seed. Examples ¶ Basic examples: >>> random () # Random float: 0.0 <= x < 1.0 0.37444887175646646 >>> uniform ( 2.5 , 10.0 ) # Random float: 2.5 <= x <= 10.0 3.1800146073117523 >>> expovariate ( 1 / 5 ) # Interval between arrivals averaging 5 seconds 5.148957571865031 >>> randrange ( 10 ) # Integer from 0 to 9 inclusive 7 >>> randrange ( 0 , 101 , 2 ) # Even integer from 0 to 100 inclusive 26 >>> choice ([ 'win' , 'lose' , 'draw' ]) # Single random element from a sequence 'draw' >>> deck = 'ace two three four' . split () >>> shuffle ( deck ) # Shuffle a list >>> deck ['four', 'two', 'ace', 'three'] >>> sample ([ 10 , 20 , 30 , 40 , 50 ], k = 4 ) # Four samples without replacement [40, 10, 50, 30] Simulations: >>> # Six roulette wheel spins (weighted sampling with replacement) >>> choices ([ 'red' , 'black' , 'green' ], [ 18 , 18 , 2 ], k = 6 ) ['red', 'green', 'black', 'black', 'red', 'black'] >>> # Deal 20 cards without replacement from a deck >>> # of 52 playing cards, and determine the proportion of cards >>> # with a ten-value: ten, jack, queen, or king. >>> deal = sample ([ 'tens' , 'low cards' ], counts = [ 16 , 36 ], k = 20 ) >>> deal . count ( 'tens' ) / 20 0.15 >>> # Estimate the probability of getting 5 or more heads from 7 spins >>> # of a biased coin that settles on heads 60% of the time. >>> sum ( binomialvariate ( n = 7 , p = 0.6 ) >= 5 for i in range ( 10_000 )) / 10_000 0.4169 >>> # Probability of the median of 5 samples being in middle two quartiles >>> def trial (): ... return 2_500 <= sorted ( choices ( range ( 10_000 ), k = 5 ))[ 2 ] < 7_500 ... >>> sum ( trial () for i in range ( 10_000 )) / 10_000 0.7958 Example of statistical bootstrapping using resampling with replacement to estimate a confidence interval for the mean of a sample: # https://www.thoughtco.com/example-of-bootstrapping-3126155 from statistics import fmean as mean from random import choices data = [ 41 , 50 , 29 , 37 , 81 , 30 , 73 , 63 , 20 , 35 , 68 , 22 , 60 , 31 , 95 ] means = sorted ( mean ( choices ( data , k = len ( data ))) for i in range ( 100 )) print ( f 'The sample mean of { mean ( data ) : .1f } has a 90% confidence ' f 'interval from { means [ 5 ] : .1f } to { means [ 94 ] : .1f } ' ) Example of a resampling permutation test to determine the statistical significance or p-value of an observed difference between the effects of a drug versus a placebo: # Example from "Statistics is Easy" by Dennis Shasha and Manda Wilson from statistics import fmean as mean from random import shuffle drug = [ 54 , 73 , 53 , 70 , 73 , 68 , 52 , 65 , 65 ] placebo = [ 54 , 51 , 58 , 44 , 55 , 52 , 42 , 47 , 58 , 46 ] observed_diff = mean ( drug ) - mean ( placebo ) n = 10_000 count = 0 combined = drug + placebo for i in range ( n ): shuffle ( combined ) new_diff = mean ( combined [: len ( drug )]) - mean ( combined [ len ( drug ):]) count += ( new_diff >= observed_diff ) print ( f ' { n } label reshufflings produced only { count } instances with a difference' ) print ( f 'at least as extreme as the observed difference of { observed_diff : .1f } .' ) print ( f 'The one-sided p-value of { count / n : .4f } leads us to reject the null' ) print ( f 'hypothesis that there is no difference between the drug and the placebo.' ) Simulation of arrival times and service deliveries for a multiserver queue: from heapq import heapify , heapreplace from random import expovariate , gauss from statistics import mean , quantiles average_arrival_interval = 5.6 average_service_time = 15.0 stdev_service_time = 3.5 num_servers = 3 waits = [] arrival_time = 0.0 servers = [ 0.0 ] * num_servers # time when each server becomes available heapify ( servers ) for i in range ( 1_000_000 ): arrival_time += expovariate ( 1.0 / average_arrival_interval ) next_server_available = servers [ 0 ] wait = max ( 0.0 , next_server_available - arrival_time ) waits . append ( wait ) service_duration = max ( 0.0 , gauss ( average_service_time , stdev_service_time )) service_completed = arrival_time + wait + service_duration heapreplace ( servers , service_completed ) print ( f 'Mean wait: { mean ( waits ) : .1f } Max wait: { max ( waits ) : .1f } ' ) print ( 'Quartiles:' , [ round ( q , 1 ) for q in quantiles ( waits )]) See also Statistics for Hackers a video tutorial by Jake Vanderplas on statistical analysis using just a few fundamental concepts including simulation, sampling, shuffling, and cross-validation. Economics Simulation a simulation of a marketplace by Peter Norvig that shows effective use of many of the tools and distributions provided by this module (gauss, uniform, sample, betavariate, choice, triangular, and randrange). A Concrete Introduction to Probability (using Python) a tutorial by Peter Norvig covering the basics of probability theory, how to write simulations, and how to perform data analysis using Python. Recipes ¶ These recipes show how to efficiently make random selections from the combinatoric iterators in the itertools module: import random def random_product ( * iterables , repeat = 1 ): "Random selection from itertools.product(*iterables, repeat=repeat)" pools = tuple ( map ( tuple , iterables )) * repeat return tuple ( map ( random . choice , pools )) def random_permutation ( iterable , r = None ): "Random selection from itertools.permutations(iterable, r)" pool = tuple ( iterable ) r = len ( pool ) if r is None else r return tuple ( random . sample ( pool , r )) def random_combination ( iterable , r ): "Random selection from itertools.combinations(iterable, r)" pool = tuple ( iterable ) n = len ( pool ) indices = sorted ( random . sample ( range ( n ), r )) return tuple ( pool [ i ] for i in indices ) def random_combination_with_replacement ( iterable , r ): "Choose r elements with replacement. Order the result to match the iterable." # Result will be in set(itertools.combinations_with_replacement(iterable, r)). pool = tuple ( iterable ) n = len ( pool ) indices = sorted ( random . choices ( range ( n ), k = r )) return tuple ( pool [ i ] for i in indices ) def random_derangement ( iterable ): "Choose a permutation where no element stays in its original position." seq = tuple ( iterable ) if len ( seq ) < 2 : if not seq : return () raise IndexError ( 'No derangments to choose from' ) perm = list ( range ( len ( seq ))) start = tuple ( perm ) while True : random . shuffle ( perm ) if all ( p != q for p , q in zip ( start , perm )): return tuple ([ seq [ i ] for i in perm ]) The default random() returns multiples of 2⁻⁵³ in the range 0.0 ≤ x < 1.0 . All such numbers are evenly spaced and are exactly representable as Python floats. However, many other representable floats in that interval are not possible selections. For example, 0.05954861408025609 isn’t an integer multiple of 2⁻⁵³. The following recipe takes a different approach. All floats in the interval are possible selections. The mantissa comes from a uniform distribution of integers in the range 2⁵² ≤ mantissa < 2⁵³ . The exponent comes from a geometric distribution where exponents smaller than -53 occur half as often as the next larger exponent. from random import Random from math import ldexp class FullRandom ( Random ): def random ( self ): mantissa = 0x10_0000_0000_0000 | self . getrandbits ( 52 ) exponent = - 53 x = 0 while not x : x = self . getrandbits ( 32 ) exponent += x . bit_length () - 32 return ldexp ( mantissa , exponent ) All real valued distributions in the class will use the new method: >>> fr = FullRandom () >>> fr . random () 0.05954861408025609 >>> fr . expovariate ( 0.25 ) 8.87925541791544 The recipe is conceptually equivalent to an algorithm that chooses from all the multiples of 2⁻¹⁰⁷⁴ in the range 0.0 ≤ x < 1.0 . All such numbers are evenly spaced, but most have to be rounded down to the nearest representable Python float. (The value 2⁻¹⁰⁷⁴ is the smallest positive unnormalized float and is equal to math.ulp(0.0) .) See also Generating Pseudo-random Floating-Point Values a paper by Allen B. Downey describing ways to generate more fine-grained floats than normally generated by random() . Command-line usage ¶ Added in version 3.13. The random module can be executed from the command line. python -m random [ -h ] [ -c CHOICE [ CHOICE ... ] | -i N | -f N ] [ input ... ] The following options are accepted: -h , --help ¶ Show the help message and exit. -c CHOICE [CHOICE ...] ¶ --choice CHOICE [CHOICE ...] ¶ Print a random choice, using choice() . -i <N> ¶ --integer <N> ¶ Print a random integer between 1 and N inclusive, using randint() . -f <N> ¶ --float <N> ¶ Print a random floating-point number between 0 and N inclusive, using uniform() . If no options are given, the output depends on the input: String or multiple: same as --choice . Integer: same as --integer . Float: same as --float . Command-line example ¶ Here are some examples of the random command-line interface: $ # Choose one at random $ python -m random egg bacon sausage spam "Lobster Thermidor aux crevettes with a Mornay sauce" Lobster Thermidor aux crevettes with a Mornay sauce $ # Random integer $ python -m random 6 6 $ # Random floating-point number $ python -m random 1 .8 1.7080016272295635 $ # With explicit arguments $ python -m random --choice egg bacon sausage spam "Lobster Thermidor aux crevettes with a Mornay sauce" egg $ python -m random --integer 6 3 $ python -m random --float 1 .8 1.5666339105010318 $ python -m random --integer 6 5 $ python -m random --float 6 3.1942323316565915 Table of Contents random — Generate pseudo-random numbers Bookkeeping functions Functions for bytes Functions for integers Functions for sequences Discrete distributions Real-valued distributions Alternative Generator Notes on Reproducibility Examples Recipes Command-line usage Command-line example Previous topic fractions — Rational numbers Next topic statistics — Mathematical statistics functions This page Report a bug Show source « Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Standard Library » Numeric and Mathematical Modules » random — Generate pseudo-random numbers | Theme Auto Light Dark | © Copyright 2001 Python Software Foundation. This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. See History and License for more information. The Python Software Foundation is a non-profit corporation. Please donate. Last updated on Jan 13, 2026 (06:19 UTC). Found a bug ? Created using Sphinx 8.2.3. | 2026-01-13T08:48:44 |
https://docs.python.org/3/tutorial/controlflow.html#function-examples | 4. More Control Flow Tools — Python 3.14.2 documentation Theme Auto Light Dark Table of Contents 4. More Control Flow Tools 4.1. if Statements 4.2. for Statements 4.3. The range() Function 4.4. break and continue Statements 4.5. else Clauses on Loops 4.6. pass Statements 4.7. match Statements 4.8. Defining Functions 4.9. More on Defining Functions 4.9.1. Default Argument Values 4.9.2. Keyword Arguments 4.9.3. Special parameters 4.9.3.1. Positional-or-Keyword Arguments 4.9.3.2. Positional-Only Parameters 4.9.3.3. Keyword-Only Arguments 4.9.3.4. Function Examples 4.9.3.5. Recap 4.9.4. Arbitrary Argument Lists 4.9.5. Unpacking Argument Lists 4.9.6. Lambda Expressions 4.9.7. Documentation Strings 4.9.8. Function Annotations 4.10. Intermezzo: Coding Style Previous topic 3. An Informal Introduction to Python Next topic 5. Data Structures This page Report a bug Show source Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 4. More Control Flow Tools | Theme Auto Light Dark | 4. More Control Flow Tools ¶ As well as the while statement just introduced, Python uses a few more that we will encounter in this chapter. 4.1. if Statements ¶ Perhaps the most well-known statement type is the if statement. For example: >>> x = int ( input ( "Please enter an integer: " )) Please enter an integer: 42 >>> if x < 0 : ... x = 0 ... print ( 'Negative changed to zero' ) ... elif x == 0 : ... print ( 'Zero' ) ... elif x == 1 : ... print ( 'Single' ) ... else : ... print ( 'More' ) ... More There can be zero or more elif parts, and the else part is optional. The keyword ‘ elif ’ is short for ‘else if’, and is useful to avoid excessive indentation. An if … elif … elif … sequence is a substitute for the switch or case statements found in other languages. If you’re comparing the same value to several constants, or checking for specific types or attributes, you may also find the match statement useful. For more details see match Statements . 4.2. for Statements ¶ The for statement in Python differs a bit from what you may be used to in C or Pascal. Rather than always iterating over an arithmetic progression of numbers (like in Pascal), or giving the user the ability to define both the iteration step and halting condition (as C), Python’s for statement iterates over the items of any sequence (a list or a string), in the order that they appear in the sequence. For example (no pun intended): >>> # Measure some strings: >>> words = [ 'cat' , 'window' , 'defenestrate' ] >>> for w in words : ... print ( w , len ( w )) ... cat 3 window 6 defenestrate 12 Code that modifies a collection while iterating over that same collection can be tricky to get right. Instead, it is usually more straight-forward to loop over a copy of the collection or to create a new collection: # Create a sample collection users = { 'Hans' : 'active' , 'Éléonore' : 'inactive' , '景太郎' : 'active' } # Strategy: Iterate over a copy for user , status in users . copy () . items (): if status == 'inactive' : del users [ user ] # Strategy: Create a new collection active_users = {} for user , status in users . items (): if status == 'active' : active_users [ user ] = status 4.3. The range() Function ¶ If you do need to iterate over a sequence of numbers, the built-in function range() comes in handy. It generates arithmetic progressions: >>> for i in range ( 5 ): ... print ( i ) ... 0 1 2 3 4 The given end point is never part of the generated sequence; range(10) generates 10 values, the legal indices for items of a sequence of length 10. It is possible to let the range start at another number, or to specify a different increment (even negative; sometimes this is called the ‘step’): >>> list ( range ( 5 , 10 )) [5, 6, 7, 8, 9] >>> list ( range ( 0 , 10 , 3 )) [0, 3, 6, 9] >>> list ( range ( - 10 , - 100 , - 30 )) [-10, -40, -70] To iterate over the indices of a sequence, you can combine range() and len() as follows: >>> a = [ 'Mary' , 'had' , 'a' , 'little' , 'lamb' ] >>> for i in range ( len ( a )): ... print ( i , a [ i ]) ... 0 Mary 1 had 2 a 3 little 4 lamb In most such cases, however, it is convenient to use the enumerate() function, see Looping Techniques . A strange thing happens if you just print a range: >>> range ( 10 ) range(0, 10) In many ways the object returned by range() behaves as if it is a list, but in fact it isn’t. It is an object which returns the successive items of the desired sequence when you iterate over it, but it doesn’t really make the list, thus saving space. We say such an object is iterable , that is, suitable as a target for functions and constructs that expect something from which they can obtain successive items until the supply is exhausted. We have seen that the for statement is such a construct, while an example of a function that takes an iterable is sum() : >>> sum ( range ( 4 )) # 0 + 1 + 2 + 3 6 Later we will see more functions that return iterables and take iterables as arguments. In chapter Data Structures , we will discuss in more detail about list() . 4.4. break and continue Statements ¶ The break statement breaks out of the innermost enclosing for or while loop: >>> for n in range ( 2 , 10 ): ... for x in range ( 2 , n ): ... if n % x == 0 : ... print ( f " { n } equals { x } * { n // x } " ) ... break ... 4 equals 2 * 2 6 equals 2 * 3 8 equals 2 * 4 9 equals 3 * 3 The continue statement continues with the next iteration of the loop: >>> for num in range ( 2 , 10 ): ... if num % 2 == 0 : ... print ( f "Found an even number { num } " ) ... continue ... print ( f "Found an odd number { num } " ) ... Found an even number 2 Found an odd number 3 Found an even number 4 Found an odd number 5 Found an even number 6 Found an odd number 7 Found an even number 8 Found an odd number 9 4.5. else Clauses on Loops ¶ In a for or while loop the break statement may be paired with an else clause. If the loop finishes without executing the break , the else clause executes. In a for loop, the else clause is executed after the loop finishes its final iteration, that is, if no break occurred. In a while loop, it’s executed after the loop’s condition becomes false. In either kind of loop, the else clause is not executed if the loop was terminated by a break . Of course, other ways of ending the loop early, such as a return or a raised exception, will also skip execution of the else clause. This is exemplified in the following for loop, which searches for prime numbers: >>> for n in range ( 2 , 10 ): ... for x in range ( 2 , n ): ... if n % x == 0 : ... print ( n , 'equals' , x , '*' , n // x ) ... break ... else : ... # loop fell through without finding a factor ... print ( n , 'is a prime number' ) ... 2 is a prime number 3 is a prime number 4 equals 2 * 2 5 is a prime number 6 equals 2 * 3 7 is a prime number 8 equals 2 * 4 9 equals 3 * 3 (Yes, this is the correct code. Look closely: the else clause belongs to the for loop, not the if statement.) One way to think of the else clause is to imagine it paired with the if inside the loop. As the loop executes, it will run a sequence like if/if/if/else. The if is inside the loop, encountered a number of times. If the condition is ever true, a break will happen. If the condition is never true, the else clause outside the loop will execute. When used with a loop, the else clause has more in common with the else clause of a try statement than it does with that of if statements: a try statement’s else clause runs when no exception occurs, and a loop’s else clause runs when no break occurs. For more on the try statement and exceptions, see Handling Exceptions . 4.6. pass Statements ¶ The pass statement does nothing. It can be used when a statement is required syntactically but the program requires no action. For example: >>> while True : ... pass # Busy-wait for keyboard interrupt (Ctrl+C) ... This is commonly used for creating minimal classes: >>> class MyEmptyClass : ... pass ... Another place pass can be used is as a place-holder for a function or conditional body when you are working on new code, allowing you to keep thinking at a more abstract level. The pass is silently ignored: >>> def initlog ( * args ): ... pass # Remember to implement this! ... For this last case, many people use the ellipsis literal ... instead of pass . This use has no special meaning to Python, and is not part of the language definition (you could use any constant expression here), but ... is used conventionally as a placeholder body as well. See The Ellipsis Object . 4.7. match Statements ¶ A match statement takes an expression and compares its value to successive patterns given as one or more case blocks. This is superficially similar to a switch statement in C, Java or JavaScript (and many other languages), but it’s more similar to pattern matching in languages like Rust or Haskell. Only the first pattern that matches gets executed and it can also extract components (sequence elements or object attributes) from the value into variables. If no case matches, none of the branches is executed. The simplest form compares a subject value against one or more literals: def http_error ( status ): match status : case 400 : return "Bad request" case 404 : return "Not found" case 418 : return "I'm a teapot" case _ : return "Something's wrong with the internet" Note the last block: the “variable name” _ acts as a wildcard and never fails to match. You can combine several literals in a single pattern using | (“or”): case 401 | 403 | 404 : return "Not allowed" Patterns can look like unpacking assignments, and can be used to bind variables: # point is an (x, y) tuple match point : case ( 0 , 0 ): print ( "Origin" ) case ( 0 , y ): print ( f "Y= { y } " ) case ( x , 0 ): print ( f "X= { x } " ) case ( x , y ): print ( f "X= { x } , Y= { y } " ) case _ : raise ValueError ( "Not a point" ) Study that one carefully! The first pattern has two literals, and can be thought of as an extension of the literal pattern shown above. But the next two patterns combine a literal and a variable, and the variable binds a value from the subject ( point ). The fourth pattern captures two values, which makes it conceptually similar to the unpacking assignment (x, y) = point . If you are using classes to structure your data you can use the class name followed by an argument list resembling a constructor, but with the ability to capture attributes into variables: class Point : def __init__ ( self , x , y ): self . x = x self . y = y def where_is ( point ): match point : case Point ( x = 0 , y = 0 ): print ( "Origin" ) case Point ( x = 0 , y = y ): print ( f "Y= { y } " ) case Point ( x = x , y = 0 ): print ( f "X= { x } " ) case Point (): print ( "Somewhere else" ) case _ : print ( "Not a point" ) You can use positional parameters with some builtin classes that provide an ordering for their attributes (e.g. dataclasses). You can also define a specific position for attributes in patterns by setting the __match_args__ special attribute in your classes. If it’s set to (“x”, “y”), the following patterns are all equivalent (and all bind the y attribute to the var variable): Point ( 1 , var ) Point ( 1 , y = var ) Point ( x = 1 , y = var ) Point ( y = var , x = 1 ) A recommended way to read patterns is to look at them as an extended form of what you would put on the left of an assignment, to understand which variables would be set to what. Only the standalone names (like var above) are assigned to by a match statement. Dotted names (like foo.bar ), attribute names (the x= and y= above) or class names (recognized by the “(…)” next to them like Point above) are never assigned to. Patterns can be arbitrarily nested. For example, if we have a short list of Points, with __match_args__ added, we could match it like this: class Point : __match_args__ = ( 'x' , 'y' ) def __init__ ( self , x , y ): self . x = x self . y = y match points : case []: print ( "No points" ) case [ Point ( 0 , 0 )]: print ( "The origin" ) case [ Point ( x , y )]: print ( f "Single point { x } , { y } " ) case [ Point ( 0 , y1 ), Point ( 0 , y2 )]: print ( f "Two on the Y axis at { y1 } , { y2 } " ) case _ : print ( "Something else" ) We can add an if clause to a pattern, known as a “guard”. If the guard is false, match goes on to try the next case block. Note that value capture happens before the guard is evaluated: match point : case Point ( x , y ) if x == y : print ( f "Y=X at { x } " ) case Point ( x , y ): print ( f "Not on the diagonal" ) Several other key features of this statement: Like unpacking assignments, tuple and list patterns have exactly the same meaning and actually match arbitrary sequences. An important exception is that they don’t match iterators or strings. Sequence patterns support extended unpacking: [x, y, *rest] and (x, y, *rest) work similar to unpacking assignments. The name after * may also be _ , so (x, y, *_) matches a sequence of at least two items without binding the remaining items. Mapping patterns: {"bandwidth": b, "latency": l} captures the "bandwidth" and "latency" values from a dictionary. Unlike sequence patterns, extra keys are ignored. An unpacking like **rest is also supported. (But **_ would be redundant, so it is not allowed.) Subpatterns may be captured using the as keyword: case ( Point ( x1 , y1 ), Point ( x2 , y2 ) as p2 ): ... will capture the second element of the input as p2 (as long as the input is a sequence of two points) Most literals are compared by equality, however the singletons True , False and None are compared by identity. Patterns may use named constants. These must be dotted names to prevent them from being interpreted as capture variable: from enum import Enum class Color ( Enum ): RED = 'red' GREEN = 'green' BLUE = 'blue' color = Color ( input ( "Enter your choice of 'red', 'blue' or 'green': " )) match color : case Color . RED : print ( "I see red!" ) case Color . GREEN : print ( "Grass is green" ) case Color . BLUE : print ( "I'm feeling the blues :(" ) For a more detailed explanation and additional examples, you can look into PEP 636 which is written in a tutorial format. 4.8. Defining Functions ¶ We can create a function that writes the Fibonacci series to an arbitrary boundary: >>> def fib ( n ): # write Fibonacci series less than n ... """Print a Fibonacci series less than n.""" ... a , b = 0 , 1 ... while a < n : ... print ( a , end = ' ' ) ... a , b = b , a + b ... print () ... >>> # Now call the function we just defined: >>> fib ( 2000 ) 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 The keyword def introduces a function definition . It must be followed by the function name and the parenthesized list of formal parameters. The statements that form the body of the function start at the next line, and must be indented. The first statement of the function body can optionally be a string literal; this string literal is the function’s documentation string, or docstring . (More about docstrings can be found in the section Documentation Strings .) There are tools which use docstrings to automatically produce online or printed documentation, or to let the user interactively browse through code; it’s good practice to include docstrings in code that you write, so make a habit of it. The execution of a function introduces a new symbol table used for the local variables of the function. More precisely, all variable assignments in a function store the value in the local symbol table; whereas variable references first look in the local symbol table, then in the local symbol tables of enclosing functions, then in the global symbol table, and finally in the table of built-in names. Thus, global variables and variables of enclosing functions cannot be directly assigned a value within a function (unless, for global variables, named in a global statement, or, for variables of enclosing functions, named in a nonlocal statement), although they may be referenced. The actual parameters (arguments) to a function call are introduced in the local symbol table of the called function when it is called; thus, arguments are passed using call by value (where the value is always an object reference , not the value of the object). [ 1 ] When a function calls another function, or calls itself recursively, a new local symbol table is created for that call. A function definition associates the function name with the function object in the current symbol table. The interpreter recognizes the object pointed to by that name as a user-defined function. Other names can also point to that same function object and can also be used to access the function: >>> fib <function fib at 10042ed0> >>> f = fib >>> f ( 100 ) 0 1 1 2 3 5 8 13 21 34 55 89 Coming from other languages, you might object that fib is not a function but a procedure since it doesn’t return a value. In fact, even functions without a return statement do return a value, albeit a rather boring one. This value is called None (it’s a built-in name). Writing the value None is normally suppressed by the interpreter if it would be the only value written. You can see it if you really want to using print() : >>> fib ( 0 ) >>> print ( fib ( 0 )) None It is simple to write a function that returns a list of the numbers of the Fibonacci series, instead of printing it: >>> def fib2 ( n ): # return Fibonacci series up to n ... """Return a list containing the Fibonacci series up to n.""" ... result = [] ... a , b = 0 , 1 ... while a < n : ... result . append ( a ) # see below ... a , b = b , a + b ... return result ... >>> f100 = fib2 ( 100 ) # call it >>> f100 # write the result [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] 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 . The statement result.append(a) calls a method of the list object result . A method is a function that ‘belongs’ to an object and is named obj.methodname , where obj is some object (this may be an expression), and methodname is the name of a method that is defined by the object’s type. Different types define different methods. Methods of different types may have the same name without causing ambiguity. (It is possible to define your own object types and methods, using classes , see Classes ) The method append() shown in the example is defined for list objects; it adds a new element at the end of the list. In this example it is equivalent to result = result + [a] , but more efficient. 4.9. More on Defining Functions ¶ It is also possible to define functions with a variable number of arguments. There are three forms, which can be combined. 4.9.1. Default Argument Values ¶ The most useful form is to specify a default value for one or more arguments. This creates a function that can be called with fewer arguments than it is defined to allow. For example: def ask_ok ( prompt , retries = 4 , reminder = 'Please try again!' ): while True : reply = input ( prompt ) if reply in { 'y' , 'ye' , 'yes' }: return True if reply in { 'n' , 'no' , 'nop' , 'nope' }: return False retries = retries - 1 if retries < 0 : raise ValueError ( 'invalid user response' ) print ( reminder ) This function can be called in several ways: giving only the mandatory argument: ask_ok('Do you really want to quit?') giving one of the optional arguments: ask_ok('OK to overwrite the file?', 2) or even giving all arguments: ask_ok('OK to overwrite the file?', 2, 'Come on, only yes or no!') This example also introduces the in keyword. This tests whether or not a sequence contains a certain value. The default values are evaluated at the point of function definition in the defining scope, so that i = 5 def f ( arg = i ): print ( arg ) i = 6 f () will print 5 . Important warning: The default value is evaluated only once. This makes a difference when the default is a mutable object such as a list, dictionary, or instances of most classes. For example, the following function accumulates the arguments passed to it on subsequent calls: def f ( a , L = []): L . append ( a ) return L print ( f ( 1 )) print ( f ( 2 )) print ( f ( 3 )) This will print [ 1 ] [ 1 , 2 ] [ 1 , 2 , 3 ] If you don’t want the default to be shared between subsequent calls, you can write the function like this instead: def f ( a , L = None ): if L is None : L = [] L . append ( a ) return L 4.9.2. Keyword Arguments ¶ Functions can also be called using keyword arguments of the form kwarg=value . For instance, the following function: def parrot ( voltage , state = 'a stiff' , action = 'voom' , type = 'Norwegian Blue' ): print ( "-- This parrot wouldn't" , action , end = ' ' ) print ( "if you put" , voltage , "volts through it." ) print ( "-- Lovely plumage, the" , type ) print ( "-- It's" , state , "!" ) accepts one required argument ( voltage ) and three optional arguments ( state , action , and type ). This function can be called in any of the following ways: parrot ( 1000 ) # 1 positional argument parrot ( voltage = 1000 ) # 1 keyword argument parrot ( voltage = 1000000 , action = 'VOOOOOM' ) # 2 keyword arguments parrot ( action = 'VOOOOOM' , voltage = 1000000 ) # 2 keyword arguments parrot ( 'a million' , 'bereft of life' , 'jump' ) # 3 positional arguments parrot ( 'a thousand' , state = 'pushing up the daisies' ) # 1 positional, 1 keyword but all the following calls would be invalid: parrot () # required argument missing parrot ( voltage = 5.0 , 'dead' ) # non-keyword argument after a keyword argument parrot ( 110 , voltage = 220 ) # duplicate value for the same argument parrot ( actor = 'John Cleese' ) # unknown keyword argument In a function call, keyword arguments must follow positional arguments. All the keyword arguments passed must match one of the arguments accepted by the function (e.g. actor is not a valid argument for the parrot function), and their order is not important. This also includes non-optional arguments (e.g. parrot(voltage=1000) is valid too). No argument may receive a value more than once. Here’s an example that fails due to this restriction: >>> def function ( a ): ... pass ... >>> function ( 0 , a = 0 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : function() got multiple values for argument 'a' When a final formal parameter of the form **name is present, it receives a dictionary (see Mapping Types — dict ) containing all keyword arguments except for those corresponding to a formal parameter. This may be combined with a formal parameter of the form *name (described in the next subsection) which receives a tuple containing the positional arguments beyond the formal parameter list. ( *name must occur before **name .) For example, if we define a function like this: def cheeseshop ( kind , * arguments , ** keywords ): print ( "-- Do you have any" , kind , "?" ) print ( "-- I'm sorry, we're all out of" , kind ) for arg in arguments : print ( arg ) print ( "-" * 40 ) for kw in keywords : print ( kw , ":" , keywords [ kw ]) It could be called like this: cheeseshop ( "Limburger" , "It's very runny, sir." , "It's really very, VERY runny, sir." , shopkeeper = "Michael Palin" , client = "John Cleese" , sketch = "Cheese Shop Sketch" ) and of course it would print: -- Do you have any Limburger ? -- I'm sorry, we're all out of Limburger It's very runny, sir. It's really very, VERY runny, sir. ---------------------------------------- shopkeeper : Michael Palin client : John Cleese sketch : Cheese Shop Sketch Note that the order in which the keyword arguments are printed is guaranteed to match the order in which they were provided in the function call. 4.9.3. Special parameters ¶ By default, arguments may be passed to a Python function either by position or explicitly by keyword. For readability and performance, it makes sense to restrict the way arguments can be passed so that a developer need only look at the function definition to determine if items are passed by position, by position or keyword, or by keyword. A function definition may look like: def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2): ----------- ---------- ---------- | | | | Positional or keyword | | - Keyword only -- Positional only where / and * are optional. If used, these symbols indicate the kind of parameter by how the arguments may be passed to the function: positional-only, positional-or-keyword, and keyword-only. Keyword parameters are also referred to as named parameters. 4.9.3.1. Positional-or-Keyword Arguments ¶ If / and * are not present in the function definition, arguments may be passed to a function by position or by keyword. 4.9.3.2. Positional-Only Parameters ¶ Looking at this in a bit more detail, it is possible to mark certain parameters as positional-only . If positional-only , the parameters’ order matters, and the parameters cannot be passed by keyword. Positional-only parameters are placed before a / (forward-slash). The / is used to logically separate the positional-only parameters from the rest of the parameters. If there is no / in the function definition, there are no positional-only parameters. Parameters following the / may be positional-or-keyword or keyword-only . 4.9.3.3. Keyword-Only Arguments ¶ To mark parameters as keyword-only , indicating the parameters must be passed by keyword argument, place an * in the arguments list just before the first keyword-only parameter. 4.9.3.4. Function Examples ¶ Consider the following example function definitions paying close attention to the markers / and * : >>> def standard_arg ( arg ): ... print ( arg ) ... >>> def pos_only_arg ( arg , / ): ... print ( arg ) ... >>> def kwd_only_arg ( * , arg ): ... print ( arg ) ... >>> def combined_example ( pos_only , / , standard , * , kwd_only ): ... print ( pos_only , standard , kwd_only ) The first function definition, standard_arg , the most familiar form, places no restrictions on the calling convention and arguments may be passed by position or keyword: >>> standard_arg ( 2 ) 2 >>> standard_arg ( arg = 2 ) 2 The second function pos_only_arg is restricted to only use positional parameters as there is a / in the function definition: >>> pos_only_arg ( 1 ) 1 >>> pos_only_arg ( arg = 1 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : pos_only_arg() got some positional-only arguments passed as keyword arguments: 'arg' The third function kwd_only_arg only allows keyword arguments as indicated by a * in the function definition: >>> kwd_only_arg ( 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : kwd_only_arg() takes 0 positional arguments but 1 was given >>> kwd_only_arg ( arg = 3 ) 3 And the last uses all three calling conventions in the same function definition: >>> combined_example ( 1 , 2 , 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : combined_example() takes 2 positional arguments but 3 were given >>> combined_example ( 1 , 2 , kwd_only = 3 ) 1 2 3 >>> combined_example ( 1 , standard = 2 , kwd_only = 3 ) 1 2 3 >>> combined_example ( pos_only = 1 , standard = 2 , kwd_only = 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : combined_example() got some positional-only arguments passed as keyword arguments: 'pos_only' Finally, consider this function definition which has a potential collision between the positional argument name and **kwds which has name as a key: def foo ( name , ** kwds ): return 'name' in kwds There is no possible call that will make it return True as the keyword 'name' will always bind to the first parameter. For example: >>> foo ( 1 , ** { 'name' : 2 }) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : foo() got multiple values for argument 'name' >>> But using / (positional only arguments), it is possible since it allows name as a positional argument and 'name' as a key in the keyword arguments: >>> def foo ( name , / , ** kwds ): ... return 'name' in kwds ... >>> foo ( 1 , ** { 'name' : 2 }) True In other words, the names of positional-only parameters can be used in **kwds without ambiguity. 4.9.3.5. Recap ¶ The use case will determine which parameters to use in the function definition: def f ( pos1 , pos2 , / , pos_or_kwd , * , kwd1 , kwd2 ): As guidance: Use positional-only if you want the name of the parameters to not be available to the user. This is useful when parameter names have no real meaning, if you want to enforce the order of the arguments when the function is called or if you need to take some positional parameters and arbitrary keywords. Use keyword-only when names have meaning and the function definition is more understandable by being explicit with names or you want to prevent users relying on the position of the argument being passed. For an API, use positional-only to prevent breaking API changes if the parameter’s name is modified in the future. 4.9.4. Arbitrary Argument Lists ¶ Finally, the least frequently used option is to specify that a function can be called with an arbitrary number of arguments. These arguments will be wrapped up in a tuple (see Tuples and Sequences ). Before the variable number of arguments, zero or more normal arguments may occur. def write_multiple_items ( file , separator , * args ): file . write ( separator . join ( args )) Normally, these variadic arguments will be last in the list of formal parameters, because they scoop up all remaining input arguments that are passed to the function. Any formal parameters which occur after the *args parameter are ‘keyword-only’ arguments, meaning that they can only be used as keywords rather than positional arguments. >>> def concat ( * args , sep = "/" ): ... return sep . join ( args ) ... >>> concat ( "earth" , "mars" , "venus" ) 'earth/mars/venus' >>> concat ( "earth" , "mars" , "venus" , sep = "." ) 'earth.mars.venus' 4.9.5. Unpacking Argument Lists ¶ The reverse situation occurs when the arguments are already in a list or tuple but need to be unpacked for a function call requiring separate positional arguments. For instance, the built-in range() function expects separate start and stop arguments. If they are not available separately, write the function call with the * -operator to unpack the arguments out of a list or tuple: >>> list ( range ( 3 , 6 )) # normal call with separate arguments [3, 4, 5] >>> args = [ 3 , 6 ] >>> list ( range ( * args )) # call with arguments unpacked from a list [3, 4, 5] In the same fashion, dictionaries can deliver keyword arguments with the ** -operator: >>> def parrot ( voltage , state = 'a stiff' , action = 'voom' ): ... print ( "-- This parrot wouldn't" , action , end = ' ' ) ... print ( "if you put" , voltage , "volts through it." , end = ' ' ) ... print ( "E's" , state , "!" ) ... >>> d = { "voltage" : "four million" , "state" : "bleedin' demised" , "action" : "VOOM" } >>> parrot ( ** d ) -- This parrot wouldn't VOOM if you put four million volts through it. E's bleedin' demised ! 4.9.6. Lambda Expressions ¶ Small anonymous functions can be created with the lambda keyword. This function returns the sum of its two arguments: lambda a, b: a+b . Lambda functions can be used wherever function objects are required. They are syntactically restricted to a single expression. Semantically, they are just syntactic sugar for a normal function definition. Like nested function definitions, lambda functions can reference variables from the containing scope: >>> def make_incrementor ( n ): ... return lambda x : x + n ... >>> f = make_incrementor ( 42 ) >>> f ( 0 ) 42 >>> f ( 1 ) 43 The above example uses a lambda expression to return a function. Another use is to pass a small function as an argument. For instance, list.sort() takes a sorting key function key which can be a lambda function: >>> pairs = [( 1 , 'one' ), ( 2 , 'two' ), ( 3 , 'three' ), ( 4 , 'four' )] >>> pairs . sort ( key = lambda pair : pair [ 1 ]) >>> pairs [(4, 'four'), (1, 'one'), (3, 'three'), (2, 'two')] 4.9.7. Documentation Strings ¶ Here are some conventions about the content and formatting of documentation strings. The first line should always be a short, concise summary of the object’s purpose. For brevity, it should not explicitly state the object’s name or type, since these are available by other means (except if the name happens to be a verb describing a function’s operation). This line should begin with a capital letter and end with a period. If there are more lines in the documentation string, the second line should be blank, visually separating the summary from the rest of the description. The following lines should be one or more paragraphs describing the object’s calling conventions, its side effects, etc. The Python parser strips indentation from multi-line string literals when they serve as module, class, or function docstrings. Here is an example of a multi-line docstring: >>> def my_function (): ... """Do nothing, but document it. ... ... No, really, it doesn't do anything: ... ... >>> my_function() ... >>> ... """ ... pass ... >>> print ( my_function . __doc__ ) Do nothing, but document it. No, really, it doesn't do anything: >>> my_function() >>> 4.9.8. Function Annotations ¶ Function annotations are completely optional metadata information about the types used by user-defined functions (see PEP 3107 and PEP 484 for more information). Annotations are stored in the __annotations__ attribute of the function as a dictionary and have no effect on any other part of the function. Parameter annotations are defined by a colon after the parameter name, followed by an expression evaluating to the value of the annotation. Return annotations are defined by a literal -> , followed by an expression, between the parameter list and the colon denoting the end of the def statement. The following example has a required argument, an optional argument, and the return value annotated: >>> def f ( ham : str , eggs : str = 'eggs' ) -> str : ... print ( "Annotations:" , f . __annotations__ ) ... print ( "Arguments:" , ham , eggs ) ... return ham + ' and ' + eggs ... >>> f ( 'spam' ) Annotations: {'ham': <class 'str'>, 'return': <class 'str'>, 'eggs': <class 'str'>} Arguments: spam eggs 'spam and eggs' 4.10. Intermezzo: Coding Style ¶ Now that you are about to write longer, more complex pieces of Python, it is a good time to talk about coding style . Most languages can be written (or more concise, formatted ) in different styles; some are more readable than others. Making it easy for others to read your code is always a good idea, and adopting a nice coding style helps tremendously for that. For Python, PEP 8 has emerged as the style guide that most projects adhere to; it promotes a very readable and eye-pleasing coding style. Every Python developer should read it at some point; here are the most important points extracted for you: Use 4-space indentation, and no tabs. 4 spaces are a good compromise between small indentation (allows greater nesting depth) and large indentation (easier to read). Tabs introduce confusion, and are best left out. Wrap lines so that they don’t exceed 79 characters. This helps users with small displays and makes it possible to have several code files side-by-side on larger displays. Use blank lines to separate functions and classes, and larger blocks of code inside functions. When possible, put comments on a line of their own. Use docstrings. Use spaces around operators and after commas, but not directly inside bracketing constructs: a = f(1, 2) + g(3, 4) . Name your classes and functions consistently; the convention is to use UpperCamelCase for classes and lowercase_with_underscores for functions and methods. Always use self as the name for the first method argument (see A First Look at Classes for more on classes and methods). Don’t use fancy encodings if your code is meant to be used in international environments. Python’s default, UTF-8, or even plain ASCII work best in any case. Likewise, don’t use non-ASCII characters in identifiers if there is only the slightest chance people speaking a different language will read or maintain the code. Footnotes [ 1 ] Actually, call by object reference would be a better description, since if a mutable object is passed, the caller will see any changes the callee makes to it (items inserted into a list). Table of Contents 4. More Control Flow Tools 4.1. if Statements 4.2. for Statements 4.3. The range() Function 4.4. break and continue Statements 4.5. else Clauses on Loops 4.6. pass Statements 4.7. match Statements 4.8. Defining Functions 4.9. More on Defining Functions 4.9.1. Default Argument Values 4.9.2. Keyword Arguments 4.9.3. Special parameters 4.9.3.1. Positional-or-Keyword Arguments 4.9.3.2. Positional-Only Parameters 4.9.3.3. Keyword-Only Arguments 4.9.3.4. Function Examples 4.9.3.5. Recap 4.9.4. Arbitrary Argument Lists 4.9.5. Unpacking Argument Lists 4.9.6. Lambda Expressions 4.9.7. Documentation Strings 4.9.8. Function Annotations 4.10. Intermezzo: Coding Style Previous topic 3. An Informal Introduction to Python Next topic 5. Data Structures This page Report a bug Show source « Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 4. More Control Flow Tools | Theme Auto Light Dark | © Copyright 2001 Python Software Foundation. This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. See History and License for more information. The Python Software Foundation is a non-profit corporation. Please donate. Last updated on Jan 13, 2026 (06:19 UTC). Found a bug ? Created using Sphinx 8.2.3. | 2026-01-13T08:48:44 |
https://dev.to/t/beginners/page/7#main-content | Beginners Page 7 - DEV Community Forem Feed Follow new Subforems to improve your feed DEV Community Follow A space to discuss and keep up software development and manage your software career Future Follow News and discussion of science and technology such as AI, VR, cryptocurrency, quantum computing, and more. Open Forem Follow A general discussion space for the Forem community. If it doesn't have a home elsewhere, it belongs here Gamers Forem Follow An inclusive community for gaming enthusiasts Music Forem Follow From composing and gigging to gear, hot music takes, and everything in between. Vibe Coding Forem Follow Discussing AI software development, and showing off what we're building. Popcorn Movies and TV Follow Movie and TV enthusiasm, criticism and everything in-between. DUMB DEV Community Follow Memes and software development shitposting Design Community Follow Web design, graphic design and everything in-between Security Forem Follow Your central hub for all things security. From ethical hacking and CTFs to GRC and career development, for beginners and pros alike Golf Forem Follow A community of golfers and golfing enthusiasts Crypto Forem Follow A collaborative community for all things Crypto—from Bitcoin to protocol development and DeFi to NFTs and market analysis. Parenting Follow A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Forem Core Follow Discussing the core forem open source software project — features, bugs, performance, self-hosting. Maker Forem Follow A community for makers, hobbyists, and professionals to discuss Arduino, Raspberry Pi, 3D printing, and much more. HMPL.js Forem Follow For developers using HMPL.js to build fast, lightweight web apps. A space to share projects, ask questions, and discuss server-driven templating Dropdown menu Dropdown menu Skip to content Navigation menu Search Powered by Algolia Search Log in Create account DEV Community Close Beginners Follow Hide "A journey of a thousand miles begins with a single step." -Chinese Proverb Create Post submission guidelines UPDATED AUGUST 2, 2019 This tag is dedicated to beginners to programming, development, networking, or to a particular language. Everything should be geared towards that! For Questions... Consider using this tag along with #help, if... You are new to a language, or to programming in general, You want an explanation with NO prerequisite knowledge required. You want insight from more experienced developers. Please do not use this tag if you are merely new to a tool, library, or framework. See also, #explainlikeimfive For Articles... Posts should be specifically geared towards true beginners (experience level 0-2 out of 10). Posts should require NO prerequisite knowledge, except perhaps general (language-agnostic) essentials of programming. Posts should NOT merely be for beginners to a tool, library, or framework. If your article does not meet these qualifications, please select a different tag. Promotional Rules Posts should NOT primarily promote an external work. This is what Listings is for. Otherwise accepable posts MAY include a brief (1-2 sentence) plug for another resource at the bottom. Resource lists ARE acceptable if they follow these rules: Include at least 3 distinct authors/creators. Clearly indicate which resources are FREE, which require PII, and which cost money. Do not use personal affiliate links to monetize. Indicate at the top that the article contains promotional links. about #beginners If you're writing for this tag, we recommend you read this article . If you're asking a question, read this article . Older #beginners posts 4 5 6 7 8 9 10 11 12 Posts Left menu 👋 Sign in for the ability to sort posts by relevant , latest , or top . Right menu You Know Python Basics—Now Let's Build Something Real Samuel Ochaba Samuel Ochaba Samuel Ochaba Follow Jan 8 You Know Python Basics—Now Let's Build Something Real # python # beginners # gamedev # programming Comments Add Comment 3 min read Understanding if, elif, and else in Python with Simple Examples Shahrouz Nikseresht Shahrouz Nikseresht Shahrouz Nikseresht Follow Jan 8 Understanding if, elif, and else in Python with Simple Examples # python # beginners # tutorial # programming Comments Add Comment 2 min read Build Your Own Local AI Agent (Part 4): The PII Scrubber 🧼 Harish Kotra (he/him) Harish Kotra (he/him) Harish Kotra (he/him) Follow Jan 8 Build Your Own Local AI Agent (Part 4): The PII Scrubber 🧼 # programming # ai # beginners # opensource Comments Add Comment 1 min read I finally Deployed on AWS Olamide Olanrewaju Olamide Olanrewaju Olamide Olanrewaju Follow Jan 8 I finally Deployed on AWS # aws # beginners # devjournal Comments Add Comment 3 min read System Design Intro #Day-1 VINAY TEJA ARUKALA VINAY TEJA ARUKALA VINAY TEJA ARUKALA Follow Jan 9 System Design Intro #Day-1 # systemdesign # beginners # computerscience # interview Comments Add Comment 2 min read Day 12: Understanding Constructors in Java Karthick Narayanan Karthick Narayanan Karthick Narayanan Follow Jan 8 Day 12: Understanding Constructors in Java # java # programming # beginners # tutorial Comments Add Comment 2 min read 7 Essential Rust Libraries for Building High-Performance Backends James Miller James Miller James Miller Follow Jan 8 7 Essential Rust Libraries for Building High-Performance Backends # rust # programming # webdev # beginners 1 reaction Comments Add Comment 6 min read Day 11: Understanding `break` and `continue` Statements in Java Karthick Narayanan Karthick Narayanan Karthick Narayanan Follow Jan 8 Day 11: Understanding `break` and `continue` Statements in Java # beginners # java # programming # tutorial Comments Add Comment 2 min read Introdução ao Deploy Yuri Peixinho Yuri Peixinho Yuri Peixinho Follow Jan 8 Introdução ao Deploy # beginners # devops # webdev Comments Add Comment 2 min read Scrapy Cookie Handling: Master Sessions Like a Pro Muhammad Ikramullah Khan Muhammad Ikramullah Khan Muhammad Ikramullah Khan Follow Jan 8 Scrapy Cookie Handling: Master Sessions Like a Pro # webdev # programming # python # beginners Comments Add Comment 7 min read Gear Up for React: Mastering the Modern Frontend Toolkit! (Day 3 – Pre-React Article 3) Vasu Ghanta Vasu Ghanta Vasu Ghanta Follow Jan 8 Gear Up for React: Mastering the Modern Frontend Toolkit! (Day 3 – Pre-React Article 3) # webdev # frontend # react # beginners Comments Add Comment 7 min read Day 9 of 100 Palak Hirave Palak Hirave Palak Hirave Follow Jan 8 Day 9 of 100 # challenge # programming # python # beginners Comments Add Comment 2 min read Why Version Control Exists: The Pendrive Problem Debashis Das Debashis Das Debashis Das Follow Jan 8 Why Version Control Exists: The Pendrive Problem # beginners # git # softwaredevelopment Comments Add Comment 3 min read System Design 101: A Clear & Simple Introduction (With a Real-World Analogy) Vishwark Vishwark Vishwark Follow Jan 8 System Design 101: A Clear & Simple Introduction (With a Real-World Analogy) # systemdesign # architecture # beginners # careerdevelopment Comments Add Comment 3 min read Learning the Foliage Tool in Unreal Engine (Day 13) Dinesh Dinesh Dinesh Follow Jan 8 Learning the Foliage Tool in Unreal Engine (Day 13) # gamedev # unrealengine # beginners # learning Comments Add Comment 2 min read Boot Process & Init Systems Shivakumar Shivakumar Shivakumar Follow Jan 8 Boot Process & Init Systems # architecture # beginners # linux Comments Add Comment 6 min read You Probably Already Know What a Monad Is Christian Ekrem Christian Ekrem Christian Ekrem Follow Jan 8 You Probably Already Know What a Monad Is # programming # frontend # functional # beginners Comments Add Comment 1 min read Course Launch: Writing Is an Important Part of Coding Prasoon Jadon Prasoon Jadon Prasoon Jadon Follow Jan 8 Course Launch: Writing Is an Important Part of Coding # programming # learning # tutorial # beginners 1 reaction Comments Add Comment 2 min read I built a permanent text wall with Next.js and Supabase. Users are already fighting. ZenomHunter123 ZenomHunter123 ZenomHunter123 Follow Jan 8 I built a permanent text wall with Next.js and Supabase. Users are already fighting. # showdev # javascript # webdev # beginners Comments Add Comment 1 min read 🎬 Build a Relax Video Generator (Images + MP3 MP4) with Python & Tkinter Mate Technologies Mate Technologies Mate Technologies Follow Jan 11 🎬 Build a Relax Video Generator (Images + MP3 MP4) with Python & Tkinter # python # desktopapp # automation # beginners 1 reaction Comments Add Comment 3 min read Code Hike in 100 Seconds Fabian Frank Werner Fabian Frank Werner Fabian Frank Werner Follow Jan 11 Code Hike in 100 Seconds # webdev # programming # javascript # beginners 12 reactions Comments Add Comment 2 min read Sliding window (Fixed length) Jayaprasanna Roddam Jayaprasanna Roddam Jayaprasanna Roddam Follow Jan 6 Sliding window (Fixed length) # programming # beginners # tutorial # learning Comments Add Comment 2 min read How To Replace Over-Complicated NgRx Stores With Angular Signals — Without Losing Control kafeel ahmad kafeel ahmad kafeel ahmad Follow Jan 7 How To Replace Over-Complicated NgRx Stores With Angular Signals — Without Losing Control # webdev # javascript # beginners # angular Comments Add Comment 27 min read AI Automation vs AI Agents: What’s the Real Difference (Explained with Real-Life Examples) Viveka Sharma Viveka Sharma Viveka Sharma Follow Jan 8 AI Automation vs AI Agents: What’s the Real Difference (Explained with Real-Life Examples) # agents # tutorial # beginners # ai 1 reaction Comments 1 comment 3 min read Why I rescheduled my AWS exam today Ali-Funk Ali-Funk Ali-Funk Follow Jan 7 Why I rescheduled my AWS exam today # aws # beginners # cloud # career Comments Add Comment 2 min read loading... 💎 DEV Diamond Sponsors Thank you to our Diamond Sponsors for supporting the DEV Community Google AI is the official AI Model and Platform Partner of DEV Neon is the official database partner of DEV Algolia is the official search partner of DEV DEV Community — A space to discuss and keep up software development and manage your software career Home DEV++ Podcasts Videos DEV Education Tracks DEV Challenges DEV Help Advertise on DEV DEV Showcase About Contact Free Postgres Database Software comparisons Forem Shop Code of Conduct Privacy Policy Terms of Use Built on Forem — the open source software that powers DEV and other inclusive communities. Made with love and Ruby on Rails . DEV Community © 2016 - 2026. We're a place where coders share, stay up-to-date and grow their careers. Log in Create account | 2026-01-13T08:48:44 |
https://docs.python.org/3/reference/compound_stmts.html#elif | 8. Compound statements — Python 3.14.2 documentation Theme Auto Light Dark Table of Contents 8. Compound statements 8.1. The if statement 8.2. The while statement 8.3. The for statement 8.4. The try statement 8.4.1. except clause 8.4.2. except* clause 8.4.3. else clause 8.4.4. finally clause 8.5. The with statement 8.6. The match statement 8.6.1. Overview 8.6.2. Guards 8.6.3. Irrefutable Case Blocks 8.6.4. Patterns 8.6.4.1. OR Patterns 8.6.4.2. AS Patterns 8.6.4.3. Literal Patterns 8.6.4.4. Capture Patterns 8.6.4.5. Wildcard Patterns 8.6.4.6. Value Patterns 8.6.4.7. Group Patterns 8.6.4.8. Sequence Patterns 8.6.4.9. Mapping Patterns 8.6.4.10. Class Patterns 8.7. Function definitions 8.8. Class definitions 8.9. Coroutines 8.9.1. Coroutine function definition 8.9.2. The async for statement 8.9.3. The async with statement 8.10. Type parameter lists 8.10.1. Generic functions 8.10.2. Generic classes 8.10.3. Generic type aliases 8.11. Annotations Previous topic 7. Simple statements Next topic 9. Top-level components This page Report a bug Show source Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Language Reference » 8. Compound statements | Theme Auto Light Dark | 8. Compound statements ¶ Compound statements contain (groups of) other statements; they affect or control the execution of those other statements in some way. In general, compound statements span multiple lines, although in simple incarnations a whole compound statement may be contained in one line. 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. A compound statement consists of one or more ‘clauses.’ A clause consists of a header and a ‘suite.’ The clause headers of a particular compound statement are all at the same indentation level. Each clause header begins with a uniquely identifying keyword and ends with a colon. A suite is a group of statements controlled by a clause. A suite can be one or more semicolon-separated simple statements on the same line as the header, following the header’s colon, or it can be one or more indented statements on subsequent lines. Only the latter form of a suite can contain nested compound statements; the following is illegal, mostly because it wouldn’t be clear to which if clause a following else clause would belong: if test1 : if test2 : print ( x ) Also note that the semicolon binds tighter than the colon in this context, so that in the following example, either all or none of the print() calls are executed: if x < y < z : print ( x ); print ( y ); print ( z ) Summarizing: compound_stmt : if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | match_stmt | funcdef | classdef | async_with_stmt | async_for_stmt | async_funcdef suite : stmt_list NEWLINE | NEWLINE INDENT statement + DEDENT statement : stmt_list NEWLINE | compound_stmt stmt_list : simple_stmt ( ";" simple_stmt )* [ ";" ] Note that statements always end in a NEWLINE possibly followed by a DEDENT . Also note that optional continuation clauses always begin with a keyword that cannot start a statement, thus there are no ambiguities (the ‘dangling else ’ problem is solved in Python by requiring nested if statements to be indented). The formatting of the grammar rules in the following sections places each clause on a separate line for clarity. 8.1. The if statement ¶ The if statement is used for conditional execution: if_stmt : "if" assignment_expression ":" suite ( "elif" assignment_expression ":" suite )* [ "else" ":" suite ] It selects exactly one of the suites by evaluating the expressions one by one until one is found to be true (see section Boolean operations for the definition of true and false); then that suite is executed (and no other part of the if statement is executed or evaluated). If all expressions are false, the suite of the else clause, if present, is executed. 8.2. The while statement ¶ The while statement is used for repeated execution as long as an expression is true: while_stmt : "while" assignment_expression ":" suite [ "else" ":" suite ] This repeatedly tests the expression and, if it is true, executes the first suite; if the expression is false (which may be the first time it is tested) the suite of the else clause, if present, is executed and the loop terminates. A break statement executed in the first suite terminates the loop without executing the else clause’s suite. A continue statement executed in the first suite skips the rest of the suite and goes back to testing the expression. 8.3. The for statement ¶ The for statement is used to iterate over the elements of a sequence (such as a string, tuple or list) or other iterable object: for_stmt : "for" target_list "in" starred_expression_list ":" suite [ "else" ":" suite ] The starred_expression_list expression is evaluated once; it should yield an iterable object. An iterator is created for that iterable. The first item provided by the iterator is then assigned to the target list using the standard rules for assignments (see Assignment statements ), and the suite is executed. This repeats for each item provided by the iterator. When the iterator is exhausted, the suite in the else clause, if present, is executed, and the loop terminates. A break statement executed in the first suite terminates the loop without executing the else clause’s suite. A continue statement executed in the first suite skips the rest of the suite and continues with the next item, or with the else clause if there is no next item. The for-loop makes assignments to the variables in the target list. This overwrites all previous assignments to those variables including those made in the suite of the for-loop: for i in range ( 10 ): print ( i ) i = 5 # this will not affect the for-loop # because i will be overwritten with the next # index in the range Names in the target list are not deleted when the loop is finished, but if the sequence is empty, they will not have been assigned to at all by the loop. Hint: the built-in type range() represents immutable arithmetic sequences of integers. For instance, iterating range(3) successively yields 0, 1, and then 2. Changed in version 3.11: Starred elements are now allowed in the expression list. 8.4. The try statement ¶ The try statement specifies exception handlers and/or cleanup code for a group of statements: try_stmt : try1_stmt | try2_stmt | try3_stmt try1_stmt : "try" ":" suite ( "except" [ expression [ "as" identifier ]] ":" suite )+ [ "else" ":" suite ] [ "finally" ":" suite ] try2_stmt : "try" ":" suite ( "except" "*" expression [ "as" identifier ] ":" suite )+ [ "else" ":" suite ] [ "finally" ":" suite ] try3_stmt : "try" ":" suite "finally" ":" suite Additional information on exceptions can be found in section Exceptions , and information on using the raise statement to generate exceptions may be found in section The raise statement . Changed in version 3.14: Support for optionally dropping grouping parentheses when using multiple exception types. See PEP 758 . 8.4.1. except clause ¶ The except clause(s) specify one or more exception handlers. When no exception occurs in the try clause, no exception handler is executed. When an exception occurs in the try suite, a search for an exception handler is started. This search inspects the except clauses in turn until one is found that matches the exception. An expression-less except clause, if present, must be last; it matches any exception. For an except clause with an expression, the expression must evaluate to an exception type or a tuple of exception types. Parentheses can be dropped if multiple exception types are provided and the as clause is not used. The raised exception matches an except clause whose expression evaluates to the class or a non-virtual base class of the exception object, or to a tuple that contains such a class. If no except clause matches the exception, the search for an exception handler continues in the surrounding code and on the invocation stack. [ 1 ] If the evaluation of an expression in the header of an except clause raises an exception, the original search for a handler is canceled and a search starts for the new exception in the surrounding code and on the call stack (it is treated as if the entire try statement raised the exception). When a matching except clause is found, the exception is assigned to the target specified after the as keyword in that except clause, if present, and the except clause’s suite is executed. All except clauses must have an executable block. When the end of this block is reached, execution continues normally after the entire try statement. (This means that if two nested handlers exist for the same exception, and the exception occurs in the try clause of the inner handler, the outer handler will not handle the exception.) When an exception has been assigned using as target , it is cleared at the end of the except clause. This is as if except E as N : foo was translated to except E as N : try : foo finally : del N This means the exception must be assigned to a different name to be able to refer to it after the except clause. Exceptions are cleared because with the traceback attached to them, they form a reference cycle with the stack frame, keeping all locals in that frame alive until the next garbage collection occurs. Before an except clause’s suite is executed, the exception is stored in the sys module, where it can be accessed from within the body of the except clause by calling sys.exception() . When leaving an exception handler, the exception stored in the sys module is reset to its previous value: >>> print ( sys . exception ()) None >>> try : ... raise TypeError ... except : ... print ( repr ( sys . exception ())) ... try : ... raise ValueError ... except : ... print ( repr ( sys . exception ())) ... print ( repr ( sys . exception ())) ... TypeError() ValueError() TypeError() >>> print ( sys . exception ()) None 8.4.2. except* clause ¶ The except* clause(s) specify one or more handlers for groups of exceptions ( BaseExceptionGroup instances). A try statement can have either except or except* clauses, but not both. The exception type for matching is mandatory in the case of except* , so except*: is a syntax error. The type is interpreted as in the case of except , but matching is performed on the exceptions contained in the group that is being handled. An TypeError is raised if a matching type is a subclass of BaseExceptionGroup , because that would have ambiguous semantics. When an exception group is raised in the try block, each except* clause splits (see split() ) it into the subgroups of matching and non-matching exceptions. If the matching subgroup is not empty, it becomes the handled exception (the value returned from sys.exception() ) and assigned to the target of the except* clause (if there is one). Then, the body of the except* clause executes. If the non-matching subgroup is not empty, it is processed by the next except* in the same manner. This continues until all exceptions in the group have been matched, or the last except* clause has run. After all except* clauses execute, the group of unhandled exceptions is merged with any exceptions that were raised or re-raised from within except* clauses. This merged exception group propagates on.: >>> try : ... raise ExceptionGroup ( "eg" , ... [ ValueError ( 1 ), TypeError ( 2 ), OSError ( 3 ), OSError ( 4 )]) ... except * TypeError as e : ... print ( f 'caught { type ( e ) } with nested { e . exceptions } ' ) ... except * OSError as e : ... print ( f 'caught { type ( e ) } with nested { e . exceptions } ' ) ... caught <class 'ExceptionGroup'> with nested (TypeError(2),) caught <class 'ExceptionGroup'> with nested (OSError(3), OSError(4)) + Exception Group Traceback (most recent call last): | File "<doctest default[0]>", line 2, in <module> | raise ExceptionGroup("eg", | [ValueError(1), TypeError(2), OSError(3), OSError(4)]) | ExceptionGroup: eg (1 sub-exception) +-+---------------- 1 ---------------- | ValueError: 1 +------------------------------------ If the exception raised from the try block is not an exception group and its type matches one of the except* clauses, it is caught and wrapped by an exception group with an empty message string. This ensures that the type of the target e is consistently BaseExceptionGroup : >>> try : ... raise BlockingIOError ... except * BlockingIOError as e : ... print ( repr ( e )) ... ExceptionGroup('', (BlockingIOError(),)) break , continue and return cannot appear in an except* clause. 8.4.3. else clause ¶ The optional else clause is executed if the control flow leaves the try suite, no exception was raised, and no return , continue , or break statement was executed. Exceptions in the else clause are not handled by the preceding except clauses. 8.4.4. finally clause ¶ If finally is present, it specifies a ‘cleanup’ handler. The try clause is executed, including any except and else clauses. If an exception occurs in any of the clauses and is not handled, the exception is temporarily saved. The finally clause is executed. If there is a saved exception it is re-raised at the end of the finally clause. If the finally clause raises another exception, the saved exception is set as the context of the new exception. If the finally clause executes a return , break or continue statement, the saved exception is discarded. For example, this function returns 42. def f (): try : 1 / 0 finally : return 42 The exception information is not available to the program during execution of the finally clause. When a return , break or continue statement is executed in the try suite of a try … finally statement, the finally clause is also executed ‘on the way out.’ The return value of a function is determined by the last return statement executed. Since the finally clause always executes, a return statement executed in the finally clause will always be the last one executed. The following function returns ‘finally’. def foo (): try : return 'try' finally : return 'finally' Changed in version 3.8: Prior to Python 3.8, a continue statement was illegal in the finally clause due to a problem with the implementation. Changed in version 3.14: The compiler emits a SyntaxWarning when a return , break or continue appears in a finally block (see PEP 765 ). 8.5. The with statement ¶ The with statement is used to wrap the execution of a block with methods defined by a context manager (see section With Statement Context Managers ). This allows common try … except … finally usage patterns to be encapsulated for convenient reuse. with_stmt : "with" ( "(" with_stmt_contents "," ? ")" | with_stmt_contents ) ":" suite with_stmt_contents : with_item ( "," with_item )* with_item : expression [ "as" target ] The execution of the with statement with one “item” proceeds as follows: The context expression (the expression given in the with_item ) is evaluated to obtain a context manager. The context manager’s __enter__() is loaded for later use. The context manager’s __exit__() is loaded for later use. The context manager’s __enter__() method is invoked. If a target was included in the with statement, the return value from __enter__() is assigned to it. Note The with statement guarantees that if the __enter__() method returns without an error, then __exit__() will always be called. Thus, if an error occurs during the assignment to the target list, it will be treated the same as an error occurring within the suite would be. See step 7 below. The suite is executed. The context manager’s __exit__() method is invoked. If an exception caused the suite to be exited, its type, value, and traceback are passed as arguments to __exit__() . Otherwise, three None arguments are supplied. If the suite was exited due to an exception, and the return value from the __exit__() method was false, the exception is reraised. If the return value was true, the exception is suppressed, and execution continues with the statement following the with statement. If the suite was exited for any reason other than an exception, the return value from __exit__() is ignored, and execution proceeds at the normal location for the kind of exit that was taken. The following code: with EXPRESSION as TARGET : SUITE is semantically equivalent to: manager = ( EXPRESSION ) enter = type ( manager ) . __enter__ exit = type ( manager ) . __exit__ value = enter ( manager ) hit_except = False try : TARGET = value SUITE except : hit_except = True if not exit ( manager , * sys . exc_info ()): raise finally : if not hit_except : exit ( manager , None , None , None ) With more than one item, the context managers are processed as if multiple with statements were nested: with A () as a , B () as b : SUITE is semantically equivalent to: with A () as a : with B () as b : SUITE You can also write multi-item context managers in multiple lines if the items are surrounded by parentheses. For example: with ( A () as a , B () as b , ): SUITE Changed in version 3.1: Support for multiple context expressions. Changed in version 3.10: Support for using grouping parentheses to break the statement in multiple lines. See also PEP 343 - The “with” statement The specification, background, and examples for the Python with statement. 8.6. The match statement ¶ Added in version 3.10. The match statement is used for pattern matching. Syntax: match_stmt : 'match' subject_expr ":" NEWLINE INDENT case_block + DEDENT subject_expr : `!star_named_expression` "," `!star_named_expressions`? | `!named_expression` case_block : 'case' patterns [ guard ] ":" `!block` Note This section uses single quotes to denote soft keywords . Pattern matching takes a pattern as input (following case ) and a subject value (following match ). The pattern (which may contain subpatterns) is matched against the subject value. The outcomes are: A match success or failure (also termed a pattern success or failure). Possible binding of matched values to a name. The prerequisites for this are further discussed below. The match and case keywords are soft keywords . See also PEP 634 – Structural Pattern Matching: Specification PEP 636 – Structural Pattern Matching: Tutorial 8.6.1. Overview ¶ Here’s an overview of the logical flow of a match statement: The subject expression subject_expr is evaluated and a resulting subject value obtained. If the subject expression contains a comma, a tuple is constructed using the standard rules . Each pattern in a case_block is attempted to match with the subject value. The specific rules for success or failure are described below. The match attempt can also bind some or all of the standalone names within the pattern. The precise pattern binding rules vary per pattern type and are specified below. Name bindings made during a successful pattern match outlive the executed block and can be used after the match statement . Note During failed pattern matches, some subpatterns may succeed. Do not rely on bindings being made for a failed match. Conversely, do not rely on variables remaining unchanged after a failed match. The exact behavior is dependent on implementation and may vary. This is an intentional decision made to allow different implementations to add optimizations. If the pattern succeeds, the corresponding guard (if present) is evaluated. In this case all name bindings are guaranteed to have happened. If the guard evaluates as true or is missing, the block inside case_block is executed. Otherwise, the next case_block is attempted as described above. If there are no further case blocks, the match statement is completed. Note Users should generally never rely on a pattern being evaluated. Depending on implementation, the interpreter may cache values or use other optimizations which skip repeated evaluations. A sample match statement: >>> flag = False >>> match ( 100 , 200 ): ... case ( 100 , 300 ): # Mismatch: 200 != 300 ... print ( 'Case 1' ) ... case ( 100 , 200 ) if flag : # Successful match, but guard fails ... print ( 'Case 2' ) ... case ( 100 , y ): # Matches and binds y to 200 ... print ( f 'Case 3, y: { y } ' ) ... case _ : # Pattern not attempted ... print ( 'Case 4, I match anything!' ) ... Case 3, y: 200 In this case, if flag is a guard. Read more about that in the next section. 8.6.2. Guards ¶ guard : "if" `!named_expression` A guard (which is part of the case ) must succeed for code inside the case block to execute. It takes the form: if followed by an expression. The logical flow of a case block with a guard follows: Check that the pattern in the case block succeeded. If the pattern failed, the guard is not evaluated and the next case block is checked. If the pattern succeeded, evaluate the guard . If the guard condition evaluates as true, the case block is selected. If the guard condition evaluates as false, the case block is not selected. If the guard raises an exception during evaluation, the exception bubbles up. Guards are allowed to have side effects as they are expressions. Guard evaluation must proceed from the first to the last case block, one at a time, skipping case blocks whose pattern(s) don’t all succeed. (I.e., guard evaluation must happen in order.) Guard evaluation must stop once a case block is selected. 8.6.3. Irrefutable Case Blocks ¶ An irrefutable case block is a match-all case block. A match statement may have at most one irrefutable case block, and it must be last. A case block is considered irrefutable if it has no guard and its pattern is irrefutable. A pattern is considered irrefutable if we can prove from its syntax alone that it will always succeed. Only the following patterns are irrefutable: AS Patterns whose left-hand side is irrefutable OR Patterns containing at least one irrefutable pattern Capture Patterns Wildcard Patterns parenthesized irrefutable patterns 8.6.4. Patterns ¶ Note This section uses grammar notations beyond standard EBNF: the notation SEP.RULE+ is shorthand for RULE (SEP RULE)* the notation !RULE is shorthand for a negative lookahead assertion The top-level syntax for patterns is: patterns : open_sequence_pattern | pattern pattern : as_pattern | or_pattern closed_pattern : | literal_pattern | capture_pattern | wildcard_pattern | value_pattern | group_pattern | sequence_pattern | mapping_pattern | class_pattern The descriptions below will include a description “in simple terms” of what a pattern does for illustration purposes (credits to Raymond Hettinger for a document that inspired most of the descriptions). Note that these descriptions are purely for illustration purposes and may not reflect the underlying implementation. Furthermore, they do not cover all valid forms. 8.6.4.1. OR Patterns ¶ An OR pattern is two or more patterns separated by vertical bars | . Syntax: or_pattern : "|" . closed_pattern + Only the final subpattern may be irrefutable , and each subpattern must bind the same set of names to avoid ambiguity. An OR pattern matches each of its subpatterns in turn to the subject value, until one succeeds. The OR pattern is then considered successful. Otherwise, if none of the subpatterns succeed, the OR pattern fails. In simple terms, P1 | P2 | ... will try to match P1 , if it fails it will try to match P2 , succeeding immediately if any succeeds, failing otherwise. 8.6.4.2. AS Patterns ¶ An AS pattern matches an OR pattern on the left of the as keyword against a subject. Syntax: as_pattern : or_pattern "as" capture_pattern If the OR pattern fails, the AS pattern fails. Otherwise, the AS pattern binds the subject to the name on the right of the as keyword and succeeds. capture_pattern cannot be a _ . In simple terms P as NAME will match with P , and on success it will set NAME = <subject> . 8.6.4.3. Literal Patterns ¶ A literal pattern corresponds to most literals in Python. Syntax: literal_pattern : signed_number | signed_number "+" NUMBER | signed_number "-" NUMBER | strings | "None" | "True" | "False" signed_number : [ "-" ] NUMBER The rule strings and the token NUMBER are defined in the standard Python grammar . Triple-quoted strings are supported. Raw strings and byte strings are supported. f-strings and t-strings are not supported. The forms signed_number '+' NUMBER and signed_number '-' NUMBER are for expressing complex numbers ; they require a real number on the left and an imaginary number on the right. E.g. 3 + 4j . In simple terms, LITERAL will succeed only if <subject> == LITERAL . For the singletons None , True and False , the is operator is used. 8.6.4.4. Capture Patterns ¶ A capture pattern binds the subject value to a name. Syntax: capture_pattern : ! '_' NAME A single underscore _ is not a capture pattern (this is what !'_' expresses). It is instead treated as a wildcard_pattern . In a given pattern, a given name can only be bound once. E.g. case x, x: ... is invalid while case [x] | x: ... is allowed. Capture patterns always succeed. The binding follows scoping rules established by the assignment expression operator in PEP 572 ; the name becomes a local variable in the closest containing function scope unless there’s an applicable global or nonlocal statement. In simple terms NAME will always succeed and it will set NAME = <subject> . 8.6.4.5. Wildcard Patterns ¶ A wildcard pattern always succeeds (matches anything) and binds no name. Syntax: wildcard_pattern : '_' _ is a soft keyword within any pattern, but only within patterns. It is an identifier, as usual, even within match subject expressions, guard s, and case blocks. In simple terms, _ will always succeed. 8.6.4.6. Value Patterns ¶ A value pattern represents a named value in Python. Syntax: value_pattern : attr attr : name_or_attr "." NAME name_or_attr : attr | NAME The dotted name in the pattern is looked up using standard Python name resolution rules . The pattern succeeds if the value found compares equal to the subject value (using the == equality operator). In simple terms NAME1.NAME2 will succeed only if <subject> == NAME1.NAME2 Note If the same value occurs multiple times in the same match statement, the interpreter may cache the first value found and reuse it rather than repeat the same lookup. This cache is strictly tied to a given execution of a given match statement. 8.6.4.7. Group Patterns ¶ A group pattern allows users to add parentheses around patterns to emphasize the intended grouping. Otherwise, it has no additional syntax. Syntax: group_pattern : "(" pattern ")" In simple terms (P) has the same effect as P . 8.6.4.8. Sequence Patterns ¶ A sequence pattern contains several subpatterns to be matched against sequence elements. The syntax is similar to the unpacking of a list or tuple. sequence_pattern : "[" [ maybe_sequence_pattern ] "]" | "(" [ open_sequence_pattern ] ")" open_sequence_pattern : maybe_star_pattern "," [ maybe_sequence_pattern ] maybe_sequence_pattern : "," . maybe_star_pattern + "," ? maybe_star_pattern : star_pattern | pattern star_pattern : "*" ( capture_pattern | wildcard_pattern ) There is no difference if parentheses or square brackets are used for sequence patterns (i.e. (...) vs [...] ). Note A single pattern enclosed in parentheses without a trailing comma (e.g. (3 | 4) ) is a group pattern . While a single pattern enclosed in square brackets (e.g. [3 | 4] ) is still a sequence pattern. At most one star subpattern may be in a sequence pattern. The star subpattern may occur in any position. If no star subpattern is present, the sequence pattern is a fixed-length sequence pattern; otherwise it is a variable-length sequence pattern. The following is the logical flow for matching a sequence pattern against a subject value: If the subject value is not a sequence [ 2 ] , the sequence pattern fails. If the subject value is an instance of str , bytes or bytearray the sequence pattern fails. The subsequent steps depend on whether the sequence pattern is fixed or variable-length. If the sequence pattern is fixed-length: If the length of the subject sequence is not equal to the number of subpatterns, the sequence pattern fails Subpatterns in the sequence pattern are matched to their corresponding items in the subject sequence from left to right. Matching stops as soon as a subpattern fails. If all subpatterns succeed in matching their corresponding item, the sequence pattern succeeds. Otherwise, if the sequence pattern is variable-length: If the length of the subject sequence is less than the number of non-star subpatterns, the sequence pattern fails. The leading non-star subpatterns are matched to their corresponding items as for fixed-length sequences. If the previous step succeeds, the star subpattern matches a list formed of the remaining subject items, excluding the remaining items corresponding to non-star subpatterns following the star subpattern. Remaining non-star subpatterns are matched to their corresponding subject items, as for a fixed-length sequence. Note The length of the subject sequence is obtained via len() (i.e. via the __len__() protocol). This length may be cached by the interpreter in a similar manner as value patterns . In simple terms [P1, P2, P3, … , P<N>] matches only if all the following happens: check <subject> is a sequence len(subject) == <N> P1 matches <subject>[0] (note that this match can also bind names) P2 matches <subject>[1] (note that this match can also bind names) … and so on for the corresponding pattern/element. 8.6.4.9. Mapping Patterns ¶ A mapping pattern contains one or more key-value patterns. The syntax is similar to the construction of a dictionary. Syntax: mapping_pattern : "{" [ items_pattern ] "}" items_pattern : "," . key_value_pattern + "," ? key_value_pattern : ( literal_pattern | value_pattern ) ":" pattern | double_star_pattern double_star_pattern : "**" capture_pattern At most one double star pattern may be in a mapping pattern. The double star pattern must be the last subpattern in the mapping pattern. Duplicate keys in mapping patterns are disallowed. Duplicate literal keys will raise a SyntaxError . Two keys that otherwise have the same value will raise a ValueError at runtime. The following is the logical flow for matching a mapping pattern against a subject value: If the subject value is not a mapping [ 3 ] ,the mapping pattern fails. If every key given in the mapping pattern is present in the subject mapping, and the pattern for each key matches the corresponding item of the subject mapping, the mapping pattern succeeds. If duplicate keys are detected in the mapping pattern, the pattern is considered invalid. A SyntaxError is raised for duplicate literal values; or a ValueError for named keys of the same value. Note Key-value pairs are matched using the two-argument form of the mapping subject’s get() method. Matched key-value pairs must already be present in the mapping, and not created on-the-fly via __missing__() or __getitem__() . In simple terms {KEY1: P1, KEY2: P2, ... } matches only if all the following happens: check <subject> is a mapping KEY1 in <subject> P1 matches <subject>[KEY1] … and so on for the corresponding KEY/pattern pair. 8.6.4.10. Class Patterns ¶ A class pattern represents a class and its positional and keyword arguments (if any). Syntax: class_pattern : name_or_attr "(" [ pattern_arguments "," ?] ")" pattern_arguments : positional_patterns [ "," keyword_patterns ] | keyword_patterns positional_patterns : "," . pattern + keyword_patterns : "," . keyword_pattern + keyword_pattern : NAME "=" pattern The same keyword should not be repeated in class patterns. The following is the logical flow for matching a class pattern against a subject value: If name_or_attr is not an instance of the builtin type , raise TypeError . If the subject value is not an instance of name_or_attr (tested via isinstance() ), the class pattern fails. If no pattern arguments are present, the pattern succeeds. Otherwise, the subsequent steps depend on whether keyword or positional argument patterns are present. For a number of built-in types (specified below), a single positional subpattern is accepted which will match the entire subject; for these types keyword patterns also work as for other types. If only keyword patterns are present, they are processed as follows, one by one: The keyword is looked up as an attribute on the subject. If this raises an exception other than AttributeError , the exception bubbles up. If this raises AttributeError , the class pattern has failed. Else, the subpattern associated with the keyword pattern is matched against the subject’s attribute value. If this fails, the class pattern fails; if this succeeds, the match proceeds to the next keyword. If all keyword patterns succeed, the class pattern succeeds. If any positional patterns are present, they are converted to keyword patterns using the __match_args__ attribute on the class name_or_attr before matching: The equivalent of getattr(cls, "__match_args__", ()) is called. If this raises an exception, the exception bubbles up. If the returned value is not a tuple, the conversion fails and TypeError is raised. If there are more positional patterns than len(cls.__match_args__) , TypeError is raised. Otherwise, positional pattern i is converted to a keyword pattern using __match_args__[i] as the keyword. __match_args__[i] must be a string; if not TypeError is raised. If there are duplicate keywords, TypeError is raised. See also Customizing positional arguments in class pattern matching Once all positional patterns have been converted to keyword patterns, the match proceeds as if there were only keyword patterns. For the following built-in types the handling of positional subpatterns is different: bool bytearray bytes dict float frozenset int list set str tuple These classes accept a single positional argument, and the pattern there is matched against the whole object rather than an attribute. For example int(0|1) matches the value 0 , but not the value 0.0 . In simple terms CLS(P1, attr=P2) matches only if the following happens: isinstance(<subject>, CLS) convert P1 to a keyword pattern using CLS.__match_args__ For each keyword argument attr=P2 : hasattr(<subject>, "attr") P2 matches <subject>.attr … and so on for the corresponding keyword argument/pattern pair. See also PEP 634 – Structural Pattern Matching: Specification PEP 636 – Structural Pattern Matching: Tutorial 8.7. Function definitions ¶ A function definition defines a user-defined function object (see section The standard type hierarchy ): funcdef : [ decorators ] "def" funcname [ type_params ] "(" [ parameter_list ] ")" [ "->" expression ] ":" suite decorators : decorator + decorator : "@" assignment_expression NEWLINE parameter_list : defparameter ( "," defparameter )* "," "/" [ "," [ parameter_list_no_posonly ]] | parameter_list_no_posonly parameter_list_no_posonly : defparameter ( "," defparameter )* [ "," [ parameter_list_starargs ]] | parameter_list_starargs parameter_list_starargs : "*" [ star_parameter ] ( "," defparameter )* [ "," [ parameter_star_kwargs ]] | "*" ( "," defparameter )+ [ "," [ parameter_star_kwargs ]] | parameter_star_kwargs parameter_star_kwargs : "**" parameter [ "," ] parameter : identifier [ ":" expression ] star_parameter : identifier [ ":" [ "*" ] expression ] defparameter : parameter [ "=" expression ] funcname : identifier A function definition is an executable statement. Its execution binds the function name in the current local namespace to a function object (a wrapper around the executable code for the function). This function object contains a reference to the current global namespace as the global namespace to be used when the function is called. The function definition does not execute the function body; this gets executed only when the function is called. [ 4 ] A function definition may be wrapped by one or more decorator expressions. Decorator expressions are evaluated when the function is defined, in the scope that contains the function definition. The result must be a callable, which is invoked with the function object as the only argument. The returned value is bound to the function name instead of the function object. Multiple decorators are applied in nested fashion. For example, the following code @f1 ( arg ) @f2 def func (): pass is roughly equivalent to def func (): pass func = f1 ( arg )( f2 ( func )) except that the original function is not temporarily bound to the name func . Changed in version 3.9: Functions may be decorated with any valid assignment_expression . Previously, the grammar was much more restrictive; see PEP 614 for details. A list of type parameters may be given in square brackets between the function’s name and the opening parenthesis for its parameter list. This indicates to static type checkers that the function is generic. At runtime, the type parameters can be retrieved from the function’s __type_params__ attribute. See Generic functions for more. Changed in version 3.12: Type parameter lists are new in Python 3.12. When one or more parameters have the form parameter = expression , the function is said to have “default parameter values.” For a parameter with a default value, the corresponding argument may be omitted from a call, in which case the parameter’s default value is substituted. If a parameter has a default value, all following parameters up until the “ * ” must also have a default value — this is a syntactic restriction that is not expressed by the grammar. Default parameter values are evaluated from left to right when the function definition is executed. This means that the expression is evaluated once, when the function is defined, and that the same “pre-computed” value is used for each call. This is especially important to understand when a default parameter value is a mutable object, such as a list or a dictionary: if the function modifies the object (e.g. by appending an item to a list), the default parameter value is in effect modified. This is generally not what was intended. A way around this is to use None as the default, and explicitly test for it in the body of the function, e.g.: def whats_on_the_telly ( penguin = None ): if penguin is None : penguin = [] penguin . append ( "property of the zoo" ) return penguin Function call semantics are described in more detail in section Calls . A function call always assigns values to all parameters mentioned in the parameter list, either from positional arguments, from keyword arguments, or from default values. If the form “ *identifier ” is present, it is initialized to a tuple receiving any excess positional parameters, defaulting to the empty tuple. If the form “ **identifier ” is present, it is initialized to a new ordered mapping receiving any excess keyword arguments, defaulting to a new empty mapping of the same type. Parameters after “ * ” or “ *identifier ” are keyword-only parameters and may only be passed by keyword arguments. Parameters before “ / ” are positional-only parameters and may only be passed by positional arguments. Changed in version 3.8: The / function parameter syntax may be used to indicate positional-only parameters. See PEP 570 for details. Parameters may have an annotation of the form “ : expression ” following the parameter name. Any parameter may have an annotation, even those of the form *identifier or **identifier . (As a special case, parameters of the form *identifier may have an annotation “ : *expression ”.) Functions may have “return” annotation of the form “ -> expression ” after the parameter list. These annotations can be any valid Python expression. The presence of annotations does not change the semantics of a function. See Annotations for more information on annotations. Changed in version 3.11: Parameters of the form “ *identifier ” may have an annotation “ : *expression ”. See PEP 646 . It is also possible to create anonymous functions (functions not bound to a name), for immediate use in expressions. This uses lambda expressions, described in section Lambdas . Note that the lambda expression is merely a shorthand for a simplified function definition; a function defined in a “ def ” statement can be passed around or assigned to another name just like a function defined by a lambda expression. The “ def ” form is actually more powerful since it allows the execution of multiple statements and annotations. Programmer’s note: Functions are first-class objects. A “ def ” statement executed inside a function definition defines a local function that can be returned or passed around. Free variables used in the nested function can access the local variables of the function containing the def. See section Naming and binding for details. See also PEP 3107 - Function Annotations The original specification for function annotations. PEP 484 - Type Hints Definition of a standard meaning for annotations: type hints. PEP 526 - Syntax for Variable Annotations Ability to type hint variable declarations, including class variables and instance variables. PEP 563 - Postponed Evaluation of Annotations Support for forward references within annotations by preserving annotations in a string form at runtime instead of eager evaluation. PEP 318 - Decorators for Functions and Methods Function and method decorators were introduced. Class decorators were introduced in PEP 3129 . 8.8. Class definitions ¶ A class definition defines a class object (see section The standard type hierarchy ): classdef : [ decorators ] "class" classname [ type_params ] [ inheritance ] ":" suite inheritance : "(" [ argument_list ] ")" classname : identifier A class definition is an executable statement. The inheritance list usually gives a list of base classes (see Metaclasses for more advanced uses), so each item in the list should evaluate to a class object which allows subclassing. Classes without an inheritance list inherit, by default, from the base class object ; hence, class Foo : pass is equivalent to class Foo ( object ): pass The class’s suite is then executed in a new execution frame (see Naming and binding ), using a newly created local namespace and the original global namespace. (Usually, the suite contains mostly function definitions.) When the class’s suite finishes execution, its execution frame is discarded but its local namespace is saved. [ 5 ] A class object is then created using the inheritance list for the base classes and the saved local namespace for the attribute dictionary. The class name is bound to this class object in the original local namespace. The order in which attributes are defined in the class body is preserved in the new class’s __dict__ . Note that this is reliable only right after the class is created and only for classes that were defined using the definition syntax. Class creation can be customized heavily using metaclasses . Classes can also be decorated: just like when decorating functions, @f1 ( arg ) @f2 class Foo : pass is roughly equivalent to class Foo : pass Foo = f1 ( arg )( f2 ( Foo )) The evaluation rules for the decorator expressions are the same as for function decorators. The result is then bound to the class name. Changed in version 3.9: Classes may be decorated with any valid assignment_expression . Previously, the grammar was much more restrictive; see PEP 614 for details. A list of type parameters may be given in square brackets immediately after the class’s name. This indicates to static type checkers that the class is generic. At runtime, the type parameters can be retrieved from the class’s __type_params__ attribute. See Generic classes for more. Changed in version 3.12: Type parameter lists are new in Python 3.12. Programmer’s note: Variables defined in the class definition are class attributes; they are shared by instances. Instance attributes can be set in a method with self.name = value . Both class and instance attributes are accessible through the notation “ self.name ”, and an instance attribute hides a class attribute with the same name when accessed in this way. Class attributes can be used as defaults for instance attributes, but using mutable values there can lead to unexpected results. Descriptors can be used to create instance variables with different implementation details. See also PEP 3115 - Metaclasses in Python 3000 The proposal that changed the declaration of metaclasses to the current syntax, and the semantics for how classes with metaclasses are constructed. PEP 3129 - Class Decorators The proposal that added class decorators. Function and method decorators were introduced in PEP 318 . 8.9. Coroutines ¶ Added in version 3.5. 8.9.1. Coroutine function definition ¶ async_funcdef : [ decorators ] "async" "def" funcname "(" [ parameter_list ] ")" [ "->" expression ] ":" suite Execution of Python coroutines can be suspended and resumed at many points (see coroutine ). await expressions, async for and async with can only be used in the body of a coroutine function. Functions defined with async def syntax are always coroutine functions, even if they do not contain await or async keywords. It is a SyntaxError to use a yield from expression inside the body of a coroutine function. An example of a coroutine function: async def func ( param1 , param2 ): do_stuff () await some_coroutine () Changed in version 3.7: await and async are now keywords; previously they were only treated as such inside the body of a coroutine function. 8.9.2. The async for statement ¶ async_for_stmt : "async" for_stmt An asynchronous iterable provides an __aiter__ method that directly returns an asynchronous iterator , which can call asynchronous code in its __anext__ method. The async for statement allows convenient iteration over asynchronous iterables. The following code: async for TARGET in ITER : SUITE else : SUITE2 Is semantically equivalent to: iter = ( ITER ) iter = type ( iter ) . __aiter__ ( iter ) running = True while running : try : TARGET = await type ( iter ) . __anext__ ( iter ) except StopAsyncIteration : running = False else : SUITE else : SUITE2 See also __aiter__() and __anext__() for details. It is a SyntaxError to use an async for statement outside the body of a coroutine function. 8.9.3. The async with statement ¶ async_with_stmt : "async" with_stmt An asynchronous context manager is a context manager that is able to suspend execution in its enter and exit methods. The following code: async with EXPRESSION as TARGET : SUITE is semantically equivalent to: manager = ( EXPRESSION ) aenter = type ( manager ) . __aenter__ aexit = type ( manager ) . __aexit__ value = await aenter ( manager ) hit_except = False try : TARGET = value SUITE except : hit_except = True if not await aexit ( manager , * sys . exc_info ()): raise finally : if not hit_except : await aexit ( manager , None , None , None ) See also __aenter__() and __aexit__() for details. It is a SyntaxError to use an async with statement outside the body of a coroutine function. See also PEP 492 - Coroutines with async and await syntax The proposal that made coroutines a proper standalone concept in Python, and added supporting syntax. 8.10. Type parameter lists ¶ Added in version 3.12. Changed in version 3.13: Support for default values was added (see PEP 696 ). type_params : "[" type_param ( "," type_param )* "]" type_param : typevar | typevartuple | paramspec typevar : identifier ( ":" expression )? ( "=" expression )? typevartuple : "*" identifier ( "=" expression )? paramspec : "**" identifier ( "=" expression )? Functions (including coroutines ), classes and type aliases may contain a type parameter list: def max [ T ]( args : list [ T ]) -> T : ... async def amax [ T ]( args : list [ T ]) -> T : ... class Bag [ T ]: def __iter__ ( self ) -> Iterator [ T ]: ... def add ( self , arg : T ) -> None : ... type ListOrSet [ T ] = list [ T ] | set [ T ] Semantically, this indicates that the function, class, or type | 2026-01-13T08:48:44 |
https://docs.python.org/3/reference/simple_stmts.html#return | 7. Simple statements — Python 3.14.2 documentation Theme Auto Light Dark Table of Contents 7. Simple statements 7.1. Expression statements 7.2. Assignment statements 7.2.1. Augmented assignment statements 7.2.2. Annotated assignment statements 7.3. The assert statement 7.4. The pass statement 7.5. The del statement 7.6. The return statement 7.7. The yield statement 7.8. The raise statement 7.9. The break statement 7.10. The continue statement 7.11. The import statement 7.11.1. Future statements 7.12. The global statement 7.13. The nonlocal statement 7.14. The type statement Previous topic 6. Expressions Next topic 8. Compound statements This page Report a bug Show source Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Language Reference » 7. Simple statements | Theme Auto Light Dark | 7. Simple statements ¶ A simple statement is comprised within a single logical line. Several simple statements may occur on a single line separated by semicolons. The syntax for simple statements is: simple_stmt : expression_stmt | assert_stmt | assignment_stmt | augmented_assignment_stmt | annotated_assignment_stmt | pass_stmt | del_stmt | return_stmt | yield_stmt | raise_stmt | break_stmt | continue_stmt | import_stmt | future_stmt | global_stmt | nonlocal_stmt | type_stmt 7.1. Expression statements ¶ Expression statements are used (mostly interactively) to compute and write a value, or (usually) to call a procedure (a function that returns no meaningful result; in Python, procedures return the value None ). Other uses of expression statements are allowed and occasionally useful. The syntax for an expression statement is: expression_stmt : starred_expression An expression statement evaluates the expression list (which may be a single expression). In interactive mode, if the value is not None , it is converted to a string using the built-in repr() function and the resulting string is written to standard output on a line by itself (except if the result is None , so that procedure calls do not cause any output.) 7.2. Assignment statements ¶ Assignment statements are used to (re)bind names to values and to modify attributes or items of mutable objects: assignment_stmt : ( target_list "=" )+ ( starred_expression | yield_expression ) target_list : target ( "," target )* [ "," ] target : identifier | "(" [ target_list ] ")" | "[" [ target_list ] "]" | attributeref | subscription | slicing | "*" target (See section Primaries for the syntax definitions for attributeref , subscription , and slicing .) An assignment statement evaluates the expression list (remember that this can be a single expression or a comma-separated list, the latter yielding a tuple) and assigns the single resulting object to each of the target lists, from left to right. Assignment is defined recursively depending on the form of the target (list). When a target is part of a mutable object (an attribute reference, subscription or slicing), the mutable object must ultimately perform the assignment and decide about its validity, and may raise an exception if the assignment is unacceptable. The rules observed by various types and the exceptions raised are given with the definition of the object types (see section The standard type hierarchy ). Assignment of an object to a target list, optionally enclosed in parentheses or square brackets, is recursively defined as follows. If the target list is a single target with no trailing comma, optionally in parentheses, the object is assigned to that target. Else: If the target list contains one target prefixed with an asterisk, called a “starred” target: The object must be an iterable with at least as many items as there are targets in the target list, minus one. The first items of the iterable are assigned, from left to right, to the targets before the starred target. The final items of the iterable are assigned to the targets after the starred target. A list of the remaining items in the iterable is then assigned to the starred target (the list can be empty). Else: The object must be an iterable with the same number of items as there are targets in the target list, and the items are assigned, from left to right, to the corresponding targets. Assignment of an object to a single target is recursively defined as follows. If the target is an identifier (name): If the name does not occur in a global or nonlocal statement in the current code block: the name is bound to the object in the current local namespace. Otherwise: the name is bound to the object in the global namespace or the outer namespace determined by nonlocal , respectively. The name is rebound if it was already bound. This may cause the reference count for the object previously bound to the name to reach zero, causing the object to be deallocated and its destructor (if it has one) to be called. If the target is an attribute reference: The primary expression in the reference is evaluated. It should yield an object with assignable attributes; if this is not the case, TypeError is raised. That object is then asked to assign the assigned object to the given attribute; if it cannot perform the assignment, it raises an exception (usually but not necessarily AttributeError ). Note: If the object is a class instance and the attribute reference occurs on both sides of the assignment operator, the right-hand side expression, a.x can access either an instance attribute or (if no instance attribute exists) a class attribute. The left-hand side target a.x is always set as an instance attribute, creating it if necessary. Thus, the two occurrences of a.x do not necessarily refer to the same attribute: if the right-hand side expression refers to a class attribute, the left-hand side creates a new instance attribute as the target of the assignment: class Cls : x = 3 # class variable inst = Cls () inst . x = inst . x + 1 # writes inst.x as 4 leaving Cls.x as 3 This description does not necessarily apply to descriptor attributes, such as properties created with property() . If the target is a subscription: The primary expression in the reference is evaluated. It should yield either a mutable sequence object (such as a list) or a mapping object (such as a dictionary). Next, the subscript expression is evaluated. If the primary is a mutable sequence object (such as a list), the subscript must yield an integer. If it is negative, the sequence’s length is added to it. The resulting value must be a nonnegative integer less than the sequence’s length, and the sequence is asked to assign the assigned object to its item with that index. If the index is out of range, IndexError is raised (assignment to a subscripted sequence cannot add new items to a list). If the primary is a mapping object (such as a dictionary), the subscript must have a type compatible with the mapping’s key type, and the mapping is then asked to create a key/value pair which maps the subscript to the assigned object. This can either replace an existing key/value pair with the same key value, or insert a new key/value pair (if no key with the same value existed). For user-defined objects, the __setitem__() method is called with appropriate arguments. If the target is a slicing: The primary expression in the reference is evaluated. It should yield a mutable sequence object (such as a list). The assigned object should be a sequence object of the same type. Next, the lower and upper bound expressions are evaluated, insofar they are present; defaults are zero and the sequence’s length. The bounds should evaluate to integers. If either bound is negative, the sequence’s length is added to it. The resulting bounds are clipped to lie between zero and the sequence’s length, inclusive. Finally, the sequence object is asked to replace the slice with the items of the assigned sequence. The length of the slice may be different from the length of the assigned sequence, thus changing the length of the target sequence, if the target sequence allows it. CPython implementation detail: In the current implementation, the syntax for targets is taken to be the same as for expressions, and invalid syntax is rejected during the code generation phase, causing less detailed error messages. Although the definition of assignment implies that overlaps between the left-hand side and the right-hand side are ‘simultaneous’ (for example a, b = b, a swaps two variables), overlaps within the collection of assigned-to variables occur left-to-right, sometimes resulting in confusion. For instance, the following program prints [0, 2] : x = [ 0 , 1 ] i = 0 i , x [ i ] = 1 , 2 # i is updated, then x[i] is updated print ( x ) See also PEP 3132 - Extended Iterable Unpacking The specification for the *target feature. 7.2.1. Augmented assignment statements ¶ Augmented assignment is the combination, in a single statement, of a binary operation and an assignment statement: augmented_assignment_stmt : augtarget augop ( expression_list | yield_expression ) augtarget : identifier | attributeref | subscription | slicing augop : "+=" | "-=" | "*=" | "@=" | "/=" | "//=" | "%=" | "**=" | ">>=" | "<<=" | "&=" | "^=" | "|=" (See section Primaries for the syntax definitions of the last three symbols.) An augmented assignment evaluates the target (which, unlike normal assignment statements, cannot be an unpacking) and the expression list, performs the binary operation specific to the type of assignment on the two operands, and assigns the result to the original target. The target is only evaluated once. An augmented assignment statement like x += 1 can be rewritten as x = x + 1 to achieve a similar, but not exactly equal effect. In the augmented version, x is only evaluated once. Also, when possible, the actual operation is performed in-place , meaning that rather than creating a new object and assigning that to the target, the old object is modified instead. Unlike normal assignments, augmented assignments evaluate the left-hand side before evaluating the right-hand side. For example, a[i] += f(x) first looks-up a[i] , then it evaluates f(x) and performs the addition, and lastly, it writes the result back to a[i] . With the exception of assigning to tuples and multiple targets in a single statement, the assignment done by augmented assignment statements is handled the same way as normal assignments. Similarly, with the exception of the possible in-place behavior, the binary operation performed by augmented assignment is the same as the normal binary operations. For targets which are attribute references, the same caveat about class and instance attributes applies as for regular assignments. 7.2.2. Annotated assignment statements ¶ Annotation assignment is the combination, in a single statement, of a variable or attribute annotation and an optional assignment statement: annotated_assignment_stmt : augtarget ":" expression [ "=" ( starred_expression | yield_expression )] The difference from normal Assignment statements is that only a single target is allowed. The assignment target is considered “simple” if it consists of a single name that is not enclosed in parentheses. For simple assignment targets, if in class or module scope, the annotations are gathered in a lazily evaluated annotation scope . The annotations can be evaluated using the __annotations__ attribute of a class or module, or using the facilities in the annotationlib module. If the assignment target is not simple (an attribute, subscript node, or parenthesized name), the annotation is never evaluated. If a name is annotated in a function scope, then this name is local for that scope. Annotations are never evaluated and stored in function scopes. If the right hand side is present, an annotated assignment performs the actual assignment as if there was no annotation present. If the right hand side is not present for an expression target, then the interpreter evaluates the target except for the last __setitem__() or __setattr__() call. See also PEP 526 - Syntax for Variable Annotations The proposal that added syntax for annotating the types of variables (including class variables and instance variables), instead of expressing them through comments. PEP 484 - Type hints The proposal that added the typing module to provide a standard syntax for type annotations that can be used in static analysis tools and IDEs. Changed in version 3.8: Now annotated assignments allow the same expressions in the right hand side as regular assignments. Previously, some expressions (like un-parenthesized tuple expressions) caused a syntax error. Changed in version 3.14: Annotations are now lazily evaluated in a separate annotation scope . If the assignment target is not simple, annotations are never evaluated. 7.3. The assert statement ¶ Assert statements are a convenient way to insert debugging assertions into a program: assert_stmt : "assert" expression [ "," expression ] The simple form, assert expression , is equivalent to if __debug__ : if not expression : raise AssertionError The extended form, assert expression1, expression2 , is equivalent to if __debug__ : if not expression1 : raise AssertionError ( expression2 ) These equivalences assume that __debug__ and AssertionError refer to the built-in variables with those names. In the current implementation, the built-in variable __debug__ is True under normal circumstances, False when optimization is requested (command line option -O ). The current code generator emits no code for an assert statement when optimization is requested at compile time. Note that it is unnecessary to include the source code for the expression that failed in the error message; it will be displayed as part of the stack trace. Assignments to __debug__ are illegal. The value for the built-in variable is determined when the interpreter starts. 7.4. The pass statement ¶ pass_stmt : "pass" pass is a null operation — when it is executed, nothing happens. It is useful as a placeholder when a statement is required syntactically, but no code needs to be executed, for example: def f ( arg ): pass # a function that does nothing (yet) class C : pass # a class with no methods (yet) 7.5. The del statement ¶ del_stmt : "del" target_list Deletion is recursively defined very similar to the way assignment is defined. Rather than spelling it out in full details, here are some hints. Deletion of a target list recursively deletes each target, from left to right. Deletion of a name removes the binding of that name from the local or global namespace, depending on whether the name occurs in a global statement in the same code block. Trying to delete an unbound name raises a NameError exception. Deletion of attribute references, subscriptions and slicings is passed to the primary object involved; deletion of a slicing is in general equivalent to assignment of an empty slice of the right type (but even this is determined by the sliced object). Changed in version 3.2: Previously it was illegal to delete a name from the local namespace if it occurs as a free variable in a nested block. 7.6. The return statement ¶ return_stmt : "return" [ expression_list ] return may only occur syntactically nested in a function definition, not within a nested class definition. If an expression list is present, it is evaluated, else None is substituted. return leaves the current function call with the expression list (or None ) as return value. When return passes control out of a try statement with a finally clause, that finally clause is executed before really leaving the function. In a generator function, the return statement indicates that the generator is done and will cause StopIteration to be raised. The returned value (if any) is used as an argument to construct StopIteration and becomes the StopIteration.value attribute. In an asynchronous generator function, an empty return statement indicates that the asynchronous generator is done and will cause StopAsyncIteration to be raised. A non-empty return statement is a syntax error in an asynchronous generator function. 7.7. The yield statement ¶ yield_stmt : yield_expression A yield statement is semantically equivalent to a yield expression . The yield statement can be used to omit the parentheses that would otherwise be required in the equivalent yield expression statement. For example, the yield statements yield < expr > yield from < expr > are equivalent to the yield expression statements ( yield < expr > ) ( yield from < expr > ) Yield expressions and statements are only used when defining a generator function, and are only used in the body of the generator function. Using yield in a function definition is sufficient to cause that definition to create a generator function instead of a normal function. For full details of yield semantics, refer to the Yield expressions section. 7.8. The raise statement ¶ raise_stmt : "raise" [ expression [ "from" expression ]] If no expressions are present, raise re-raises the exception that is currently being handled, which is also known as the active exception . If there isn’t currently an active exception, a RuntimeError exception is raised indicating that this is an error. Otherwise, raise evaluates the first expression as the exception object. It must be either a subclass or an instance of BaseException . If it is a class, the exception instance will be obtained when needed by instantiating the class with no arguments. The type of the exception is the exception instance’s class, the value is the instance itself. A traceback object is normally created automatically when an exception is raised and attached to it as the __traceback__ attribute. You can create an exception and set your own traceback in one step using the with_traceback() exception method (which returns the same exception instance, with its traceback set to its argument), like so: raise Exception ( "foo occurred" ) . with_traceback ( tracebackobj ) The from clause is used for exception chaining: if given, the second expression must be another exception class or instance. If the second expression is an exception instance, it will be attached to the raised exception as the __cause__ attribute (which is writable). If the expression is an exception class, the class will be instantiated and the resulting exception instance will be attached to the raised exception as the __cause__ attribute. If the raised exception is not handled, both exceptions will be printed: >>> try : ... print ( 1 / 0 ) ... except Exception as exc : ... raise RuntimeError ( "Something bad happened" ) from exc ... Traceback (most recent call last): File "<stdin>" , line 2 , in <module> print ( 1 / 0 ) ~~^~~ ZeroDivisionError : division by zero The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<stdin>" , line 4 , in <module> raise RuntimeError ( "Something bad happened" ) from exc RuntimeError : Something bad happened A similar mechanism works implicitly if a new exception is raised when an exception is already being handled. An exception may be handled when an except or finally clause, or a with statement, is used. The previous exception is then attached as the new exception’s __context__ attribute: >>> try : ... print ( 1 / 0 ) ... except : ... raise RuntimeError ( "Something bad happened" ) ... Traceback (most recent call last): File "<stdin>" , line 2 , in <module> print ( 1 / 0 ) ~~^~~ ZeroDivisionError : division by zero During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>" , line 4 , in <module> raise RuntimeError ( "Something bad happened" ) RuntimeError : Something bad happened Exception chaining can be explicitly suppressed by specifying None in the from clause: >>> try : ... print ( 1 / 0 ) ... except : ... raise RuntimeError ( "Something bad happened" ) from None ... Traceback (most recent call last): File "<stdin>" , line 4 , in <module> RuntimeError : Something bad happened Additional information on exceptions can be found in section Exceptions , and information about handling exceptions is in section The try statement . Changed in version 3.3: None is now permitted as Y in raise X from Y . Added the __suppress_context__ attribute to suppress automatic display of the exception context. Changed in version 3.11: If the traceback of the active exception is modified in an except clause, a subsequent raise statement re-raises the exception with the modified traceback. Previously, the exception was re-raised with the traceback it had when it was caught. 7.9. The break statement ¶ break_stmt : "break" break may only occur syntactically nested in a for or while loop, but not nested in a function or class definition within that loop. It terminates the nearest enclosing loop, skipping the optional else clause if the loop has one. If a for loop is terminated by break , the loop control target keeps its current value. When break passes control out of a try statement with a finally clause, that finally clause is executed before really leaving the loop. 7.10. The continue statement ¶ continue_stmt : "continue" continue may only occur syntactically nested in a for or while loop, but not nested in a function or class definition within that loop. It continues with the next cycle of the nearest enclosing loop. When continue passes control out of a try statement with a finally clause, that finally clause is executed before really starting the next loop cycle. 7.11. The import statement ¶ import_stmt : "import" module [ "as" identifier ] ( "," module [ "as" identifier ])* | "from" relative_module "import" identifier [ "as" identifier ] ( "," identifier [ "as" identifier ])* | "from" relative_module "import" "(" identifier [ "as" identifier ] ( "," identifier [ "as" identifier ])* [ "," ] ")" | "from" relative_module "import" "*" module : ( identifier "." )* identifier relative_module : "." * module | "." + The basic import statement (no from clause) is executed in two steps: find a module, loading and initializing it if necessary define a name or names in the local namespace for the scope where the import statement occurs. When the statement contains multiple clauses (separated by commas) the two steps are carried out separately for each clause, just as though the clauses had been separated out into individual import statements. The details of the first step, finding and loading modules, are described in greater detail in the section on the import system , which also describes the various types of packages and modules that can be imported, as well as all the hooks that can be used to customize the import system. Note that failures in this step may indicate either that the module could not be located, or that an error occurred while initializing the module, which includes execution of the module’s code. If the requested module is retrieved successfully, it will be made available in the local namespace in one of three ways: If the module name is followed by as , then the name following as is bound directly to the imported module. If no other name is specified, and the module being imported is a top level module, the module’s name is bound in the local namespace as a reference to the imported module If the module being imported is not a top level module, then the name of the top level package that contains the module is bound in the local namespace as a reference to the top level package. The imported module must be accessed using its full qualified name rather than directly The from form uses a slightly more complex process: find the module specified in the from clause, loading and initializing it if necessary; for each of the identifiers specified in the import clauses: check if the imported module has an attribute by that name if not, attempt to import a submodule with that name and then check the imported module again for that attribute if the attribute is not found, ImportError is raised. otherwise, a reference to that value is stored in the local namespace, using the name in the as clause if it is present, otherwise using the attribute name Examples: import foo # foo imported and bound locally import foo.bar.baz # foo, foo.bar, and foo.bar.baz imported, foo bound locally import foo.bar.baz as fbb # foo, foo.bar, and foo.bar.baz imported, foo.bar.baz bound as fbb from foo.bar import baz # foo, foo.bar, and foo.bar.baz imported, foo.bar.baz bound as baz from foo import attr # foo imported and foo.attr bound as attr If the list of identifiers is replaced by a star ( '*' ), all public names defined in the module are bound in the local namespace for the scope where the import statement occurs. The public names defined by a module are determined by checking the module’s namespace for a variable named __all__ ; if defined, it must be a sequence of strings which are names defined or imported by that module. The names given in __all__ are all considered public and are required to exist. If __all__ is not defined, the set of public names includes all names found in the module’s namespace which do not begin with an underscore character ( '_' ). __all__ should contain the entire public API. It is intended to avoid accidentally exporting items that are not part of the API (such as library modules which were imported and used within the module). The wild card form of import — from module import * — is only allowed at the module level. Attempting to use it in class or function definitions will raise a SyntaxError . When specifying what module to import you do not have to specify the absolute name of the module. When a module or package is contained within another package it is possible to make a relative import within the same top package without having to mention the package name. By using leading dots in the specified module or package after from you can specify how high to traverse up the current package hierarchy without specifying exact names. One leading dot means the current package where the module making the import exists. Two dots means up one package level. Three dots is up two levels, etc. So if you execute from . import mod from a module in the pkg package then you will end up importing pkg.mod . If you execute from ..subpkg2 import mod from within pkg.subpkg1 you will import pkg.subpkg2.mod . The specification for relative imports is contained in the Package Relative Imports section. importlib.import_module() is provided to support applications that determine dynamically the modules to be loaded. Raises an auditing event import with arguments module , filename , sys.path , sys.meta_path , sys.path_hooks . 7.11.1. Future statements ¶ A future statement is a directive to the compiler that a particular module should be compiled using syntax or semantics that will be available in a specified future release of Python where the feature becomes standard. The future statement is intended to ease migration to future versions of Python that introduce incompatible changes to the language. It allows use of the new features on a per-module basis before the release in which the feature becomes standard. future_stmt : "from" "__future__" "import" feature [ "as" identifier ] ( "," feature [ "as" identifier ])* | "from" "__future__" "import" "(" feature [ "as" identifier ] ( "," feature [ "as" identifier ])* [ "," ] ")" feature : identifier A future statement must appear near the top of the module. The only lines that can appear before a future statement are: the module docstring (if any), comments, blank lines, and other future statements. The only feature that requires using the future statement is annotations (see PEP 563 ). All historical features enabled by the future statement are still recognized by Python 3. The list includes absolute_import , division , generators , generator_stop , unicode_literals , print_function , nested_scopes and with_statement . They are all redundant because they are always enabled, and only kept for backwards compatibility. A future statement is recognized and treated specially at compile time: Changes to the semantics of core constructs are often implemented by generating different code. It may even be the case that a new feature introduces new incompatible syntax (such as a new reserved word), in which case the compiler may need to parse the module differently. Such decisions cannot be pushed off until runtime. For any given release, the compiler knows which feature names have been defined, and raises a compile-time error if a future statement contains a feature not known to it. The direct runtime semantics are the same as for any import statement: there is a standard module __future__ , described later, and it will be imported in the usual way at the time the future statement is executed. The interesting runtime semantics depend on the specific feature enabled by the future statement. Note that there is nothing special about the statement: import __future__ [ as name ] That is not a future statement; it’s an ordinary import statement with no special semantics or syntax restrictions. Code compiled by calls to the built-in functions exec() and compile() that occur in a module M containing a future statement will, by default, use the new syntax or semantics associated with the future statement. This can be controlled by optional arguments to compile() — see the documentation of that function for details. A future statement typed at an interactive interpreter prompt will take effect for the rest of the interpreter session. If an interpreter is started with the -i option, is passed a script name to execute, and the script includes a future statement, it will be in effect in the interactive session started after the script is executed. See also PEP 236 - Back to the __future__ The original proposal for the __future__ mechanism. 7.12. The global statement ¶ global_stmt : "global" identifier ( "," identifier )* The global statement causes the listed identifiers to be interpreted as globals. It would be impossible to assign to a global variable without global , although free variables may refer to globals without being declared global. The global statement applies to the entire current scope (module, function body or class definition). A SyntaxError is raised if a variable is used or assigned to prior to its global declaration in the scope. At the module level, all variables are global, so a global statement has no effect. However, variables must still not be used or assigned to prior to their global declaration. This requirement is relaxed in the interactive prompt ( REPL ). Programmer’s note: global is a directive to the parser. It applies only to code parsed at the same time as the global statement. In particular, a global statement contained in a string or code object supplied to the built-in exec() function does not affect the code block containing the function call, and code contained in such a string is unaffected by global statements in the code containing the function call. The same applies to the eval() and compile() functions. 7.13. The nonlocal statement ¶ nonlocal_stmt : "nonlocal" identifier ( "," identifier )* When the definition of a function or class is nested (enclosed) within the definitions of other functions, its nonlocal scopes are the local scopes of the enclosing functions. The nonlocal statement causes the listed identifiers to refer to names previously bound in nonlocal scopes. It allows encapsulated code to rebind such nonlocal identifiers. If a name is bound in more than one nonlocal scope, the nearest binding is used. If a name is not bound in any nonlocal scope, or if there is no nonlocal scope, a SyntaxError is raised. The nonlocal statement applies to the entire scope of a function or class body. A SyntaxError is raised if a variable is used or assigned to prior to its nonlocal declaration in the scope. See also PEP 3104 - Access to Names in Outer Scopes The specification for the nonlocal statement. Programmer’s note: nonlocal is a directive to the parser and applies only to code parsed along with it. See the note for the global statement. 7.14. The type statement ¶ type_stmt : 'type' identifier [ type_params ] "=" expression The type statement declares a type alias, which is an instance of typing.TypeAliasType . For example, the following statement creates a type alias: type Point = tuple [ float , float ] This code is roughly equivalent to: annotation - def VALUE_OF_Point (): return tuple [ float , float ] Point = typing . TypeAliasType ( "Point" , VALUE_OF_Point ()) annotation-def indicates an annotation scope , which behaves mostly like a function, but with several small differences. The value of the type alias is evaluated in the annotation scope. It is not evaluated when the type alias is created, but only when the value is accessed through the type alias’s __value__ attribute (see Lazy evaluation ). This allows the type alias to refer to names that are not yet defined. Type aliases may be made generic by adding a type parameter list after the name. See Generic type aliases for more. type is a soft keyword . Added in version 3.12. See also PEP 695 - Type Parameter Syntax Introduced the type statement and syntax for generic classes and functions. Table of Contents 7. Simple statements 7.1. Expression statements 7.2. Assignment statements 7.2.1. Augmented assignment statements 7.2.2. Annotated assignment statements 7.3. The assert statement 7.4. The pass statement 7.5. The del statement 7.6. The return statement 7.7. The yield statement 7.8. The raise statement 7.9. The break statement 7.10. The continue statement 7.11. The import statement 7.11.1. Future statements 7.12. The global statement 7.13. The nonlocal statement 7.14. The type statement Previous topic 6. Expressions Next topic 8. Compound statements This page Report a bug Show source « Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Language Reference » 7. Simple statements | Theme Auto Light Dark | © Copyright 2001 Python Software Foundation. This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. See History and License for more information. The Python Software Foundation is a non-profit corporation. Please donate. Last updated on Jan 13, 2026 (06:19 UTC). Found a bug ? Created using Sphinx 8.2.3. | 2026-01-13T08:48:44 |
https://docs.python.org/3/tutorial/controlflow.html#default-argument-values | 4. More Control Flow Tools — Python 3.14.2 documentation Theme Auto Light Dark Table of Contents 4. More Control Flow Tools 4.1. if Statements 4.2. for Statements 4.3. The range() Function 4.4. break and continue Statements 4.5. else Clauses on Loops 4.6. pass Statements 4.7. match Statements 4.8. Defining Functions 4.9. More on Defining Functions 4.9.1. Default Argument Values 4.9.2. Keyword Arguments 4.9.3. Special parameters 4.9.3.1. Positional-or-Keyword Arguments 4.9.3.2. Positional-Only Parameters 4.9.3.3. Keyword-Only Arguments 4.9.3.4. Function Examples 4.9.3.5. Recap 4.9.4. Arbitrary Argument Lists 4.9.5. Unpacking Argument Lists 4.9.6. Lambda Expressions 4.9.7. Documentation Strings 4.9.8. Function Annotations 4.10. Intermezzo: Coding Style Previous topic 3. An Informal Introduction to Python Next topic 5. Data Structures This page Report a bug Show source Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 4. More Control Flow Tools | Theme Auto Light Dark | 4. More Control Flow Tools ¶ As well as the while statement just introduced, Python uses a few more that we will encounter in this chapter. 4.1. if Statements ¶ Perhaps the most well-known statement type is the if statement. For example: >>> x = int ( input ( "Please enter an integer: " )) Please enter an integer: 42 >>> if x < 0 : ... x = 0 ... print ( 'Negative changed to zero' ) ... elif x == 0 : ... print ( 'Zero' ) ... elif x == 1 : ... print ( 'Single' ) ... else : ... print ( 'More' ) ... More There can be zero or more elif parts, and the else part is optional. The keyword ‘ elif ’ is short for ‘else if’, and is useful to avoid excessive indentation. An if … elif … elif … sequence is a substitute for the switch or case statements found in other languages. If you’re comparing the same value to several constants, or checking for specific types or attributes, you may also find the match statement useful. For more details see match Statements . 4.2. for Statements ¶ The for statement in Python differs a bit from what you may be used to in C or Pascal. Rather than always iterating over an arithmetic progression of numbers (like in Pascal), or giving the user the ability to define both the iteration step and halting condition (as C), Python’s for statement iterates over the items of any sequence (a list or a string), in the order that they appear in the sequence. For example (no pun intended): >>> # Measure some strings: >>> words = [ 'cat' , 'window' , 'defenestrate' ] >>> for w in words : ... print ( w , len ( w )) ... cat 3 window 6 defenestrate 12 Code that modifies a collection while iterating over that same collection can be tricky to get right. Instead, it is usually more straight-forward to loop over a copy of the collection or to create a new collection: # Create a sample collection users = { 'Hans' : 'active' , 'Éléonore' : 'inactive' , '景太郎' : 'active' } # Strategy: Iterate over a copy for user , status in users . copy () . items (): if status == 'inactive' : del users [ user ] # Strategy: Create a new collection active_users = {} for user , status in users . items (): if status == 'active' : active_users [ user ] = status 4.3. The range() Function ¶ If you do need to iterate over a sequence of numbers, the built-in function range() comes in handy. It generates arithmetic progressions: >>> for i in range ( 5 ): ... print ( i ) ... 0 1 2 3 4 The given end point is never part of the generated sequence; range(10) generates 10 values, the legal indices for items of a sequence of length 10. It is possible to let the range start at another number, or to specify a different increment (even negative; sometimes this is called the ‘step’): >>> list ( range ( 5 , 10 )) [5, 6, 7, 8, 9] >>> list ( range ( 0 , 10 , 3 )) [0, 3, 6, 9] >>> list ( range ( - 10 , - 100 , - 30 )) [-10, -40, -70] To iterate over the indices of a sequence, you can combine range() and len() as follows: >>> a = [ 'Mary' , 'had' , 'a' , 'little' , 'lamb' ] >>> for i in range ( len ( a )): ... print ( i , a [ i ]) ... 0 Mary 1 had 2 a 3 little 4 lamb In most such cases, however, it is convenient to use the enumerate() function, see Looping Techniques . A strange thing happens if you just print a range: >>> range ( 10 ) range(0, 10) In many ways the object returned by range() behaves as if it is a list, but in fact it isn’t. It is an object which returns the successive items of the desired sequence when you iterate over it, but it doesn’t really make the list, thus saving space. We say such an object is iterable , that is, suitable as a target for functions and constructs that expect something from which they can obtain successive items until the supply is exhausted. We have seen that the for statement is such a construct, while an example of a function that takes an iterable is sum() : >>> sum ( range ( 4 )) # 0 + 1 + 2 + 3 6 Later we will see more functions that return iterables and take iterables as arguments. In chapter Data Structures , we will discuss in more detail about list() . 4.4. break and continue Statements ¶ The break statement breaks out of the innermost enclosing for or while loop: >>> for n in range ( 2 , 10 ): ... for x in range ( 2 , n ): ... if n % x == 0 : ... print ( f " { n } equals { x } * { n // x } " ) ... break ... 4 equals 2 * 2 6 equals 2 * 3 8 equals 2 * 4 9 equals 3 * 3 The continue statement continues with the next iteration of the loop: >>> for num in range ( 2 , 10 ): ... if num % 2 == 0 : ... print ( f "Found an even number { num } " ) ... continue ... print ( f "Found an odd number { num } " ) ... Found an even number 2 Found an odd number 3 Found an even number 4 Found an odd number 5 Found an even number 6 Found an odd number 7 Found an even number 8 Found an odd number 9 4.5. else Clauses on Loops ¶ In a for or while loop the break statement may be paired with an else clause. If the loop finishes without executing the break , the else clause executes. In a for loop, the else clause is executed after the loop finishes its final iteration, that is, if no break occurred. In a while loop, it’s executed after the loop’s condition becomes false. In either kind of loop, the else clause is not executed if the loop was terminated by a break . Of course, other ways of ending the loop early, such as a return or a raised exception, will also skip execution of the else clause. This is exemplified in the following for loop, which searches for prime numbers: >>> for n in range ( 2 , 10 ): ... for x in range ( 2 , n ): ... if n % x == 0 : ... print ( n , 'equals' , x , '*' , n // x ) ... break ... else : ... # loop fell through without finding a factor ... print ( n , 'is a prime number' ) ... 2 is a prime number 3 is a prime number 4 equals 2 * 2 5 is a prime number 6 equals 2 * 3 7 is a prime number 8 equals 2 * 4 9 equals 3 * 3 (Yes, this is the correct code. Look closely: the else clause belongs to the for loop, not the if statement.) One way to think of the else clause is to imagine it paired with the if inside the loop. As the loop executes, it will run a sequence like if/if/if/else. The if is inside the loop, encountered a number of times. If the condition is ever true, a break will happen. If the condition is never true, the else clause outside the loop will execute. When used with a loop, the else clause has more in common with the else clause of a try statement than it does with that of if statements: a try statement’s else clause runs when no exception occurs, and a loop’s else clause runs when no break occurs. For more on the try statement and exceptions, see Handling Exceptions . 4.6. pass Statements ¶ The pass statement does nothing. It can be used when a statement is required syntactically but the program requires no action. For example: >>> while True : ... pass # Busy-wait for keyboard interrupt (Ctrl+C) ... This is commonly used for creating minimal classes: >>> class MyEmptyClass : ... pass ... Another place pass can be used is as a place-holder for a function or conditional body when you are working on new code, allowing you to keep thinking at a more abstract level. The pass is silently ignored: >>> def initlog ( * args ): ... pass # Remember to implement this! ... For this last case, many people use the ellipsis literal ... instead of pass . This use has no special meaning to Python, and is not part of the language definition (you could use any constant expression here), but ... is used conventionally as a placeholder body as well. See The Ellipsis Object . 4.7. match Statements ¶ A match statement takes an expression and compares its value to successive patterns given as one or more case blocks. This is superficially similar to a switch statement in C, Java or JavaScript (and many other languages), but it’s more similar to pattern matching in languages like Rust or Haskell. Only the first pattern that matches gets executed and it can also extract components (sequence elements or object attributes) from the value into variables. If no case matches, none of the branches is executed. The simplest form compares a subject value against one or more literals: def http_error ( status ): match status : case 400 : return "Bad request" case 404 : return "Not found" case 418 : return "I'm a teapot" case _ : return "Something's wrong with the internet" Note the last block: the “variable name” _ acts as a wildcard and never fails to match. You can combine several literals in a single pattern using | (“or”): case 401 | 403 | 404 : return "Not allowed" Patterns can look like unpacking assignments, and can be used to bind variables: # point is an (x, y) tuple match point : case ( 0 , 0 ): print ( "Origin" ) case ( 0 , y ): print ( f "Y= { y } " ) case ( x , 0 ): print ( f "X= { x } " ) case ( x , y ): print ( f "X= { x } , Y= { y } " ) case _ : raise ValueError ( "Not a point" ) Study that one carefully! The first pattern has two literals, and can be thought of as an extension of the literal pattern shown above. But the next two patterns combine a literal and a variable, and the variable binds a value from the subject ( point ). The fourth pattern captures two values, which makes it conceptually similar to the unpacking assignment (x, y) = point . If you are using classes to structure your data you can use the class name followed by an argument list resembling a constructor, but with the ability to capture attributes into variables: class Point : def __init__ ( self , x , y ): self . x = x self . y = y def where_is ( point ): match point : case Point ( x = 0 , y = 0 ): print ( "Origin" ) case Point ( x = 0 , y = y ): print ( f "Y= { y } " ) case Point ( x = x , y = 0 ): print ( f "X= { x } " ) case Point (): print ( "Somewhere else" ) case _ : print ( "Not a point" ) You can use positional parameters with some builtin classes that provide an ordering for their attributes (e.g. dataclasses). You can also define a specific position for attributes in patterns by setting the __match_args__ special attribute in your classes. If it’s set to (“x”, “y”), the following patterns are all equivalent (and all bind the y attribute to the var variable): Point ( 1 , var ) Point ( 1 , y = var ) Point ( x = 1 , y = var ) Point ( y = var , x = 1 ) A recommended way to read patterns is to look at them as an extended form of what you would put on the left of an assignment, to understand which variables would be set to what. Only the standalone names (like var above) are assigned to by a match statement. Dotted names (like foo.bar ), attribute names (the x= and y= above) or class names (recognized by the “(…)” next to them like Point above) are never assigned to. Patterns can be arbitrarily nested. For example, if we have a short list of Points, with __match_args__ added, we could match it like this: class Point : __match_args__ = ( 'x' , 'y' ) def __init__ ( self , x , y ): self . x = x self . y = y match points : case []: print ( "No points" ) case [ Point ( 0 , 0 )]: print ( "The origin" ) case [ Point ( x , y )]: print ( f "Single point { x } , { y } " ) case [ Point ( 0 , y1 ), Point ( 0 , y2 )]: print ( f "Two on the Y axis at { y1 } , { y2 } " ) case _ : print ( "Something else" ) We can add an if clause to a pattern, known as a “guard”. If the guard is false, match goes on to try the next case block. Note that value capture happens before the guard is evaluated: match point : case Point ( x , y ) if x == y : print ( f "Y=X at { x } " ) case Point ( x , y ): print ( f "Not on the diagonal" ) Several other key features of this statement: Like unpacking assignments, tuple and list patterns have exactly the same meaning and actually match arbitrary sequences. An important exception is that they don’t match iterators or strings. Sequence patterns support extended unpacking: [x, y, *rest] and (x, y, *rest) work similar to unpacking assignments. The name after * may also be _ , so (x, y, *_) matches a sequence of at least two items without binding the remaining items. Mapping patterns: {"bandwidth": b, "latency": l} captures the "bandwidth" and "latency" values from a dictionary. Unlike sequence patterns, extra keys are ignored. An unpacking like **rest is also supported. (But **_ would be redundant, so it is not allowed.) Subpatterns may be captured using the as keyword: case ( Point ( x1 , y1 ), Point ( x2 , y2 ) as p2 ): ... will capture the second element of the input as p2 (as long as the input is a sequence of two points) Most literals are compared by equality, however the singletons True , False and None are compared by identity. Patterns may use named constants. These must be dotted names to prevent them from being interpreted as capture variable: from enum import Enum class Color ( Enum ): RED = 'red' GREEN = 'green' BLUE = 'blue' color = Color ( input ( "Enter your choice of 'red', 'blue' or 'green': " )) match color : case Color . RED : print ( "I see red!" ) case Color . GREEN : print ( "Grass is green" ) case Color . BLUE : print ( "I'm feeling the blues :(" ) For a more detailed explanation and additional examples, you can look into PEP 636 which is written in a tutorial format. 4.8. Defining Functions ¶ We can create a function that writes the Fibonacci series to an arbitrary boundary: >>> def fib ( n ): # write Fibonacci series less than n ... """Print a Fibonacci series less than n.""" ... a , b = 0 , 1 ... while a < n : ... print ( a , end = ' ' ) ... a , b = b , a + b ... print () ... >>> # Now call the function we just defined: >>> fib ( 2000 ) 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 The keyword def introduces a function definition . It must be followed by the function name and the parenthesized list of formal parameters. The statements that form the body of the function start at the next line, and must be indented. The first statement of the function body can optionally be a string literal; this string literal is the function’s documentation string, or docstring . (More about docstrings can be found in the section Documentation Strings .) There are tools which use docstrings to automatically produce online or printed documentation, or to let the user interactively browse through code; it’s good practice to include docstrings in code that you write, so make a habit of it. The execution of a function introduces a new symbol table used for the local variables of the function. More precisely, all variable assignments in a function store the value in the local symbol table; whereas variable references first look in the local symbol table, then in the local symbol tables of enclosing functions, then in the global symbol table, and finally in the table of built-in names. Thus, global variables and variables of enclosing functions cannot be directly assigned a value within a function (unless, for global variables, named in a global statement, or, for variables of enclosing functions, named in a nonlocal statement), although they may be referenced. The actual parameters (arguments) to a function call are introduced in the local symbol table of the called function when it is called; thus, arguments are passed using call by value (where the value is always an object reference , not the value of the object). [ 1 ] When a function calls another function, or calls itself recursively, a new local symbol table is created for that call. A function definition associates the function name with the function object in the current symbol table. The interpreter recognizes the object pointed to by that name as a user-defined function. Other names can also point to that same function object and can also be used to access the function: >>> fib <function fib at 10042ed0> >>> f = fib >>> f ( 100 ) 0 1 1 2 3 5 8 13 21 34 55 89 Coming from other languages, you might object that fib is not a function but a procedure since it doesn’t return a value. In fact, even functions without a return statement do return a value, albeit a rather boring one. This value is called None (it’s a built-in name). Writing the value None is normally suppressed by the interpreter if it would be the only value written. You can see it if you really want to using print() : >>> fib ( 0 ) >>> print ( fib ( 0 )) None It is simple to write a function that returns a list of the numbers of the Fibonacci series, instead of printing it: >>> def fib2 ( n ): # return Fibonacci series up to n ... """Return a list containing the Fibonacci series up to n.""" ... result = [] ... a , b = 0 , 1 ... while a < n : ... result . append ( a ) # see below ... a , b = b , a + b ... return result ... >>> f100 = fib2 ( 100 ) # call it >>> f100 # write the result [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] 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 . The statement result.append(a) calls a method of the list object result . A method is a function that ‘belongs’ to an object and is named obj.methodname , where obj is some object (this may be an expression), and methodname is the name of a method that is defined by the object’s type. Different types define different methods. Methods of different types may have the same name without causing ambiguity. (It is possible to define your own object types and methods, using classes , see Classes ) The method append() shown in the example is defined for list objects; it adds a new element at the end of the list. In this example it is equivalent to result = result + [a] , but more efficient. 4.9. More on Defining Functions ¶ It is also possible to define functions with a variable number of arguments. There are three forms, which can be combined. 4.9.1. Default Argument Values ¶ The most useful form is to specify a default value for one or more arguments. This creates a function that can be called with fewer arguments than it is defined to allow. For example: def ask_ok ( prompt , retries = 4 , reminder = 'Please try again!' ): while True : reply = input ( prompt ) if reply in { 'y' , 'ye' , 'yes' }: return True if reply in { 'n' , 'no' , 'nop' , 'nope' }: return False retries = retries - 1 if retries < 0 : raise ValueError ( 'invalid user response' ) print ( reminder ) This function can be called in several ways: giving only the mandatory argument: ask_ok('Do you really want to quit?') giving one of the optional arguments: ask_ok('OK to overwrite the file?', 2) or even giving all arguments: ask_ok('OK to overwrite the file?', 2, 'Come on, only yes or no!') This example also introduces the in keyword. This tests whether or not a sequence contains a certain value. The default values are evaluated at the point of function definition in the defining scope, so that i = 5 def f ( arg = i ): print ( arg ) i = 6 f () will print 5 . Important warning: The default value is evaluated only once. This makes a difference when the default is a mutable object such as a list, dictionary, or instances of most classes. For example, the following function accumulates the arguments passed to it on subsequent calls: def f ( a , L = []): L . append ( a ) return L print ( f ( 1 )) print ( f ( 2 )) print ( f ( 3 )) This will print [ 1 ] [ 1 , 2 ] [ 1 , 2 , 3 ] If you don’t want the default to be shared between subsequent calls, you can write the function like this instead: def f ( a , L = None ): if L is None : L = [] L . append ( a ) return L 4.9.2. Keyword Arguments ¶ Functions can also be called using keyword arguments of the form kwarg=value . For instance, the following function: def parrot ( voltage , state = 'a stiff' , action = 'voom' , type = 'Norwegian Blue' ): print ( "-- This parrot wouldn't" , action , end = ' ' ) print ( "if you put" , voltage , "volts through it." ) print ( "-- Lovely plumage, the" , type ) print ( "-- It's" , state , "!" ) accepts one required argument ( voltage ) and three optional arguments ( state , action , and type ). This function can be called in any of the following ways: parrot ( 1000 ) # 1 positional argument parrot ( voltage = 1000 ) # 1 keyword argument parrot ( voltage = 1000000 , action = 'VOOOOOM' ) # 2 keyword arguments parrot ( action = 'VOOOOOM' , voltage = 1000000 ) # 2 keyword arguments parrot ( 'a million' , 'bereft of life' , 'jump' ) # 3 positional arguments parrot ( 'a thousand' , state = 'pushing up the daisies' ) # 1 positional, 1 keyword but all the following calls would be invalid: parrot () # required argument missing parrot ( voltage = 5.0 , 'dead' ) # non-keyword argument after a keyword argument parrot ( 110 , voltage = 220 ) # duplicate value for the same argument parrot ( actor = 'John Cleese' ) # unknown keyword argument In a function call, keyword arguments must follow positional arguments. All the keyword arguments passed must match one of the arguments accepted by the function (e.g. actor is not a valid argument for the parrot function), and their order is not important. This also includes non-optional arguments (e.g. parrot(voltage=1000) is valid too). No argument may receive a value more than once. Here’s an example that fails due to this restriction: >>> def function ( a ): ... pass ... >>> function ( 0 , a = 0 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : function() got multiple values for argument 'a' When a final formal parameter of the form **name is present, it receives a dictionary (see Mapping Types — dict ) containing all keyword arguments except for those corresponding to a formal parameter. This may be combined with a formal parameter of the form *name (described in the next subsection) which receives a tuple containing the positional arguments beyond the formal parameter list. ( *name must occur before **name .) For example, if we define a function like this: def cheeseshop ( kind , * arguments , ** keywords ): print ( "-- Do you have any" , kind , "?" ) print ( "-- I'm sorry, we're all out of" , kind ) for arg in arguments : print ( arg ) print ( "-" * 40 ) for kw in keywords : print ( kw , ":" , keywords [ kw ]) It could be called like this: cheeseshop ( "Limburger" , "It's very runny, sir." , "It's really very, VERY runny, sir." , shopkeeper = "Michael Palin" , client = "John Cleese" , sketch = "Cheese Shop Sketch" ) and of course it would print: -- Do you have any Limburger ? -- I'm sorry, we're all out of Limburger It's very runny, sir. It's really very, VERY runny, sir. ---------------------------------------- shopkeeper : Michael Palin client : John Cleese sketch : Cheese Shop Sketch Note that the order in which the keyword arguments are printed is guaranteed to match the order in which they were provided in the function call. 4.9.3. Special parameters ¶ By default, arguments may be passed to a Python function either by position or explicitly by keyword. For readability and performance, it makes sense to restrict the way arguments can be passed so that a developer need only look at the function definition to determine if items are passed by position, by position or keyword, or by keyword. A function definition may look like: def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2): ----------- ---------- ---------- | | | | Positional or keyword | | - Keyword only -- Positional only where / and * are optional. If used, these symbols indicate the kind of parameter by how the arguments may be passed to the function: positional-only, positional-or-keyword, and keyword-only. Keyword parameters are also referred to as named parameters. 4.9.3.1. Positional-or-Keyword Arguments ¶ If / and * are not present in the function definition, arguments may be passed to a function by position or by keyword. 4.9.3.2. Positional-Only Parameters ¶ Looking at this in a bit more detail, it is possible to mark certain parameters as positional-only . If positional-only , the parameters’ order matters, and the parameters cannot be passed by keyword. Positional-only parameters are placed before a / (forward-slash). The / is used to logically separate the positional-only parameters from the rest of the parameters. If there is no / in the function definition, there are no positional-only parameters. Parameters following the / may be positional-or-keyword or keyword-only . 4.9.3.3. Keyword-Only Arguments ¶ To mark parameters as keyword-only , indicating the parameters must be passed by keyword argument, place an * in the arguments list just before the first keyword-only parameter. 4.9.3.4. Function Examples ¶ Consider the following example function definitions paying close attention to the markers / and * : >>> def standard_arg ( arg ): ... print ( arg ) ... >>> def pos_only_arg ( arg , / ): ... print ( arg ) ... >>> def kwd_only_arg ( * , arg ): ... print ( arg ) ... >>> def combined_example ( pos_only , / , standard , * , kwd_only ): ... print ( pos_only , standard , kwd_only ) The first function definition, standard_arg , the most familiar form, places no restrictions on the calling convention and arguments may be passed by position or keyword: >>> standard_arg ( 2 ) 2 >>> standard_arg ( arg = 2 ) 2 The second function pos_only_arg is restricted to only use positional parameters as there is a / in the function definition: >>> pos_only_arg ( 1 ) 1 >>> pos_only_arg ( arg = 1 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : pos_only_arg() got some positional-only arguments passed as keyword arguments: 'arg' The third function kwd_only_arg only allows keyword arguments as indicated by a * in the function definition: >>> kwd_only_arg ( 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : kwd_only_arg() takes 0 positional arguments but 1 was given >>> kwd_only_arg ( arg = 3 ) 3 And the last uses all three calling conventions in the same function definition: >>> combined_example ( 1 , 2 , 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : combined_example() takes 2 positional arguments but 3 were given >>> combined_example ( 1 , 2 , kwd_only = 3 ) 1 2 3 >>> combined_example ( 1 , standard = 2 , kwd_only = 3 ) 1 2 3 >>> combined_example ( pos_only = 1 , standard = 2 , kwd_only = 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : combined_example() got some positional-only arguments passed as keyword arguments: 'pos_only' Finally, consider this function definition which has a potential collision between the positional argument name and **kwds which has name as a key: def foo ( name , ** kwds ): return 'name' in kwds There is no possible call that will make it return True as the keyword 'name' will always bind to the first parameter. For example: >>> foo ( 1 , ** { 'name' : 2 }) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : foo() got multiple values for argument 'name' >>> But using / (positional only arguments), it is possible since it allows name as a positional argument and 'name' as a key in the keyword arguments: >>> def foo ( name , / , ** kwds ): ... return 'name' in kwds ... >>> foo ( 1 , ** { 'name' : 2 }) True In other words, the names of positional-only parameters can be used in **kwds without ambiguity. 4.9.3.5. Recap ¶ The use case will determine which parameters to use in the function definition: def f ( pos1 , pos2 , / , pos_or_kwd , * , kwd1 , kwd2 ): As guidance: Use positional-only if you want the name of the parameters to not be available to the user. This is useful when parameter names have no real meaning, if you want to enforce the order of the arguments when the function is called or if you need to take some positional parameters and arbitrary keywords. Use keyword-only when names have meaning and the function definition is more understandable by being explicit with names or you want to prevent users relying on the position of the argument being passed. For an API, use positional-only to prevent breaking API changes if the parameter’s name is modified in the future. 4.9.4. Arbitrary Argument Lists ¶ Finally, the least frequently used option is to specify that a function can be called with an arbitrary number of arguments. These arguments will be wrapped up in a tuple (see Tuples and Sequences ). Before the variable number of arguments, zero or more normal arguments may occur. def write_multiple_items ( file , separator , * args ): file . write ( separator . join ( args )) Normally, these variadic arguments will be last in the list of formal parameters, because they scoop up all remaining input arguments that are passed to the function. Any formal parameters which occur after the *args parameter are ‘keyword-only’ arguments, meaning that they can only be used as keywords rather than positional arguments. >>> def concat ( * args , sep = "/" ): ... return sep . join ( args ) ... >>> concat ( "earth" , "mars" , "venus" ) 'earth/mars/venus' >>> concat ( "earth" , "mars" , "venus" , sep = "." ) 'earth.mars.venus' 4.9.5. Unpacking Argument Lists ¶ The reverse situation occurs when the arguments are already in a list or tuple but need to be unpacked for a function call requiring separate positional arguments. For instance, the built-in range() function expects separate start and stop arguments. If they are not available separately, write the function call with the * -operator to unpack the arguments out of a list or tuple: >>> list ( range ( 3 , 6 )) # normal call with separate arguments [3, 4, 5] >>> args = [ 3 , 6 ] >>> list ( range ( * args )) # call with arguments unpacked from a list [3, 4, 5] In the same fashion, dictionaries can deliver keyword arguments with the ** -operator: >>> def parrot ( voltage , state = 'a stiff' , action = 'voom' ): ... print ( "-- This parrot wouldn't" , action , end = ' ' ) ... print ( "if you put" , voltage , "volts through it." , end = ' ' ) ... print ( "E's" , state , "!" ) ... >>> d = { "voltage" : "four million" , "state" : "bleedin' demised" , "action" : "VOOM" } >>> parrot ( ** d ) -- This parrot wouldn't VOOM if you put four million volts through it. E's bleedin' demised ! 4.9.6. Lambda Expressions ¶ Small anonymous functions can be created with the lambda keyword. This function returns the sum of its two arguments: lambda a, b: a+b . Lambda functions can be used wherever function objects are required. They are syntactically restricted to a single expression. Semantically, they are just syntactic sugar for a normal function definition. Like nested function definitions, lambda functions can reference variables from the containing scope: >>> def make_incrementor ( n ): ... return lambda x : x + n ... >>> f = make_incrementor ( 42 ) >>> f ( 0 ) 42 >>> f ( 1 ) 43 The above example uses a lambda expression to return a function. Another use is to pass a small function as an argument. For instance, list.sort() takes a sorting key function key which can be a lambda function: >>> pairs = [( 1 , 'one' ), ( 2 , 'two' ), ( 3 , 'three' ), ( 4 , 'four' )] >>> pairs . sort ( key = lambda pair : pair [ 1 ]) >>> pairs [(4, 'four'), (1, 'one'), (3, 'three'), (2, 'two')] 4.9.7. Documentation Strings ¶ Here are some conventions about the content and formatting of documentation strings. The first line should always be a short, concise summary of the object’s purpose. For brevity, it should not explicitly state the object’s name or type, since these are available by other means (except if the name happens to be a verb describing a function’s operation). This line should begin with a capital letter and end with a period. If there are more lines in the documentation string, the second line should be blank, visually separating the summary from the rest of the description. The following lines should be one or more paragraphs describing the object’s calling conventions, its side effects, etc. The Python parser strips indentation from multi-line string literals when they serve as module, class, or function docstrings. Here is an example of a multi-line docstring: >>> def my_function (): ... """Do nothing, but document it. ... ... No, really, it doesn't do anything: ... ... >>> my_function() ... >>> ... """ ... pass ... >>> print ( my_function . __doc__ ) Do nothing, but document it. No, really, it doesn't do anything: >>> my_function() >>> 4.9.8. Function Annotations ¶ Function annotations are completely optional metadata information about the types used by user-defined functions (see PEP 3107 and PEP 484 for more information). Annotations are stored in the __annotations__ attribute of the function as a dictionary and have no effect on any other part of the function. Parameter annotations are defined by a colon after the parameter name, followed by an expression evaluating to the value of the annotation. Return annotations are defined by a literal -> , followed by an expression, between the parameter list and the colon denoting the end of the def statement. The following example has a required argument, an optional argument, and the return value annotated: >>> def f ( ham : str , eggs : str = 'eggs' ) -> str : ... print ( "Annotations:" , f . __annotations__ ) ... print ( "Arguments:" , ham , eggs ) ... return ham + ' and ' + eggs ... >>> f ( 'spam' ) Annotations: {'ham': <class 'str'>, 'return': <class 'str'>, 'eggs': <class 'str'>} Arguments: spam eggs 'spam and eggs' 4.10. Intermezzo: Coding Style ¶ Now that you are about to write longer, more complex pieces of Python, it is a good time to talk about coding style . Most languages can be written (or more concise, formatted ) in different styles; some are more readable than others. Making it easy for others to read your code is always a good idea, and adopting a nice coding style helps tremendously for that. For Python, PEP 8 has emerged as the style guide that most projects adhere to; it promotes a very readable and eye-pleasing coding style. Every Python developer should read it at some point; here are the most important points extracted for you: Use 4-space indentation, and no tabs. 4 spaces are a good compromise between small indentation (allows greater nesting depth) and large indentation (easier to read). Tabs introduce confusion, and are best left out. Wrap lines so that they don’t exceed 79 characters. This helps users with small displays and makes it possible to have several code files side-by-side on larger displays. Use blank lines to separate functions and classes, and larger blocks of code inside functions. When possible, put comments on a line of their own. Use docstrings. Use spaces around operators and after commas, but not directly inside bracketing constructs: a = f(1, 2) + g(3, 4) . Name your classes and functions consistently; the convention is to use UpperCamelCase for classes and lowercase_with_underscores for functions and methods. Always use self as the name for the first method argument (see A First Look at Classes for more on classes and methods). Don’t use fancy encodings if your code is meant to be used in international environments. Python’s default, UTF-8, or even plain ASCII work best in any case. Likewise, don’t use non-ASCII characters in identifiers if there is only the slightest chance people speaking a different language will read or maintain the code. Footnotes [ 1 ] Actually, call by object reference would be a better description, since if a mutable object is passed, the caller will see any changes the callee makes to it (items inserted into a list). Table of Contents 4. More Control Flow Tools 4.1. if Statements 4.2. for Statements 4.3. The range() Function 4.4. break and continue Statements 4.5. else Clauses on Loops 4.6. pass Statements 4.7. match Statements 4.8. Defining Functions 4.9. More on Defining Functions 4.9.1. Default Argument Values 4.9.2. Keyword Arguments 4.9.3. Special parameters 4.9.3.1. Positional-or-Keyword Arguments 4.9.3.2. Positional-Only Parameters 4.9.3.3. Keyword-Only Arguments 4.9.3.4. Function Examples 4.9.3.5. Recap 4.9.4. Arbitrary Argument Lists 4.9.5. Unpacking Argument Lists 4.9.6. Lambda Expressions 4.9.7. Documentation Strings 4.9.8. Function Annotations 4.10. Intermezzo: Coding Style Previous topic 3. An Informal Introduction to Python Next topic 5. Data Structures This page Report a bug Show source « Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 4. More Control Flow Tools | Theme Auto Light Dark | © Copyright 2001 Python Software Foundation. This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. See History and License for more information. The Python Software Foundation is a non-profit corporation. Please donate. Last updated on Jan 13, 2026 (06:19 UTC). Found a bug ? Created using Sphinx 8.2.3. | 2026-01-13T08:48:44 |
https://docs.python.org/3/tutorial/controlflow.html#unpacking-argument-lists | 4. More Control Flow Tools — Python 3.14.2 documentation Theme Auto Light Dark Table of Contents 4. More Control Flow Tools 4.1. if Statements 4.2. for Statements 4.3. The range() Function 4.4. break and continue Statements 4.5. else Clauses on Loops 4.6. pass Statements 4.7. match Statements 4.8. Defining Functions 4.9. More on Defining Functions 4.9.1. Default Argument Values 4.9.2. Keyword Arguments 4.9.3. Special parameters 4.9.3.1. Positional-or-Keyword Arguments 4.9.3.2. Positional-Only Parameters 4.9.3.3. Keyword-Only Arguments 4.9.3.4. Function Examples 4.9.3.5. Recap 4.9.4. Arbitrary Argument Lists 4.9.5. Unpacking Argument Lists 4.9.6. Lambda Expressions 4.9.7. Documentation Strings 4.9.8. Function Annotations 4.10. Intermezzo: Coding Style Previous topic 3. An Informal Introduction to Python Next topic 5. Data Structures This page Report a bug Show source Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 4. More Control Flow Tools | Theme Auto Light Dark | 4. More Control Flow Tools ¶ As well as the while statement just introduced, Python uses a few more that we will encounter in this chapter. 4.1. if Statements ¶ Perhaps the most well-known statement type is the if statement. For example: >>> x = int ( input ( "Please enter an integer: " )) Please enter an integer: 42 >>> if x < 0 : ... x = 0 ... print ( 'Negative changed to zero' ) ... elif x == 0 : ... print ( 'Zero' ) ... elif x == 1 : ... print ( 'Single' ) ... else : ... print ( 'More' ) ... More There can be zero or more elif parts, and the else part is optional. The keyword ‘ elif ’ is short for ‘else if’, and is useful to avoid excessive indentation. An if … elif … elif … sequence is a substitute for the switch or case statements found in other languages. If you’re comparing the same value to several constants, or checking for specific types or attributes, you may also find the match statement useful. For more details see match Statements . 4.2. for Statements ¶ The for statement in Python differs a bit from what you may be used to in C or Pascal. Rather than always iterating over an arithmetic progression of numbers (like in Pascal), or giving the user the ability to define both the iteration step and halting condition (as C), Python’s for statement iterates over the items of any sequence (a list or a string), in the order that they appear in the sequence. For example (no pun intended): >>> # Measure some strings: >>> words = [ 'cat' , 'window' , 'defenestrate' ] >>> for w in words : ... print ( w , len ( w )) ... cat 3 window 6 defenestrate 12 Code that modifies a collection while iterating over that same collection can be tricky to get right. Instead, it is usually more straight-forward to loop over a copy of the collection or to create a new collection: # Create a sample collection users = { 'Hans' : 'active' , 'Éléonore' : 'inactive' , '景太郎' : 'active' } # Strategy: Iterate over a copy for user , status in users . copy () . items (): if status == 'inactive' : del users [ user ] # Strategy: Create a new collection active_users = {} for user , status in users . items (): if status == 'active' : active_users [ user ] = status 4.3. The range() Function ¶ If you do need to iterate over a sequence of numbers, the built-in function range() comes in handy. It generates arithmetic progressions: >>> for i in range ( 5 ): ... print ( i ) ... 0 1 2 3 4 The given end point is never part of the generated sequence; range(10) generates 10 values, the legal indices for items of a sequence of length 10. It is possible to let the range start at another number, or to specify a different increment (even negative; sometimes this is called the ‘step’): >>> list ( range ( 5 , 10 )) [5, 6, 7, 8, 9] >>> list ( range ( 0 , 10 , 3 )) [0, 3, 6, 9] >>> list ( range ( - 10 , - 100 , - 30 )) [-10, -40, -70] To iterate over the indices of a sequence, you can combine range() and len() as follows: >>> a = [ 'Mary' , 'had' , 'a' , 'little' , 'lamb' ] >>> for i in range ( len ( a )): ... print ( i , a [ i ]) ... 0 Mary 1 had 2 a 3 little 4 lamb In most such cases, however, it is convenient to use the enumerate() function, see Looping Techniques . A strange thing happens if you just print a range: >>> range ( 10 ) range(0, 10) In many ways the object returned by range() behaves as if it is a list, but in fact it isn’t. It is an object which returns the successive items of the desired sequence when you iterate over it, but it doesn’t really make the list, thus saving space. We say such an object is iterable , that is, suitable as a target for functions and constructs that expect something from which they can obtain successive items until the supply is exhausted. We have seen that the for statement is such a construct, while an example of a function that takes an iterable is sum() : >>> sum ( range ( 4 )) # 0 + 1 + 2 + 3 6 Later we will see more functions that return iterables and take iterables as arguments. In chapter Data Structures , we will discuss in more detail about list() . 4.4. break and continue Statements ¶ The break statement breaks out of the innermost enclosing for or while loop: >>> for n in range ( 2 , 10 ): ... for x in range ( 2 , n ): ... if n % x == 0 : ... print ( f " { n } equals { x } * { n // x } " ) ... break ... 4 equals 2 * 2 6 equals 2 * 3 8 equals 2 * 4 9 equals 3 * 3 The continue statement continues with the next iteration of the loop: >>> for num in range ( 2 , 10 ): ... if num % 2 == 0 : ... print ( f "Found an even number { num } " ) ... continue ... print ( f "Found an odd number { num } " ) ... Found an even number 2 Found an odd number 3 Found an even number 4 Found an odd number 5 Found an even number 6 Found an odd number 7 Found an even number 8 Found an odd number 9 4.5. else Clauses on Loops ¶ In a for or while loop the break statement may be paired with an else clause. If the loop finishes without executing the break , the else clause executes. In a for loop, the else clause is executed after the loop finishes its final iteration, that is, if no break occurred. In a while loop, it’s executed after the loop’s condition becomes false. In either kind of loop, the else clause is not executed if the loop was terminated by a break . Of course, other ways of ending the loop early, such as a return or a raised exception, will also skip execution of the else clause. This is exemplified in the following for loop, which searches for prime numbers: >>> for n in range ( 2 , 10 ): ... for x in range ( 2 , n ): ... if n % x == 0 : ... print ( n , 'equals' , x , '*' , n // x ) ... break ... else : ... # loop fell through without finding a factor ... print ( n , 'is a prime number' ) ... 2 is a prime number 3 is a prime number 4 equals 2 * 2 5 is a prime number 6 equals 2 * 3 7 is a prime number 8 equals 2 * 4 9 equals 3 * 3 (Yes, this is the correct code. Look closely: the else clause belongs to the for loop, not the if statement.) One way to think of the else clause is to imagine it paired with the if inside the loop. As the loop executes, it will run a sequence like if/if/if/else. The if is inside the loop, encountered a number of times. If the condition is ever true, a break will happen. If the condition is never true, the else clause outside the loop will execute. When used with a loop, the else clause has more in common with the else clause of a try statement than it does with that of if statements: a try statement’s else clause runs when no exception occurs, and a loop’s else clause runs when no break occurs. For more on the try statement and exceptions, see Handling Exceptions . 4.6. pass Statements ¶ The pass statement does nothing. It can be used when a statement is required syntactically but the program requires no action. For example: >>> while True : ... pass # Busy-wait for keyboard interrupt (Ctrl+C) ... This is commonly used for creating minimal classes: >>> class MyEmptyClass : ... pass ... Another place pass can be used is as a place-holder for a function or conditional body when you are working on new code, allowing you to keep thinking at a more abstract level. The pass is silently ignored: >>> def initlog ( * args ): ... pass # Remember to implement this! ... For this last case, many people use the ellipsis literal ... instead of pass . This use has no special meaning to Python, and is not part of the language definition (you could use any constant expression here), but ... is used conventionally as a placeholder body as well. See The Ellipsis Object . 4.7. match Statements ¶ A match statement takes an expression and compares its value to successive patterns given as one or more case blocks. This is superficially similar to a switch statement in C, Java or JavaScript (and many other languages), but it’s more similar to pattern matching in languages like Rust or Haskell. Only the first pattern that matches gets executed and it can also extract components (sequence elements or object attributes) from the value into variables. If no case matches, none of the branches is executed. The simplest form compares a subject value against one or more literals: def http_error ( status ): match status : case 400 : return "Bad request" case 404 : return "Not found" case 418 : return "I'm a teapot" case _ : return "Something's wrong with the internet" Note the last block: the “variable name” _ acts as a wildcard and never fails to match. You can combine several literals in a single pattern using | (“or”): case 401 | 403 | 404 : return "Not allowed" Patterns can look like unpacking assignments, and can be used to bind variables: # point is an (x, y) tuple match point : case ( 0 , 0 ): print ( "Origin" ) case ( 0 , y ): print ( f "Y= { y } " ) case ( x , 0 ): print ( f "X= { x } " ) case ( x , y ): print ( f "X= { x } , Y= { y } " ) case _ : raise ValueError ( "Not a point" ) Study that one carefully! The first pattern has two literals, and can be thought of as an extension of the literal pattern shown above. But the next two patterns combine a literal and a variable, and the variable binds a value from the subject ( point ). The fourth pattern captures two values, which makes it conceptually similar to the unpacking assignment (x, y) = point . If you are using classes to structure your data you can use the class name followed by an argument list resembling a constructor, but with the ability to capture attributes into variables: class Point : def __init__ ( self , x , y ): self . x = x self . y = y def where_is ( point ): match point : case Point ( x = 0 , y = 0 ): print ( "Origin" ) case Point ( x = 0 , y = y ): print ( f "Y= { y } " ) case Point ( x = x , y = 0 ): print ( f "X= { x } " ) case Point (): print ( "Somewhere else" ) case _ : print ( "Not a point" ) You can use positional parameters with some builtin classes that provide an ordering for their attributes (e.g. dataclasses). You can also define a specific position for attributes in patterns by setting the __match_args__ special attribute in your classes. If it’s set to (“x”, “y”), the following patterns are all equivalent (and all bind the y attribute to the var variable): Point ( 1 , var ) Point ( 1 , y = var ) Point ( x = 1 , y = var ) Point ( y = var , x = 1 ) A recommended way to read patterns is to look at them as an extended form of what you would put on the left of an assignment, to understand which variables would be set to what. Only the standalone names (like var above) are assigned to by a match statement. Dotted names (like foo.bar ), attribute names (the x= and y= above) or class names (recognized by the “(…)” next to them like Point above) are never assigned to. Patterns can be arbitrarily nested. For example, if we have a short list of Points, with __match_args__ added, we could match it like this: class Point : __match_args__ = ( 'x' , 'y' ) def __init__ ( self , x , y ): self . x = x self . y = y match points : case []: print ( "No points" ) case [ Point ( 0 , 0 )]: print ( "The origin" ) case [ Point ( x , y )]: print ( f "Single point { x } , { y } " ) case [ Point ( 0 , y1 ), Point ( 0 , y2 )]: print ( f "Two on the Y axis at { y1 } , { y2 } " ) case _ : print ( "Something else" ) We can add an if clause to a pattern, known as a “guard”. If the guard is false, match goes on to try the next case block. Note that value capture happens before the guard is evaluated: match point : case Point ( x , y ) if x == y : print ( f "Y=X at { x } " ) case Point ( x , y ): print ( f "Not on the diagonal" ) Several other key features of this statement: Like unpacking assignments, tuple and list patterns have exactly the same meaning and actually match arbitrary sequences. An important exception is that they don’t match iterators or strings. Sequence patterns support extended unpacking: [x, y, *rest] and (x, y, *rest) work similar to unpacking assignments. The name after * may also be _ , so (x, y, *_) matches a sequence of at least two items without binding the remaining items. Mapping patterns: {"bandwidth": b, "latency": l} captures the "bandwidth" and "latency" values from a dictionary. Unlike sequence patterns, extra keys are ignored. An unpacking like **rest is also supported. (But **_ would be redundant, so it is not allowed.) Subpatterns may be captured using the as keyword: case ( Point ( x1 , y1 ), Point ( x2 , y2 ) as p2 ): ... will capture the second element of the input as p2 (as long as the input is a sequence of two points) Most literals are compared by equality, however the singletons True , False and None are compared by identity. Patterns may use named constants. These must be dotted names to prevent them from being interpreted as capture variable: from enum import Enum class Color ( Enum ): RED = 'red' GREEN = 'green' BLUE = 'blue' color = Color ( input ( "Enter your choice of 'red', 'blue' or 'green': " )) match color : case Color . RED : print ( "I see red!" ) case Color . GREEN : print ( "Grass is green" ) case Color . BLUE : print ( "I'm feeling the blues :(" ) For a more detailed explanation and additional examples, you can look into PEP 636 which is written in a tutorial format. 4.8. Defining Functions ¶ We can create a function that writes the Fibonacci series to an arbitrary boundary: >>> def fib ( n ): # write Fibonacci series less than n ... """Print a Fibonacci series less than n.""" ... a , b = 0 , 1 ... while a < n : ... print ( a , end = ' ' ) ... a , b = b , a + b ... print () ... >>> # Now call the function we just defined: >>> fib ( 2000 ) 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 The keyword def introduces a function definition . It must be followed by the function name and the parenthesized list of formal parameters. The statements that form the body of the function start at the next line, and must be indented. The first statement of the function body can optionally be a string literal; this string literal is the function’s documentation string, or docstring . (More about docstrings can be found in the section Documentation Strings .) There are tools which use docstrings to automatically produce online or printed documentation, or to let the user interactively browse through code; it’s good practice to include docstrings in code that you write, so make a habit of it. The execution of a function introduces a new symbol table used for the local variables of the function. More precisely, all variable assignments in a function store the value in the local symbol table; whereas variable references first look in the local symbol table, then in the local symbol tables of enclosing functions, then in the global symbol table, and finally in the table of built-in names. Thus, global variables and variables of enclosing functions cannot be directly assigned a value within a function (unless, for global variables, named in a global statement, or, for variables of enclosing functions, named in a nonlocal statement), although they may be referenced. The actual parameters (arguments) to a function call are introduced in the local symbol table of the called function when it is called; thus, arguments are passed using call by value (where the value is always an object reference , not the value of the object). [ 1 ] When a function calls another function, or calls itself recursively, a new local symbol table is created for that call. A function definition associates the function name with the function object in the current symbol table. The interpreter recognizes the object pointed to by that name as a user-defined function. Other names can also point to that same function object and can also be used to access the function: >>> fib <function fib at 10042ed0> >>> f = fib >>> f ( 100 ) 0 1 1 2 3 5 8 13 21 34 55 89 Coming from other languages, you might object that fib is not a function but a procedure since it doesn’t return a value. In fact, even functions without a return statement do return a value, albeit a rather boring one. This value is called None (it’s a built-in name). Writing the value None is normally suppressed by the interpreter if it would be the only value written. You can see it if you really want to using print() : >>> fib ( 0 ) >>> print ( fib ( 0 )) None It is simple to write a function that returns a list of the numbers of the Fibonacci series, instead of printing it: >>> def fib2 ( n ): # return Fibonacci series up to n ... """Return a list containing the Fibonacci series up to n.""" ... result = [] ... a , b = 0 , 1 ... while a < n : ... result . append ( a ) # see below ... a , b = b , a + b ... return result ... >>> f100 = fib2 ( 100 ) # call it >>> f100 # write the result [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] 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 . The statement result.append(a) calls a method of the list object result . A method is a function that ‘belongs’ to an object and is named obj.methodname , where obj is some object (this may be an expression), and methodname is the name of a method that is defined by the object’s type. Different types define different methods. Methods of different types may have the same name without causing ambiguity. (It is possible to define your own object types and methods, using classes , see Classes ) The method append() shown in the example is defined for list objects; it adds a new element at the end of the list. In this example it is equivalent to result = result + [a] , but more efficient. 4.9. More on Defining Functions ¶ It is also possible to define functions with a variable number of arguments. There are three forms, which can be combined. 4.9.1. Default Argument Values ¶ The most useful form is to specify a default value for one or more arguments. This creates a function that can be called with fewer arguments than it is defined to allow. For example: def ask_ok ( prompt , retries = 4 , reminder = 'Please try again!' ): while True : reply = input ( prompt ) if reply in { 'y' , 'ye' , 'yes' }: return True if reply in { 'n' , 'no' , 'nop' , 'nope' }: return False retries = retries - 1 if retries < 0 : raise ValueError ( 'invalid user response' ) print ( reminder ) This function can be called in several ways: giving only the mandatory argument: ask_ok('Do you really want to quit?') giving one of the optional arguments: ask_ok('OK to overwrite the file?', 2) or even giving all arguments: ask_ok('OK to overwrite the file?', 2, 'Come on, only yes or no!') This example also introduces the in keyword. This tests whether or not a sequence contains a certain value. The default values are evaluated at the point of function definition in the defining scope, so that i = 5 def f ( arg = i ): print ( arg ) i = 6 f () will print 5 . Important warning: The default value is evaluated only once. This makes a difference when the default is a mutable object such as a list, dictionary, or instances of most classes. For example, the following function accumulates the arguments passed to it on subsequent calls: def f ( a , L = []): L . append ( a ) return L print ( f ( 1 )) print ( f ( 2 )) print ( f ( 3 )) This will print [ 1 ] [ 1 , 2 ] [ 1 , 2 , 3 ] If you don’t want the default to be shared between subsequent calls, you can write the function like this instead: def f ( a , L = None ): if L is None : L = [] L . append ( a ) return L 4.9.2. Keyword Arguments ¶ Functions can also be called using keyword arguments of the form kwarg=value . For instance, the following function: def parrot ( voltage , state = 'a stiff' , action = 'voom' , type = 'Norwegian Blue' ): print ( "-- This parrot wouldn't" , action , end = ' ' ) print ( "if you put" , voltage , "volts through it." ) print ( "-- Lovely plumage, the" , type ) print ( "-- It's" , state , "!" ) accepts one required argument ( voltage ) and three optional arguments ( state , action , and type ). This function can be called in any of the following ways: parrot ( 1000 ) # 1 positional argument parrot ( voltage = 1000 ) # 1 keyword argument parrot ( voltage = 1000000 , action = 'VOOOOOM' ) # 2 keyword arguments parrot ( action = 'VOOOOOM' , voltage = 1000000 ) # 2 keyword arguments parrot ( 'a million' , 'bereft of life' , 'jump' ) # 3 positional arguments parrot ( 'a thousand' , state = 'pushing up the daisies' ) # 1 positional, 1 keyword but all the following calls would be invalid: parrot () # required argument missing parrot ( voltage = 5.0 , 'dead' ) # non-keyword argument after a keyword argument parrot ( 110 , voltage = 220 ) # duplicate value for the same argument parrot ( actor = 'John Cleese' ) # unknown keyword argument In a function call, keyword arguments must follow positional arguments. All the keyword arguments passed must match one of the arguments accepted by the function (e.g. actor is not a valid argument for the parrot function), and their order is not important. This also includes non-optional arguments (e.g. parrot(voltage=1000) is valid too). No argument may receive a value more than once. Here’s an example that fails due to this restriction: >>> def function ( a ): ... pass ... >>> function ( 0 , a = 0 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : function() got multiple values for argument 'a' When a final formal parameter of the form **name is present, it receives a dictionary (see Mapping Types — dict ) containing all keyword arguments except for those corresponding to a formal parameter. This may be combined with a formal parameter of the form *name (described in the next subsection) which receives a tuple containing the positional arguments beyond the formal parameter list. ( *name must occur before **name .) For example, if we define a function like this: def cheeseshop ( kind , * arguments , ** keywords ): print ( "-- Do you have any" , kind , "?" ) print ( "-- I'm sorry, we're all out of" , kind ) for arg in arguments : print ( arg ) print ( "-" * 40 ) for kw in keywords : print ( kw , ":" , keywords [ kw ]) It could be called like this: cheeseshop ( "Limburger" , "It's very runny, sir." , "It's really very, VERY runny, sir." , shopkeeper = "Michael Palin" , client = "John Cleese" , sketch = "Cheese Shop Sketch" ) and of course it would print: -- Do you have any Limburger ? -- I'm sorry, we're all out of Limburger It's very runny, sir. It's really very, VERY runny, sir. ---------------------------------------- shopkeeper : Michael Palin client : John Cleese sketch : Cheese Shop Sketch Note that the order in which the keyword arguments are printed is guaranteed to match the order in which they were provided in the function call. 4.9.3. Special parameters ¶ By default, arguments may be passed to a Python function either by position or explicitly by keyword. For readability and performance, it makes sense to restrict the way arguments can be passed so that a developer need only look at the function definition to determine if items are passed by position, by position or keyword, or by keyword. A function definition may look like: def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2): ----------- ---------- ---------- | | | | Positional or keyword | | - Keyword only -- Positional only where / and * are optional. If used, these symbols indicate the kind of parameter by how the arguments may be passed to the function: positional-only, positional-or-keyword, and keyword-only. Keyword parameters are also referred to as named parameters. 4.9.3.1. Positional-or-Keyword Arguments ¶ If / and * are not present in the function definition, arguments may be passed to a function by position or by keyword. 4.9.3.2. Positional-Only Parameters ¶ Looking at this in a bit more detail, it is possible to mark certain parameters as positional-only . If positional-only , the parameters’ order matters, and the parameters cannot be passed by keyword. Positional-only parameters are placed before a / (forward-slash). The / is used to logically separate the positional-only parameters from the rest of the parameters. If there is no / in the function definition, there are no positional-only parameters. Parameters following the / may be positional-or-keyword or keyword-only . 4.9.3.3. Keyword-Only Arguments ¶ To mark parameters as keyword-only , indicating the parameters must be passed by keyword argument, place an * in the arguments list just before the first keyword-only parameter. 4.9.3.4. Function Examples ¶ Consider the following example function definitions paying close attention to the markers / and * : >>> def standard_arg ( arg ): ... print ( arg ) ... >>> def pos_only_arg ( arg , / ): ... print ( arg ) ... >>> def kwd_only_arg ( * , arg ): ... print ( arg ) ... >>> def combined_example ( pos_only , / , standard , * , kwd_only ): ... print ( pos_only , standard , kwd_only ) The first function definition, standard_arg , the most familiar form, places no restrictions on the calling convention and arguments may be passed by position or keyword: >>> standard_arg ( 2 ) 2 >>> standard_arg ( arg = 2 ) 2 The second function pos_only_arg is restricted to only use positional parameters as there is a / in the function definition: >>> pos_only_arg ( 1 ) 1 >>> pos_only_arg ( arg = 1 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : pos_only_arg() got some positional-only arguments passed as keyword arguments: 'arg' The third function kwd_only_arg only allows keyword arguments as indicated by a * in the function definition: >>> kwd_only_arg ( 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : kwd_only_arg() takes 0 positional arguments but 1 was given >>> kwd_only_arg ( arg = 3 ) 3 And the last uses all three calling conventions in the same function definition: >>> combined_example ( 1 , 2 , 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : combined_example() takes 2 positional arguments but 3 were given >>> combined_example ( 1 , 2 , kwd_only = 3 ) 1 2 3 >>> combined_example ( 1 , standard = 2 , kwd_only = 3 ) 1 2 3 >>> combined_example ( pos_only = 1 , standard = 2 , kwd_only = 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : combined_example() got some positional-only arguments passed as keyword arguments: 'pos_only' Finally, consider this function definition which has a potential collision between the positional argument name and **kwds which has name as a key: def foo ( name , ** kwds ): return 'name' in kwds There is no possible call that will make it return True as the keyword 'name' will always bind to the first parameter. For example: >>> foo ( 1 , ** { 'name' : 2 }) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : foo() got multiple values for argument 'name' >>> But using / (positional only arguments), it is possible since it allows name as a positional argument and 'name' as a key in the keyword arguments: >>> def foo ( name , / , ** kwds ): ... return 'name' in kwds ... >>> foo ( 1 , ** { 'name' : 2 }) True In other words, the names of positional-only parameters can be used in **kwds without ambiguity. 4.9.3.5. Recap ¶ The use case will determine which parameters to use in the function definition: def f ( pos1 , pos2 , / , pos_or_kwd , * , kwd1 , kwd2 ): As guidance: Use positional-only if you want the name of the parameters to not be available to the user. This is useful when parameter names have no real meaning, if you want to enforce the order of the arguments when the function is called or if you need to take some positional parameters and arbitrary keywords. Use keyword-only when names have meaning and the function definition is more understandable by being explicit with names or you want to prevent users relying on the position of the argument being passed. For an API, use positional-only to prevent breaking API changes if the parameter’s name is modified in the future. 4.9.4. Arbitrary Argument Lists ¶ Finally, the least frequently used option is to specify that a function can be called with an arbitrary number of arguments. These arguments will be wrapped up in a tuple (see Tuples and Sequences ). Before the variable number of arguments, zero or more normal arguments may occur. def write_multiple_items ( file , separator , * args ): file . write ( separator . join ( args )) Normally, these variadic arguments will be last in the list of formal parameters, because they scoop up all remaining input arguments that are passed to the function. Any formal parameters which occur after the *args parameter are ‘keyword-only’ arguments, meaning that they can only be used as keywords rather than positional arguments. >>> def concat ( * args , sep = "/" ): ... return sep . join ( args ) ... >>> concat ( "earth" , "mars" , "venus" ) 'earth/mars/venus' >>> concat ( "earth" , "mars" , "venus" , sep = "." ) 'earth.mars.venus' 4.9.5. Unpacking Argument Lists ¶ The reverse situation occurs when the arguments are already in a list or tuple but need to be unpacked for a function call requiring separate positional arguments. For instance, the built-in range() function expects separate start and stop arguments. If they are not available separately, write the function call with the * -operator to unpack the arguments out of a list or tuple: >>> list ( range ( 3 , 6 )) # normal call with separate arguments [3, 4, 5] >>> args = [ 3 , 6 ] >>> list ( range ( * args )) # call with arguments unpacked from a list [3, 4, 5] In the same fashion, dictionaries can deliver keyword arguments with the ** -operator: >>> def parrot ( voltage , state = 'a stiff' , action = 'voom' ): ... print ( "-- This parrot wouldn't" , action , end = ' ' ) ... print ( "if you put" , voltage , "volts through it." , end = ' ' ) ... print ( "E's" , state , "!" ) ... >>> d = { "voltage" : "four million" , "state" : "bleedin' demised" , "action" : "VOOM" } >>> parrot ( ** d ) -- This parrot wouldn't VOOM if you put four million volts through it. E's bleedin' demised ! 4.9.6. Lambda Expressions ¶ Small anonymous functions can be created with the lambda keyword. This function returns the sum of its two arguments: lambda a, b: a+b . Lambda functions can be used wherever function objects are required. They are syntactically restricted to a single expression. Semantically, they are just syntactic sugar for a normal function definition. Like nested function definitions, lambda functions can reference variables from the containing scope: >>> def make_incrementor ( n ): ... return lambda x : x + n ... >>> f = make_incrementor ( 42 ) >>> f ( 0 ) 42 >>> f ( 1 ) 43 The above example uses a lambda expression to return a function. Another use is to pass a small function as an argument. For instance, list.sort() takes a sorting key function key which can be a lambda function: >>> pairs = [( 1 , 'one' ), ( 2 , 'two' ), ( 3 , 'three' ), ( 4 , 'four' )] >>> pairs . sort ( key = lambda pair : pair [ 1 ]) >>> pairs [(4, 'four'), (1, 'one'), (3, 'three'), (2, 'two')] 4.9.7. Documentation Strings ¶ Here are some conventions about the content and formatting of documentation strings. The first line should always be a short, concise summary of the object’s purpose. For brevity, it should not explicitly state the object’s name or type, since these are available by other means (except if the name happens to be a verb describing a function’s operation). This line should begin with a capital letter and end with a period. If there are more lines in the documentation string, the second line should be blank, visually separating the summary from the rest of the description. The following lines should be one or more paragraphs describing the object’s calling conventions, its side effects, etc. The Python parser strips indentation from multi-line string literals when they serve as module, class, or function docstrings. Here is an example of a multi-line docstring: >>> def my_function (): ... """Do nothing, but document it. ... ... No, really, it doesn't do anything: ... ... >>> my_function() ... >>> ... """ ... pass ... >>> print ( my_function . __doc__ ) Do nothing, but document it. No, really, it doesn't do anything: >>> my_function() >>> 4.9.8. Function Annotations ¶ Function annotations are completely optional metadata information about the types used by user-defined functions (see PEP 3107 and PEP 484 for more information). Annotations are stored in the __annotations__ attribute of the function as a dictionary and have no effect on any other part of the function. Parameter annotations are defined by a colon after the parameter name, followed by an expression evaluating to the value of the annotation. Return annotations are defined by a literal -> , followed by an expression, between the parameter list and the colon denoting the end of the def statement. The following example has a required argument, an optional argument, and the return value annotated: >>> def f ( ham : str , eggs : str = 'eggs' ) -> str : ... print ( "Annotations:" , f . __annotations__ ) ... print ( "Arguments:" , ham , eggs ) ... return ham + ' and ' + eggs ... >>> f ( 'spam' ) Annotations: {'ham': <class 'str'>, 'return': <class 'str'>, 'eggs': <class 'str'>} Arguments: spam eggs 'spam and eggs' 4.10. Intermezzo: Coding Style ¶ Now that you are about to write longer, more complex pieces of Python, it is a good time to talk about coding style . Most languages can be written (or more concise, formatted ) in different styles; some are more readable than others. Making it easy for others to read your code is always a good idea, and adopting a nice coding style helps tremendously for that. For Python, PEP 8 has emerged as the style guide that most projects adhere to; it promotes a very readable and eye-pleasing coding style. Every Python developer should read it at some point; here are the most important points extracted for you: Use 4-space indentation, and no tabs. 4 spaces are a good compromise between small indentation (allows greater nesting depth) and large indentation (easier to read). Tabs introduce confusion, and are best left out. Wrap lines so that they don’t exceed 79 characters. This helps users with small displays and makes it possible to have several code files side-by-side on larger displays. Use blank lines to separate functions and classes, and larger blocks of code inside functions. When possible, put comments on a line of their own. Use docstrings. Use spaces around operators and after commas, but not directly inside bracketing constructs: a = f(1, 2) + g(3, 4) . Name your classes and functions consistently; the convention is to use UpperCamelCase for classes and lowercase_with_underscores for functions and methods. Always use self as the name for the first method argument (see A First Look at Classes for more on classes and methods). Don’t use fancy encodings if your code is meant to be used in international environments. Python’s default, UTF-8, or even plain ASCII work best in any case. Likewise, don’t use non-ASCII characters in identifiers if there is only the slightest chance people speaking a different language will read or maintain the code. Footnotes [ 1 ] Actually, call by object reference would be a better description, since if a mutable object is passed, the caller will see any changes the callee makes to it (items inserted into a list). Table of Contents 4. More Control Flow Tools 4.1. if Statements 4.2. for Statements 4.3. The range() Function 4.4. break and continue Statements 4.5. else Clauses on Loops 4.6. pass Statements 4.7. match Statements 4.8. Defining Functions 4.9. More on Defining Functions 4.9.1. Default Argument Values 4.9.2. Keyword Arguments 4.9.3. Special parameters 4.9.3.1. Positional-or-Keyword Arguments 4.9.3.2. Positional-Only Parameters 4.9.3.3. Keyword-Only Arguments 4.9.3.4. Function Examples 4.9.3.5. Recap 4.9.4. Arbitrary Argument Lists 4.9.5. Unpacking Argument Lists 4.9.6. Lambda Expressions 4.9.7. Documentation Strings 4.9.8. Function Annotations 4.10. Intermezzo: Coding Style Previous topic 3. An Informal Introduction to Python Next topic 5. Data Structures This page Report a bug Show source « Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 4. More Control Flow Tools | Theme Auto Light Dark | © Copyright 2001 Python Software Foundation. This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. See History and License for more information. The Python Software Foundation is a non-profit corporation. Please donate. Last updated on Jan 13, 2026 (06:19 UTC). Found a bug ? Created using Sphinx 8.2.3. | 2026-01-13T08:48:44 |
https://docs.python.org/3/tutorial/controlflow.html#arbitrary-argument-lists | 4. More Control Flow Tools — Python 3.14.2 documentation Theme Auto Light Dark Table of Contents 4. More Control Flow Tools 4.1. if Statements 4.2. for Statements 4.3. The range() Function 4.4. break and continue Statements 4.5. else Clauses on Loops 4.6. pass Statements 4.7. match Statements 4.8. Defining Functions 4.9. More on Defining Functions 4.9.1. Default Argument Values 4.9.2. Keyword Arguments 4.9.3. Special parameters 4.9.3.1. Positional-or-Keyword Arguments 4.9.3.2. Positional-Only Parameters 4.9.3.3. Keyword-Only Arguments 4.9.3.4. Function Examples 4.9.3.5. Recap 4.9.4. Arbitrary Argument Lists 4.9.5. Unpacking Argument Lists 4.9.6. Lambda Expressions 4.9.7. Documentation Strings 4.9.8. Function Annotations 4.10. Intermezzo: Coding Style Previous topic 3. An Informal Introduction to Python Next topic 5. Data Structures This page Report a bug Show source Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 4. More Control Flow Tools | Theme Auto Light Dark | 4. More Control Flow Tools ¶ As well as the while statement just introduced, Python uses a few more that we will encounter in this chapter. 4.1. if Statements ¶ Perhaps the most well-known statement type is the if statement. For example: >>> x = int ( input ( "Please enter an integer: " )) Please enter an integer: 42 >>> if x < 0 : ... x = 0 ... print ( 'Negative changed to zero' ) ... elif x == 0 : ... print ( 'Zero' ) ... elif x == 1 : ... print ( 'Single' ) ... else : ... print ( 'More' ) ... More There can be zero or more elif parts, and the else part is optional. The keyword ‘ elif ’ is short for ‘else if’, and is useful to avoid excessive indentation. An if … elif … elif … sequence is a substitute for the switch or case statements found in other languages. If you’re comparing the same value to several constants, or checking for specific types or attributes, you may also find the match statement useful. For more details see match Statements . 4.2. for Statements ¶ The for statement in Python differs a bit from what you may be used to in C or Pascal. Rather than always iterating over an arithmetic progression of numbers (like in Pascal), or giving the user the ability to define both the iteration step and halting condition (as C), Python’s for statement iterates over the items of any sequence (a list or a string), in the order that they appear in the sequence. For example (no pun intended): >>> # Measure some strings: >>> words = [ 'cat' , 'window' , 'defenestrate' ] >>> for w in words : ... print ( w , len ( w )) ... cat 3 window 6 defenestrate 12 Code that modifies a collection while iterating over that same collection can be tricky to get right. Instead, it is usually more straight-forward to loop over a copy of the collection or to create a new collection: # Create a sample collection users = { 'Hans' : 'active' , 'Éléonore' : 'inactive' , '景太郎' : 'active' } # Strategy: Iterate over a copy for user , status in users . copy () . items (): if status == 'inactive' : del users [ user ] # Strategy: Create a new collection active_users = {} for user , status in users . items (): if status == 'active' : active_users [ user ] = status 4.3. The range() Function ¶ If you do need to iterate over a sequence of numbers, the built-in function range() comes in handy. It generates arithmetic progressions: >>> for i in range ( 5 ): ... print ( i ) ... 0 1 2 3 4 The given end point is never part of the generated sequence; range(10) generates 10 values, the legal indices for items of a sequence of length 10. It is possible to let the range start at another number, or to specify a different increment (even negative; sometimes this is called the ‘step’): >>> list ( range ( 5 , 10 )) [5, 6, 7, 8, 9] >>> list ( range ( 0 , 10 , 3 )) [0, 3, 6, 9] >>> list ( range ( - 10 , - 100 , - 30 )) [-10, -40, -70] To iterate over the indices of a sequence, you can combine range() and len() as follows: >>> a = [ 'Mary' , 'had' , 'a' , 'little' , 'lamb' ] >>> for i in range ( len ( a )): ... print ( i , a [ i ]) ... 0 Mary 1 had 2 a 3 little 4 lamb In most such cases, however, it is convenient to use the enumerate() function, see Looping Techniques . A strange thing happens if you just print a range: >>> range ( 10 ) range(0, 10) In many ways the object returned by range() behaves as if it is a list, but in fact it isn’t. It is an object which returns the successive items of the desired sequence when you iterate over it, but it doesn’t really make the list, thus saving space. We say such an object is iterable , that is, suitable as a target for functions and constructs that expect something from which they can obtain successive items until the supply is exhausted. We have seen that the for statement is such a construct, while an example of a function that takes an iterable is sum() : >>> sum ( range ( 4 )) # 0 + 1 + 2 + 3 6 Later we will see more functions that return iterables and take iterables as arguments. In chapter Data Structures , we will discuss in more detail about list() . 4.4. break and continue Statements ¶ The break statement breaks out of the innermost enclosing for or while loop: >>> for n in range ( 2 , 10 ): ... for x in range ( 2 , n ): ... if n % x == 0 : ... print ( f " { n } equals { x } * { n // x } " ) ... break ... 4 equals 2 * 2 6 equals 2 * 3 8 equals 2 * 4 9 equals 3 * 3 The continue statement continues with the next iteration of the loop: >>> for num in range ( 2 , 10 ): ... if num % 2 == 0 : ... print ( f "Found an even number { num } " ) ... continue ... print ( f "Found an odd number { num } " ) ... Found an even number 2 Found an odd number 3 Found an even number 4 Found an odd number 5 Found an even number 6 Found an odd number 7 Found an even number 8 Found an odd number 9 4.5. else Clauses on Loops ¶ In a for or while loop the break statement may be paired with an else clause. If the loop finishes without executing the break , the else clause executes. In a for loop, the else clause is executed after the loop finishes its final iteration, that is, if no break occurred. In a while loop, it’s executed after the loop’s condition becomes false. In either kind of loop, the else clause is not executed if the loop was terminated by a break . Of course, other ways of ending the loop early, such as a return or a raised exception, will also skip execution of the else clause. This is exemplified in the following for loop, which searches for prime numbers: >>> for n in range ( 2 , 10 ): ... for x in range ( 2 , n ): ... if n % x == 0 : ... print ( n , 'equals' , x , '*' , n // x ) ... break ... else : ... # loop fell through without finding a factor ... print ( n , 'is a prime number' ) ... 2 is a prime number 3 is a prime number 4 equals 2 * 2 5 is a prime number 6 equals 2 * 3 7 is a prime number 8 equals 2 * 4 9 equals 3 * 3 (Yes, this is the correct code. Look closely: the else clause belongs to the for loop, not the if statement.) One way to think of the else clause is to imagine it paired with the if inside the loop. As the loop executes, it will run a sequence like if/if/if/else. The if is inside the loop, encountered a number of times. If the condition is ever true, a break will happen. If the condition is never true, the else clause outside the loop will execute. When used with a loop, the else clause has more in common with the else clause of a try statement than it does with that of if statements: a try statement’s else clause runs when no exception occurs, and a loop’s else clause runs when no break occurs. For more on the try statement and exceptions, see Handling Exceptions . 4.6. pass Statements ¶ The pass statement does nothing. It can be used when a statement is required syntactically but the program requires no action. For example: >>> while True : ... pass # Busy-wait for keyboard interrupt (Ctrl+C) ... This is commonly used for creating minimal classes: >>> class MyEmptyClass : ... pass ... Another place pass can be used is as a place-holder for a function or conditional body when you are working on new code, allowing you to keep thinking at a more abstract level. The pass is silently ignored: >>> def initlog ( * args ): ... pass # Remember to implement this! ... For this last case, many people use the ellipsis literal ... instead of pass . This use has no special meaning to Python, and is not part of the language definition (you could use any constant expression here), but ... is used conventionally as a placeholder body as well. See The Ellipsis Object . 4.7. match Statements ¶ A match statement takes an expression and compares its value to successive patterns given as one or more case blocks. This is superficially similar to a switch statement in C, Java or JavaScript (and many other languages), but it’s more similar to pattern matching in languages like Rust or Haskell. Only the first pattern that matches gets executed and it can also extract components (sequence elements or object attributes) from the value into variables. If no case matches, none of the branches is executed. The simplest form compares a subject value against one or more literals: def http_error ( status ): match status : case 400 : return "Bad request" case 404 : return "Not found" case 418 : return "I'm a teapot" case _ : return "Something's wrong with the internet" Note the last block: the “variable name” _ acts as a wildcard and never fails to match. You can combine several literals in a single pattern using | (“or”): case 401 | 403 | 404 : return "Not allowed" Patterns can look like unpacking assignments, and can be used to bind variables: # point is an (x, y) tuple match point : case ( 0 , 0 ): print ( "Origin" ) case ( 0 , y ): print ( f "Y= { y } " ) case ( x , 0 ): print ( f "X= { x } " ) case ( x , y ): print ( f "X= { x } , Y= { y } " ) case _ : raise ValueError ( "Not a point" ) Study that one carefully! The first pattern has two literals, and can be thought of as an extension of the literal pattern shown above. But the next two patterns combine a literal and a variable, and the variable binds a value from the subject ( point ). The fourth pattern captures two values, which makes it conceptually similar to the unpacking assignment (x, y) = point . If you are using classes to structure your data you can use the class name followed by an argument list resembling a constructor, but with the ability to capture attributes into variables: class Point : def __init__ ( self , x , y ): self . x = x self . y = y def where_is ( point ): match point : case Point ( x = 0 , y = 0 ): print ( "Origin" ) case Point ( x = 0 , y = y ): print ( f "Y= { y } " ) case Point ( x = x , y = 0 ): print ( f "X= { x } " ) case Point (): print ( "Somewhere else" ) case _ : print ( "Not a point" ) You can use positional parameters with some builtin classes that provide an ordering for their attributes (e.g. dataclasses). You can also define a specific position for attributes in patterns by setting the __match_args__ special attribute in your classes. If it’s set to (“x”, “y”), the following patterns are all equivalent (and all bind the y attribute to the var variable): Point ( 1 , var ) Point ( 1 , y = var ) Point ( x = 1 , y = var ) Point ( y = var , x = 1 ) A recommended way to read patterns is to look at them as an extended form of what you would put on the left of an assignment, to understand which variables would be set to what. Only the standalone names (like var above) are assigned to by a match statement. Dotted names (like foo.bar ), attribute names (the x= and y= above) or class names (recognized by the “(…)” next to them like Point above) are never assigned to. Patterns can be arbitrarily nested. For example, if we have a short list of Points, with __match_args__ added, we could match it like this: class Point : __match_args__ = ( 'x' , 'y' ) def __init__ ( self , x , y ): self . x = x self . y = y match points : case []: print ( "No points" ) case [ Point ( 0 , 0 )]: print ( "The origin" ) case [ Point ( x , y )]: print ( f "Single point { x } , { y } " ) case [ Point ( 0 , y1 ), Point ( 0 , y2 )]: print ( f "Two on the Y axis at { y1 } , { y2 } " ) case _ : print ( "Something else" ) We can add an if clause to a pattern, known as a “guard”. If the guard is false, match goes on to try the next case block. Note that value capture happens before the guard is evaluated: match point : case Point ( x , y ) if x == y : print ( f "Y=X at { x } " ) case Point ( x , y ): print ( f "Not on the diagonal" ) Several other key features of this statement: Like unpacking assignments, tuple and list patterns have exactly the same meaning and actually match arbitrary sequences. An important exception is that they don’t match iterators or strings. Sequence patterns support extended unpacking: [x, y, *rest] and (x, y, *rest) work similar to unpacking assignments. The name after * may also be _ , so (x, y, *_) matches a sequence of at least two items without binding the remaining items. Mapping patterns: {"bandwidth": b, "latency": l} captures the "bandwidth" and "latency" values from a dictionary. Unlike sequence patterns, extra keys are ignored. An unpacking like **rest is also supported. (But **_ would be redundant, so it is not allowed.) Subpatterns may be captured using the as keyword: case ( Point ( x1 , y1 ), Point ( x2 , y2 ) as p2 ): ... will capture the second element of the input as p2 (as long as the input is a sequence of two points) Most literals are compared by equality, however the singletons True , False and None are compared by identity. Patterns may use named constants. These must be dotted names to prevent them from being interpreted as capture variable: from enum import Enum class Color ( Enum ): RED = 'red' GREEN = 'green' BLUE = 'blue' color = Color ( input ( "Enter your choice of 'red', 'blue' or 'green': " )) match color : case Color . RED : print ( "I see red!" ) case Color . GREEN : print ( "Grass is green" ) case Color . BLUE : print ( "I'm feeling the blues :(" ) For a more detailed explanation and additional examples, you can look into PEP 636 which is written in a tutorial format. 4.8. Defining Functions ¶ We can create a function that writes the Fibonacci series to an arbitrary boundary: >>> def fib ( n ): # write Fibonacci series less than n ... """Print a Fibonacci series less than n.""" ... a , b = 0 , 1 ... while a < n : ... print ( a , end = ' ' ) ... a , b = b , a + b ... print () ... >>> # Now call the function we just defined: >>> fib ( 2000 ) 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 The keyword def introduces a function definition . It must be followed by the function name and the parenthesized list of formal parameters. The statements that form the body of the function start at the next line, and must be indented. The first statement of the function body can optionally be a string literal; this string literal is the function’s documentation string, or docstring . (More about docstrings can be found in the section Documentation Strings .) There are tools which use docstrings to automatically produce online or printed documentation, or to let the user interactively browse through code; it’s good practice to include docstrings in code that you write, so make a habit of it. The execution of a function introduces a new symbol table used for the local variables of the function. More precisely, all variable assignments in a function store the value in the local symbol table; whereas variable references first look in the local symbol table, then in the local symbol tables of enclosing functions, then in the global symbol table, and finally in the table of built-in names. Thus, global variables and variables of enclosing functions cannot be directly assigned a value within a function (unless, for global variables, named in a global statement, or, for variables of enclosing functions, named in a nonlocal statement), although they may be referenced. The actual parameters (arguments) to a function call are introduced in the local symbol table of the called function when it is called; thus, arguments are passed using call by value (where the value is always an object reference , not the value of the object). [ 1 ] When a function calls another function, or calls itself recursively, a new local symbol table is created for that call. A function definition associates the function name with the function object in the current symbol table. The interpreter recognizes the object pointed to by that name as a user-defined function. Other names can also point to that same function object and can also be used to access the function: >>> fib <function fib at 10042ed0> >>> f = fib >>> f ( 100 ) 0 1 1 2 3 5 8 13 21 34 55 89 Coming from other languages, you might object that fib is not a function but a procedure since it doesn’t return a value. In fact, even functions without a return statement do return a value, albeit a rather boring one. This value is called None (it’s a built-in name). Writing the value None is normally suppressed by the interpreter if it would be the only value written. You can see it if you really want to using print() : >>> fib ( 0 ) >>> print ( fib ( 0 )) None It is simple to write a function that returns a list of the numbers of the Fibonacci series, instead of printing it: >>> def fib2 ( n ): # return Fibonacci series up to n ... """Return a list containing the Fibonacci series up to n.""" ... result = [] ... a , b = 0 , 1 ... while a < n : ... result . append ( a ) # see below ... a , b = b , a + b ... return result ... >>> f100 = fib2 ( 100 ) # call it >>> f100 # write the result [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] 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 . The statement result.append(a) calls a method of the list object result . A method is a function that ‘belongs’ to an object and is named obj.methodname , where obj is some object (this may be an expression), and methodname is the name of a method that is defined by the object’s type. Different types define different methods. Methods of different types may have the same name without causing ambiguity. (It is possible to define your own object types and methods, using classes , see Classes ) The method append() shown in the example is defined for list objects; it adds a new element at the end of the list. In this example it is equivalent to result = result + [a] , but more efficient. 4.9. More on Defining Functions ¶ It is also possible to define functions with a variable number of arguments. There are three forms, which can be combined. 4.9.1. Default Argument Values ¶ The most useful form is to specify a default value for one or more arguments. This creates a function that can be called with fewer arguments than it is defined to allow. For example: def ask_ok ( prompt , retries = 4 , reminder = 'Please try again!' ): while True : reply = input ( prompt ) if reply in { 'y' , 'ye' , 'yes' }: return True if reply in { 'n' , 'no' , 'nop' , 'nope' }: return False retries = retries - 1 if retries < 0 : raise ValueError ( 'invalid user response' ) print ( reminder ) This function can be called in several ways: giving only the mandatory argument: ask_ok('Do you really want to quit?') giving one of the optional arguments: ask_ok('OK to overwrite the file?', 2) or even giving all arguments: ask_ok('OK to overwrite the file?', 2, 'Come on, only yes or no!') This example also introduces the in keyword. This tests whether or not a sequence contains a certain value. The default values are evaluated at the point of function definition in the defining scope, so that i = 5 def f ( arg = i ): print ( arg ) i = 6 f () will print 5 . Important warning: The default value is evaluated only once. This makes a difference when the default is a mutable object such as a list, dictionary, or instances of most classes. For example, the following function accumulates the arguments passed to it on subsequent calls: def f ( a , L = []): L . append ( a ) return L print ( f ( 1 )) print ( f ( 2 )) print ( f ( 3 )) This will print [ 1 ] [ 1 , 2 ] [ 1 , 2 , 3 ] If you don’t want the default to be shared between subsequent calls, you can write the function like this instead: def f ( a , L = None ): if L is None : L = [] L . append ( a ) return L 4.9.2. Keyword Arguments ¶ Functions can also be called using keyword arguments of the form kwarg=value . For instance, the following function: def parrot ( voltage , state = 'a stiff' , action = 'voom' , type = 'Norwegian Blue' ): print ( "-- This parrot wouldn't" , action , end = ' ' ) print ( "if you put" , voltage , "volts through it." ) print ( "-- Lovely plumage, the" , type ) print ( "-- It's" , state , "!" ) accepts one required argument ( voltage ) and three optional arguments ( state , action , and type ). This function can be called in any of the following ways: parrot ( 1000 ) # 1 positional argument parrot ( voltage = 1000 ) # 1 keyword argument parrot ( voltage = 1000000 , action = 'VOOOOOM' ) # 2 keyword arguments parrot ( action = 'VOOOOOM' , voltage = 1000000 ) # 2 keyword arguments parrot ( 'a million' , 'bereft of life' , 'jump' ) # 3 positional arguments parrot ( 'a thousand' , state = 'pushing up the daisies' ) # 1 positional, 1 keyword but all the following calls would be invalid: parrot () # required argument missing parrot ( voltage = 5.0 , 'dead' ) # non-keyword argument after a keyword argument parrot ( 110 , voltage = 220 ) # duplicate value for the same argument parrot ( actor = 'John Cleese' ) # unknown keyword argument In a function call, keyword arguments must follow positional arguments. All the keyword arguments passed must match one of the arguments accepted by the function (e.g. actor is not a valid argument for the parrot function), and their order is not important. This also includes non-optional arguments (e.g. parrot(voltage=1000) is valid too). No argument may receive a value more than once. Here’s an example that fails due to this restriction: >>> def function ( a ): ... pass ... >>> function ( 0 , a = 0 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : function() got multiple values for argument 'a' When a final formal parameter of the form **name is present, it receives a dictionary (see Mapping Types — dict ) containing all keyword arguments except for those corresponding to a formal parameter. This may be combined with a formal parameter of the form *name (described in the next subsection) which receives a tuple containing the positional arguments beyond the formal parameter list. ( *name must occur before **name .) For example, if we define a function like this: def cheeseshop ( kind , * arguments , ** keywords ): print ( "-- Do you have any" , kind , "?" ) print ( "-- I'm sorry, we're all out of" , kind ) for arg in arguments : print ( arg ) print ( "-" * 40 ) for kw in keywords : print ( kw , ":" , keywords [ kw ]) It could be called like this: cheeseshop ( "Limburger" , "It's very runny, sir." , "It's really very, VERY runny, sir." , shopkeeper = "Michael Palin" , client = "John Cleese" , sketch = "Cheese Shop Sketch" ) and of course it would print: -- Do you have any Limburger ? -- I'm sorry, we're all out of Limburger It's very runny, sir. It's really very, VERY runny, sir. ---------------------------------------- shopkeeper : Michael Palin client : John Cleese sketch : Cheese Shop Sketch Note that the order in which the keyword arguments are printed is guaranteed to match the order in which they were provided in the function call. 4.9.3. Special parameters ¶ By default, arguments may be passed to a Python function either by position or explicitly by keyword. For readability and performance, it makes sense to restrict the way arguments can be passed so that a developer need only look at the function definition to determine if items are passed by position, by position or keyword, or by keyword. A function definition may look like: def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2): ----------- ---------- ---------- | | | | Positional or keyword | | - Keyword only -- Positional only where / and * are optional. If used, these symbols indicate the kind of parameter by how the arguments may be passed to the function: positional-only, positional-or-keyword, and keyword-only. Keyword parameters are also referred to as named parameters. 4.9.3.1. Positional-or-Keyword Arguments ¶ If / and * are not present in the function definition, arguments may be passed to a function by position or by keyword. 4.9.3.2. Positional-Only Parameters ¶ Looking at this in a bit more detail, it is possible to mark certain parameters as positional-only . If positional-only , the parameters’ order matters, and the parameters cannot be passed by keyword. Positional-only parameters are placed before a / (forward-slash). The / is used to logically separate the positional-only parameters from the rest of the parameters. If there is no / in the function definition, there are no positional-only parameters. Parameters following the / may be positional-or-keyword or keyword-only . 4.9.3.3. Keyword-Only Arguments ¶ To mark parameters as keyword-only , indicating the parameters must be passed by keyword argument, place an * in the arguments list just before the first keyword-only parameter. 4.9.3.4. Function Examples ¶ Consider the following example function definitions paying close attention to the markers / and * : >>> def standard_arg ( arg ): ... print ( arg ) ... >>> def pos_only_arg ( arg , / ): ... print ( arg ) ... >>> def kwd_only_arg ( * , arg ): ... print ( arg ) ... >>> def combined_example ( pos_only , / , standard , * , kwd_only ): ... print ( pos_only , standard , kwd_only ) The first function definition, standard_arg , the most familiar form, places no restrictions on the calling convention and arguments may be passed by position or keyword: >>> standard_arg ( 2 ) 2 >>> standard_arg ( arg = 2 ) 2 The second function pos_only_arg is restricted to only use positional parameters as there is a / in the function definition: >>> pos_only_arg ( 1 ) 1 >>> pos_only_arg ( arg = 1 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : pos_only_arg() got some positional-only arguments passed as keyword arguments: 'arg' The third function kwd_only_arg only allows keyword arguments as indicated by a * in the function definition: >>> kwd_only_arg ( 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : kwd_only_arg() takes 0 positional arguments but 1 was given >>> kwd_only_arg ( arg = 3 ) 3 And the last uses all three calling conventions in the same function definition: >>> combined_example ( 1 , 2 , 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : combined_example() takes 2 positional arguments but 3 were given >>> combined_example ( 1 , 2 , kwd_only = 3 ) 1 2 3 >>> combined_example ( 1 , standard = 2 , kwd_only = 3 ) 1 2 3 >>> combined_example ( pos_only = 1 , standard = 2 , kwd_only = 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : combined_example() got some positional-only arguments passed as keyword arguments: 'pos_only' Finally, consider this function definition which has a potential collision between the positional argument name and **kwds which has name as a key: def foo ( name , ** kwds ): return 'name' in kwds There is no possible call that will make it return True as the keyword 'name' will always bind to the first parameter. For example: >>> foo ( 1 , ** { 'name' : 2 }) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : foo() got multiple values for argument 'name' >>> But using / (positional only arguments), it is possible since it allows name as a positional argument and 'name' as a key in the keyword arguments: >>> def foo ( name , / , ** kwds ): ... return 'name' in kwds ... >>> foo ( 1 , ** { 'name' : 2 }) True In other words, the names of positional-only parameters can be used in **kwds without ambiguity. 4.9.3.5. Recap ¶ The use case will determine which parameters to use in the function definition: def f ( pos1 , pos2 , / , pos_or_kwd , * , kwd1 , kwd2 ): As guidance: Use positional-only if you want the name of the parameters to not be available to the user. This is useful when parameter names have no real meaning, if you want to enforce the order of the arguments when the function is called or if you need to take some positional parameters and arbitrary keywords. Use keyword-only when names have meaning and the function definition is more understandable by being explicit with names or you want to prevent users relying on the position of the argument being passed. For an API, use positional-only to prevent breaking API changes if the parameter’s name is modified in the future. 4.9.4. Arbitrary Argument Lists ¶ Finally, the least frequently used option is to specify that a function can be called with an arbitrary number of arguments. These arguments will be wrapped up in a tuple (see Tuples and Sequences ). Before the variable number of arguments, zero or more normal arguments may occur. def write_multiple_items ( file , separator , * args ): file . write ( separator . join ( args )) Normally, these variadic arguments will be last in the list of formal parameters, because they scoop up all remaining input arguments that are passed to the function. Any formal parameters which occur after the *args parameter are ‘keyword-only’ arguments, meaning that they can only be used as keywords rather than positional arguments. >>> def concat ( * args , sep = "/" ): ... return sep . join ( args ) ... >>> concat ( "earth" , "mars" , "venus" ) 'earth/mars/venus' >>> concat ( "earth" , "mars" , "venus" , sep = "." ) 'earth.mars.venus' 4.9.5. Unpacking Argument Lists ¶ The reverse situation occurs when the arguments are already in a list or tuple but need to be unpacked for a function call requiring separate positional arguments. For instance, the built-in range() function expects separate start and stop arguments. If they are not available separately, write the function call with the * -operator to unpack the arguments out of a list or tuple: >>> list ( range ( 3 , 6 )) # normal call with separate arguments [3, 4, 5] >>> args = [ 3 , 6 ] >>> list ( range ( * args )) # call with arguments unpacked from a list [3, 4, 5] In the same fashion, dictionaries can deliver keyword arguments with the ** -operator: >>> def parrot ( voltage , state = 'a stiff' , action = 'voom' ): ... print ( "-- This parrot wouldn't" , action , end = ' ' ) ... print ( "if you put" , voltage , "volts through it." , end = ' ' ) ... print ( "E's" , state , "!" ) ... >>> d = { "voltage" : "four million" , "state" : "bleedin' demised" , "action" : "VOOM" } >>> parrot ( ** d ) -- This parrot wouldn't VOOM if you put four million volts through it. E's bleedin' demised ! 4.9.6. Lambda Expressions ¶ Small anonymous functions can be created with the lambda keyword. This function returns the sum of its two arguments: lambda a, b: a+b . Lambda functions can be used wherever function objects are required. They are syntactically restricted to a single expression. Semantically, they are just syntactic sugar for a normal function definition. Like nested function definitions, lambda functions can reference variables from the containing scope: >>> def make_incrementor ( n ): ... return lambda x : x + n ... >>> f = make_incrementor ( 42 ) >>> f ( 0 ) 42 >>> f ( 1 ) 43 The above example uses a lambda expression to return a function. Another use is to pass a small function as an argument. For instance, list.sort() takes a sorting key function key which can be a lambda function: >>> pairs = [( 1 , 'one' ), ( 2 , 'two' ), ( 3 , 'three' ), ( 4 , 'four' )] >>> pairs . sort ( key = lambda pair : pair [ 1 ]) >>> pairs [(4, 'four'), (1, 'one'), (3, 'three'), (2, 'two')] 4.9.7. Documentation Strings ¶ Here are some conventions about the content and formatting of documentation strings. The first line should always be a short, concise summary of the object’s purpose. For brevity, it should not explicitly state the object’s name or type, since these are available by other means (except if the name happens to be a verb describing a function’s operation). This line should begin with a capital letter and end with a period. If there are more lines in the documentation string, the second line should be blank, visually separating the summary from the rest of the description. The following lines should be one or more paragraphs describing the object’s calling conventions, its side effects, etc. The Python parser strips indentation from multi-line string literals when they serve as module, class, or function docstrings. Here is an example of a multi-line docstring: >>> def my_function (): ... """Do nothing, but document it. ... ... No, really, it doesn't do anything: ... ... >>> my_function() ... >>> ... """ ... pass ... >>> print ( my_function . __doc__ ) Do nothing, but document it. No, really, it doesn't do anything: >>> my_function() >>> 4.9.8. Function Annotations ¶ Function annotations are completely optional metadata information about the types used by user-defined functions (see PEP 3107 and PEP 484 for more information). Annotations are stored in the __annotations__ attribute of the function as a dictionary and have no effect on any other part of the function. Parameter annotations are defined by a colon after the parameter name, followed by an expression evaluating to the value of the annotation. Return annotations are defined by a literal -> , followed by an expression, between the parameter list and the colon denoting the end of the def statement. The following example has a required argument, an optional argument, and the return value annotated: >>> def f ( ham : str , eggs : str = 'eggs' ) -> str : ... print ( "Annotations:" , f . __annotations__ ) ... print ( "Arguments:" , ham , eggs ) ... return ham + ' and ' + eggs ... >>> f ( 'spam' ) Annotations: {'ham': <class 'str'>, 'return': <class 'str'>, 'eggs': <class 'str'>} Arguments: spam eggs 'spam and eggs' 4.10. Intermezzo: Coding Style ¶ Now that you are about to write longer, more complex pieces of Python, it is a good time to talk about coding style . Most languages can be written (or more concise, formatted ) in different styles; some are more readable than others. Making it easy for others to read your code is always a good idea, and adopting a nice coding style helps tremendously for that. For Python, PEP 8 has emerged as the style guide that most projects adhere to; it promotes a very readable and eye-pleasing coding style. Every Python developer should read it at some point; here are the most important points extracted for you: Use 4-space indentation, and no tabs. 4 spaces are a good compromise between small indentation (allows greater nesting depth) and large indentation (easier to read). Tabs introduce confusion, and are best left out. Wrap lines so that they don’t exceed 79 characters. This helps users with small displays and makes it possible to have several code files side-by-side on larger displays. Use blank lines to separate functions and classes, and larger blocks of code inside functions. When possible, put comments on a line of their own. Use docstrings. Use spaces around operators and after commas, but not directly inside bracketing constructs: a = f(1, 2) + g(3, 4) . Name your classes and functions consistently; the convention is to use UpperCamelCase for classes and lowercase_with_underscores for functions and methods. Always use self as the name for the first method argument (see A First Look at Classes for more on classes and methods). Don’t use fancy encodings if your code is meant to be used in international environments. Python’s default, UTF-8, or even plain ASCII work best in any case. Likewise, don’t use non-ASCII characters in identifiers if there is only the slightest chance people speaking a different language will read or maintain the code. Footnotes [ 1 ] Actually, call by object reference would be a better description, since if a mutable object is passed, the caller will see any changes the callee makes to it (items inserted into a list). Table of Contents 4. More Control Flow Tools 4.1. if Statements 4.2. for Statements 4.3. The range() Function 4.4. break and continue Statements 4.5. else Clauses on Loops 4.6. pass Statements 4.7. match Statements 4.8. Defining Functions 4.9. More on Defining Functions 4.9.1. Default Argument Values 4.9.2. Keyword Arguments 4.9.3. Special parameters 4.9.3.1. Positional-or-Keyword Arguments 4.9.3.2. Positional-Only Parameters 4.9.3.3. Keyword-Only Arguments 4.9.3.4. Function Examples 4.9.3.5. Recap 4.9.4. Arbitrary Argument Lists 4.9.5. Unpacking Argument Lists 4.9.6. Lambda Expressions 4.9.7. Documentation Strings 4.9.8. Function Annotations 4.10. Intermezzo: Coding Style Previous topic 3. An Informal Introduction to Python Next topic 5. Data Structures This page Report a bug Show source « Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 4. More Control Flow Tools | Theme Auto Light Dark | © Copyright 2001 Python Software Foundation. This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. See History and License for more information. The Python Software Foundation is a non-profit corporation. Please donate. Last updated on Jan 13, 2026 (06:19 UTC). Found a bug ? Created using Sphinx 8.2.3. | 2026-01-13T08:48:44 |
https://docs.python.org/3/tutorial/controlflow.html#intermezzo-coding-style | 4. More Control Flow Tools — Python 3.14.2 documentation Theme Auto Light Dark Table of Contents 4. More Control Flow Tools 4.1. if Statements 4.2. for Statements 4.3. The range() Function 4.4. break and continue Statements 4.5. else Clauses on Loops 4.6. pass Statements 4.7. match Statements 4.8. Defining Functions 4.9. More on Defining Functions 4.9.1. Default Argument Values 4.9.2. Keyword Arguments 4.9.3. Special parameters 4.9.3.1. Positional-or-Keyword Arguments 4.9.3.2. Positional-Only Parameters 4.9.3.3. Keyword-Only Arguments 4.9.3.4. Function Examples 4.9.3.5. Recap 4.9.4. Arbitrary Argument Lists 4.9.5. Unpacking Argument Lists 4.9.6. Lambda Expressions 4.9.7. Documentation Strings 4.9.8. Function Annotations 4.10. Intermezzo: Coding Style Previous topic 3. An Informal Introduction to Python Next topic 5. Data Structures This page Report a bug Show source Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 4. More Control Flow Tools | Theme Auto Light Dark | 4. More Control Flow Tools ¶ As well as the while statement just introduced, Python uses a few more that we will encounter in this chapter. 4.1. if Statements ¶ Perhaps the most well-known statement type is the if statement. For example: >>> x = int ( input ( "Please enter an integer: " )) Please enter an integer: 42 >>> if x < 0 : ... x = 0 ... print ( 'Negative changed to zero' ) ... elif x == 0 : ... print ( 'Zero' ) ... elif x == 1 : ... print ( 'Single' ) ... else : ... print ( 'More' ) ... More There can be zero or more elif parts, and the else part is optional. The keyword ‘ elif ’ is short for ‘else if’, and is useful to avoid excessive indentation. An if … elif … elif … sequence is a substitute for the switch or case statements found in other languages. If you’re comparing the same value to several constants, or checking for specific types or attributes, you may also find the match statement useful. For more details see match Statements . 4.2. for Statements ¶ The for statement in Python differs a bit from what you may be used to in C or Pascal. Rather than always iterating over an arithmetic progression of numbers (like in Pascal), or giving the user the ability to define both the iteration step and halting condition (as C), Python’s for statement iterates over the items of any sequence (a list or a string), in the order that they appear in the sequence. For example (no pun intended): >>> # Measure some strings: >>> words = [ 'cat' , 'window' , 'defenestrate' ] >>> for w in words : ... print ( w , len ( w )) ... cat 3 window 6 defenestrate 12 Code that modifies a collection while iterating over that same collection can be tricky to get right. Instead, it is usually more straight-forward to loop over a copy of the collection or to create a new collection: # Create a sample collection users = { 'Hans' : 'active' , 'Éléonore' : 'inactive' , '景太郎' : 'active' } # Strategy: Iterate over a copy for user , status in users . copy () . items (): if status == 'inactive' : del users [ user ] # Strategy: Create a new collection active_users = {} for user , status in users . items (): if status == 'active' : active_users [ user ] = status 4.3. The range() Function ¶ If you do need to iterate over a sequence of numbers, the built-in function range() comes in handy. It generates arithmetic progressions: >>> for i in range ( 5 ): ... print ( i ) ... 0 1 2 3 4 The given end point is never part of the generated sequence; range(10) generates 10 values, the legal indices for items of a sequence of length 10. It is possible to let the range start at another number, or to specify a different increment (even negative; sometimes this is called the ‘step’): >>> list ( range ( 5 , 10 )) [5, 6, 7, 8, 9] >>> list ( range ( 0 , 10 , 3 )) [0, 3, 6, 9] >>> list ( range ( - 10 , - 100 , - 30 )) [-10, -40, -70] To iterate over the indices of a sequence, you can combine range() and len() as follows: >>> a = [ 'Mary' , 'had' , 'a' , 'little' , 'lamb' ] >>> for i in range ( len ( a )): ... print ( i , a [ i ]) ... 0 Mary 1 had 2 a 3 little 4 lamb In most such cases, however, it is convenient to use the enumerate() function, see Looping Techniques . A strange thing happens if you just print a range: >>> range ( 10 ) range(0, 10) In many ways the object returned by range() behaves as if it is a list, but in fact it isn’t. It is an object which returns the successive items of the desired sequence when you iterate over it, but it doesn’t really make the list, thus saving space. We say such an object is iterable , that is, suitable as a target for functions and constructs that expect something from which they can obtain successive items until the supply is exhausted. We have seen that the for statement is such a construct, while an example of a function that takes an iterable is sum() : >>> sum ( range ( 4 )) # 0 + 1 + 2 + 3 6 Later we will see more functions that return iterables and take iterables as arguments. In chapter Data Structures , we will discuss in more detail about list() . 4.4. break and continue Statements ¶ The break statement breaks out of the innermost enclosing for or while loop: >>> for n in range ( 2 , 10 ): ... for x in range ( 2 , n ): ... if n % x == 0 : ... print ( f " { n } equals { x } * { n // x } " ) ... break ... 4 equals 2 * 2 6 equals 2 * 3 8 equals 2 * 4 9 equals 3 * 3 The continue statement continues with the next iteration of the loop: >>> for num in range ( 2 , 10 ): ... if num % 2 == 0 : ... print ( f "Found an even number { num } " ) ... continue ... print ( f "Found an odd number { num } " ) ... Found an even number 2 Found an odd number 3 Found an even number 4 Found an odd number 5 Found an even number 6 Found an odd number 7 Found an even number 8 Found an odd number 9 4.5. else Clauses on Loops ¶ In a for or while loop the break statement may be paired with an else clause. If the loop finishes without executing the break , the else clause executes. In a for loop, the else clause is executed after the loop finishes its final iteration, that is, if no break occurred. In a while loop, it’s executed after the loop’s condition becomes false. In either kind of loop, the else clause is not executed if the loop was terminated by a break . Of course, other ways of ending the loop early, such as a return or a raised exception, will also skip execution of the else clause. This is exemplified in the following for loop, which searches for prime numbers: >>> for n in range ( 2 , 10 ): ... for x in range ( 2 , n ): ... if n % x == 0 : ... print ( n , 'equals' , x , '*' , n // x ) ... break ... else : ... # loop fell through without finding a factor ... print ( n , 'is a prime number' ) ... 2 is a prime number 3 is a prime number 4 equals 2 * 2 5 is a prime number 6 equals 2 * 3 7 is a prime number 8 equals 2 * 4 9 equals 3 * 3 (Yes, this is the correct code. Look closely: the else clause belongs to the for loop, not the if statement.) One way to think of the else clause is to imagine it paired with the if inside the loop. As the loop executes, it will run a sequence like if/if/if/else. The if is inside the loop, encountered a number of times. If the condition is ever true, a break will happen. If the condition is never true, the else clause outside the loop will execute. When used with a loop, the else clause has more in common with the else clause of a try statement than it does with that of if statements: a try statement’s else clause runs when no exception occurs, and a loop’s else clause runs when no break occurs. For more on the try statement and exceptions, see Handling Exceptions . 4.6. pass Statements ¶ The pass statement does nothing. It can be used when a statement is required syntactically but the program requires no action. For example: >>> while True : ... pass # Busy-wait for keyboard interrupt (Ctrl+C) ... This is commonly used for creating minimal classes: >>> class MyEmptyClass : ... pass ... Another place pass can be used is as a place-holder for a function or conditional body when you are working on new code, allowing you to keep thinking at a more abstract level. The pass is silently ignored: >>> def initlog ( * args ): ... pass # Remember to implement this! ... For this last case, many people use the ellipsis literal ... instead of pass . This use has no special meaning to Python, and is not part of the language definition (you could use any constant expression here), but ... is used conventionally as a placeholder body as well. See The Ellipsis Object . 4.7. match Statements ¶ A match statement takes an expression and compares its value to successive patterns given as one or more case blocks. This is superficially similar to a switch statement in C, Java or JavaScript (and many other languages), but it’s more similar to pattern matching in languages like Rust or Haskell. Only the first pattern that matches gets executed and it can also extract components (sequence elements or object attributes) from the value into variables. If no case matches, none of the branches is executed. The simplest form compares a subject value against one or more literals: def http_error ( status ): match status : case 400 : return "Bad request" case 404 : return "Not found" case 418 : return "I'm a teapot" case _ : return "Something's wrong with the internet" Note the last block: the “variable name” _ acts as a wildcard and never fails to match. You can combine several literals in a single pattern using | (“or”): case 401 | 403 | 404 : return "Not allowed" Patterns can look like unpacking assignments, and can be used to bind variables: # point is an (x, y) tuple match point : case ( 0 , 0 ): print ( "Origin" ) case ( 0 , y ): print ( f "Y= { y } " ) case ( x , 0 ): print ( f "X= { x } " ) case ( x , y ): print ( f "X= { x } , Y= { y } " ) case _ : raise ValueError ( "Not a point" ) Study that one carefully! The first pattern has two literals, and can be thought of as an extension of the literal pattern shown above. But the next two patterns combine a literal and a variable, and the variable binds a value from the subject ( point ). The fourth pattern captures two values, which makes it conceptually similar to the unpacking assignment (x, y) = point . If you are using classes to structure your data you can use the class name followed by an argument list resembling a constructor, but with the ability to capture attributes into variables: class Point : def __init__ ( self , x , y ): self . x = x self . y = y def where_is ( point ): match point : case Point ( x = 0 , y = 0 ): print ( "Origin" ) case Point ( x = 0 , y = y ): print ( f "Y= { y } " ) case Point ( x = x , y = 0 ): print ( f "X= { x } " ) case Point (): print ( "Somewhere else" ) case _ : print ( "Not a point" ) You can use positional parameters with some builtin classes that provide an ordering for their attributes (e.g. dataclasses). You can also define a specific position for attributes in patterns by setting the __match_args__ special attribute in your classes. If it’s set to (“x”, “y”), the following patterns are all equivalent (and all bind the y attribute to the var variable): Point ( 1 , var ) Point ( 1 , y = var ) Point ( x = 1 , y = var ) Point ( y = var , x = 1 ) A recommended way to read patterns is to look at them as an extended form of what you would put on the left of an assignment, to understand which variables would be set to what. Only the standalone names (like var above) are assigned to by a match statement. Dotted names (like foo.bar ), attribute names (the x= and y= above) or class names (recognized by the “(…)” next to them like Point above) are never assigned to. Patterns can be arbitrarily nested. For example, if we have a short list of Points, with __match_args__ added, we could match it like this: class Point : __match_args__ = ( 'x' , 'y' ) def __init__ ( self , x , y ): self . x = x self . y = y match points : case []: print ( "No points" ) case [ Point ( 0 , 0 )]: print ( "The origin" ) case [ Point ( x , y )]: print ( f "Single point { x } , { y } " ) case [ Point ( 0 , y1 ), Point ( 0 , y2 )]: print ( f "Two on the Y axis at { y1 } , { y2 } " ) case _ : print ( "Something else" ) We can add an if clause to a pattern, known as a “guard”. If the guard is false, match goes on to try the next case block. Note that value capture happens before the guard is evaluated: match point : case Point ( x , y ) if x == y : print ( f "Y=X at { x } " ) case Point ( x , y ): print ( f "Not on the diagonal" ) Several other key features of this statement: Like unpacking assignments, tuple and list patterns have exactly the same meaning and actually match arbitrary sequences. An important exception is that they don’t match iterators or strings. Sequence patterns support extended unpacking: [x, y, *rest] and (x, y, *rest) work similar to unpacking assignments. The name after * may also be _ , so (x, y, *_) matches a sequence of at least two items without binding the remaining items. Mapping patterns: {"bandwidth": b, "latency": l} captures the "bandwidth" and "latency" values from a dictionary. Unlike sequence patterns, extra keys are ignored. An unpacking like **rest is also supported. (But **_ would be redundant, so it is not allowed.) Subpatterns may be captured using the as keyword: case ( Point ( x1 , y1 ), Point ( x2 , y2 ) as p2 ): ... will capture the second element of the input as p2 (as long as the input is a sequence of two points) Most literals are compared by equality, however the singletons True , False and None are compared by identity. Patterns may use named constants. These must be dotted names to prevent them from being interpreted as capture variable: from enum import Enum class Color ( Enum ): RED = 'red' GREEN = 'green' BLUE = 'blue' color = Color ( input ( "Enter your choice of 'red', 'blue' or 'green': " )) match color : case Color . RED : print ( "I see red!" ) case Color . GREEN : print ( "Grass is green" ) case Color . BLUE : print ( "I'm feeling the blues :(" ) For a more detailed explanation and additional examples, you can look into PEP 636 which is written in a tutorial format. 4.8. Defining Functions ¶ We can create a function that writes the Fibonacci series to an arbitrary boundary: >>> def fib ( n ): # write Fibonacci series less than n ... """Print a Fibonacci series less than n.""" ... a , b = 0 , 1 ... while a < n : ... print ( a , end = ' ' ) ... a , b = b , a + b ... print () ... >>> # Now call the function we just defined: >>> fib ( 2000 ) 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 The keyword def introduces a function definition . It must be followed by the function name and the parenthesized list of formal parameters. The statements that form the body of the function start at the next line, and must be indented. The first statement of the function body can optionally be a string literal; this string literal is the function’s documentation string, or docstring . (More about docstrings can be found in the section Documentation Strings .) There are tools which use docstrings to automatically produce online or printed documentation, or to let the user interactively browse through code; it’s good practice to include docstrings in code that you write, so make a habit of it. The execution of a function introduces a new symbol table used for the local variables of the function. More precisely, all variable assignments in a function store the value in the local symbol table; whereas variable references first look in the local symbol table, then in the local symbol tables of enclosing functions, then in the global symbol table, and finally in the table of built-in names. Thus, global variables and variables of enclosing functions cannot be directly assigned a value within a function (unless, for global variables, named in a global statement, or, for variables of enclosing functions, named in a nonlocal statement), although they may be referenced. The actual parameters (arguments) to a function call are introduced in the local symbol table of the called function when it is called; thus, arguments are passed using call by value (where the value is always an object reference , not the value of the object). [ 1 ] When a function calls another function, or calls itself recursively, a new local symbol table is created for that call. A function definition associates the function name with the function object in the current symbol table. The interpreter recognizes the object pointed to by that name as a user-defined function. Other names can also point to that same function object and can also be used to access the function: >>> fib <function fib at 10042ed0> >>> f = fib >>> f ( 100 ) 0 1 1 2 3 5 8 13 21 34 55 89 Coming from other languages, you might object that fib is not a function but a procedure since it doesn’t return a value. In fact, even functions without a return statement do return a value, albeit a rather boring one. This value is called None (it’s a built-in name). Writing the value None is normally suppressed by the interpreter if it would be the only value written. You can see it if you really want to using print() : >>> fib ( 0 ) >>> print ( fib ( 0 )) None It is simple to write a function that returns a list of the numbers of the Fibonacci series, instead of printing it: >>> def fib2 ( n ): # return Fibonacci series up to n ... """Return a list containing the Fibonacci series up to n.""" ... result = [] ... a , b = 0 , 1 ... while a < n : ... result . append ( a ) # see below ... a , b = b , a + b ... return result ... >>> f100 = fib2 ( 100 ) # call it >>> f100 # write the result [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] 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 . The statement result.append(a) calls a method of the list object result . A method is a function that ‘belongs’ to an object and is named obj.methodname , where obj is some object (this may be an expression), and methodname is the name of a method that is defined by the object’s type. Different types define different methods. Methods of different types may have the same name without causing ambiguity. (It is possible to define your own object types and methods, using classes , see Classes ) The method append() shown in the example is defined for list objects; it adds a new element at the end of the list. In this example it is equivalent to result = result + [a] , but more efficient. 4.9. More on Defining Functions ¶ It is also possible to define functions with a variable number of arguments. There are three forms, which can be combined. 4.9.1. Default Argument Values ¶ The most useful form is to specify a default value for one or more arguments. This creates a function that can be called with fewer arguments than it is defined to allow. For example: def ask_ok ( prompt , retries = 4 , reminder = 'Please try again!' ): while True : reply = input ( prompt ) if reply in { 'y' , 'ye' , 'yes' }: return True if reply in { 'n' , 'no' , 'nop' , 'nope' }: return False retries = retries - 1 if retries < 0 : raise ValueError ( 'invalid user response' ) print ( reminder ) This function can be called in several ways: giving only the mandatory argument: ask_ok('Do you really want to quit?') giving one of the optional arguments: ask_ok('OK to overwrite the file?', 2) or even giving all arguments: ask_ok('OK to overwrite the file?', 2, 'Come on, only yes or no!') This example also introduces the in keyword. This tests whether or not a sequence contains a certain value. The default values are evaluated at the point of function definition in the defining scope, so that i = 5 def f ( arg = i ): print ( arg ) i = 6 f () will print 5 . Important warning: The default value is evaluated only once. This makes a difference when the default is a mutable object such as a list, dictionary, or instances of most classes. For example, the following function accumulates the arguments passed to it on subsequent calls: def f ( a , L = []): L . append ( a ) return L print ( f ( 1 )) print ( f ( 2 )) print ( f ( 3 )) This will print [ 1 ] [ 1 , 2 ] [ 1 , 2 , 3 ] If you don’t want the default to be shared between subsequent calls, you can write the function like this instead: def f ( a , L = None ): if L is None : L = [] L . append ( a ) return L 4.9.2. Keyword Arguments ¶ Functions can also be called using keyword arguments of the form kwarg=value . For instance, the following function: def parrot ( voltage , state = 'a stiff' , action = 'voom' , type = 'Norwegian Blue' ): print ( "-- This parrot wouldn't" , action , end = ' ' ) print ( "if you put" , voltage , "volts through it." ) print ( "-- Lovely plumage, the" , type ) print ( "-- It's" , state , "!" ) accepts one required argument ( voltage ) and three optional arguments ( state , action , and type ). This function can be called in any of the following ways: parrot ( 1000 ) # 1 positional argument parrot ( voltage = 1000 ) # 1 keyword argument parrot ( voltage = 1000000 , action = 'VOOOOOM' ) # 2 keyword arguments parrot ( action = 'VOOOOOM' , voltage = 1000000 ) # 2 keyword arguments parrot ( 'a million' , 'bereft of life' , 'jump' ) # 3 positional arguments parrot ( 'a thousand' , state = 'pushing up the daisies' ) # 1 positional, 1 keyword but all the following calls would be invalid: parrot () # required argument missing parrot ( voltage = 5.0 , 'dead' ) # non-keyword argument after a keyword argument parrot ( 110 , voltage = 220 ) # duplicate value for the same argument parrot ( actor = 'John Cleese' ) # unknown keyword argument In a function call, keyword arguments must follow positional arguments. All the keyword arguments passed must match one of the arguments accepted by the function (e.g. actor is not a valid argument for the parrot function), and their order is not important. This also includes non-optional arguments (e.g. parrot(voltage=1000) is valid too). No argument may receive a value more than once. Here’s an example that fails due to this restriction: >>> def function ( a ): ... pass ... >>> function ( 0 , a = 0 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : function() got multiple values for argument 'a' When a final formal parameter of the form **name is present, it receives a dictionary (see Mapping Types — dict ) containing all keyword arguments except for those corresponding to a formal parameter. This may be combined with a formal parameter of the form *name (described in the next subsection) which receives a tuple containing the positional arguments beyond the formal parameter list. ( *name must occur before **name .) For example, if we define a function like this: def cheeseshop ( kind , * arguments , ** keywords ): print ( "-- Do you have any" , kind , "?" ) print ( "-- I'm sorry, we're all out of" , kind ) for arg in arguments : print ( arg ) print ( "-" * 40 ) for kw in keywords : print ( kw , ":" , keywords [ kw ]) It could be called like this: cheeseshop ( "Limburger" , "It's very runny, sir." , "It's really very, VERY runny, sir." , shopkeeper = "Michael Palin" , client = "John Cleese" , sketch = "Cheese Shop Sketch" ) and of course it would print: -- Do you have any Limburger ? -- I'm sorry, we're all out of Limburger It's very runny, sir. It's really very, VERY runny, sir. ---------------------------------------- shopkeeper : Michael Palin client : John Cleese sketch : Cheese Shop Sketch Note that the order in which the keyword arguments are printed is guaranteed to match the order in which they were provided in the function call. 4.9.3. Special parameters ¶ By default, arguments may be passed to a Python function either by position or explicitly by keyword. For readability and performance, it makes sense to restrict the way arguments can be passed so that a developer need only look at the function definition to determine if items are passed by position, by position or keyword, or by keyword. A function definition may look like: def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2): ----------- ---------- ---------- | | | | Positional or keyword | | - Keyword only -- Positional only where / and * are optional. If used, these symbols indicate the kind of parameter by how the arguments may be passed to the function: positional-only, positional-or-keyword, and keyword-only. Keyword parameters are also referred to as named parameters. 4.9.3.1. Positional-or-Keyword Arguments ¶ If / and * are not present in the function definition, arguments may be passed to a function by position or by keyword. 4.9.3.2. Positional-Only Parameters ¶ Looking at this in a bit more detail, it is possible to mark certain parameters as positional-only . If positional-only , the parameters’ order matters, and the parameters cannot be passed by keyword. Positional-only parameters are placed before a / (forward-slash). The / is used to logically separate the positional-only parameters from the rest of the parameters. If there is no / in the function definition, there are no positional-only parameters. Parameters following the / may be positional-or-keyword or keyword-only . 4.9.3.3. Keyword-Only Arguments ¶ To mark parameters as keyword-only , indicating the parameters must be passed by keyword argument, place an * in the arguments list just before the first keyword-only parameter. 4.9.3.4. Function Examples ¶ Consider the following example function definitions paying close attention to the markers / and * : >>> def standard_arg ( arg ): ... print ( arg ) ... >>> def pos_only_arg ( arg , / ): ... print ( arg ) ... >>> def kwd_only_arg ( * , arg ): ... print ( arg ) ... >>> def combined_example ( pos_only , / , standard , * , kwd_only ): ... print ( pos_only , standard , kwd_only ) The first function definition, standard_arg , the most familiar form, places no restrictions on the calling convention and arguments may be passed by position or keyword: >>> standard_arg ( 2 ) 2 >>> standard_arg ( arg = 2 ) 2 The second function pos_only_arg is restricted to only use positional parameters as there is a / in the function definition: >>> pos_only_arg ( 1 ) 1 >>> pos_only_arg ( arg = 1 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : pos_only_arg() got some positional-only arguments passed as keyword arguments: 'arg' The third function kwd_only_arg only allows keyword arguments as indicated by a * in the function definition: >>> kwd_only_arg ( 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : kwd_only_arg() takes 0 positional arguments but 1 was given >>> kwd_only_arg ( arg = 3 ) 3 And the last uses all three calling conventions in the same function definition: >>> combined_example ( 1 , 2 , 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : combined_example() takes 2 positional arguments but 3 were given >>> combined_example ( 1 , 2 , kwd_only = 3 ) 1 2 3 >>> combined_example ( 1 , standard = 2 , kwd_only = 3 ) 1 2 3 >>> combined_example ( pos_only = 1 , standard = 2 , kwd_only = 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : combined_example() got some positional-only arguments passed as keyword arguments: 'pos_only' Finally, consider this function definition which has a potential collision between the positional argument name and **kwds which has name as a key: def foo ( name , ** kwds ): return 'name' in kwds There is no possible call that will make it return True as the keyword 'name' will always bind to the first parameter. For example: >>> foo ( 1 , ** { 'name' : 2 }) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : foo() got multiple values for argument 'name' >>> But using / (positional only arguments), it is possible since it allows name as a positional argument and 'name' as a key in the keyword arguments: >>> def foo ( name , / , ** kwds ): ... return 'name' in kwds ... >>> foo ( 1 , ** { 'name' : 2 }) True In other words, the names of positional-only parameters can be used in **kwds without ambiguity. 4.9.3.5. Recap ¶ The use case will determine which parameters to use in the function definition: def f ( pos1 , pos2 , / , pos_or_kwd , * , kwd1 , kwd2 ): As guidance: Use positional-only if you want the name of the parameters to not be available to the user. This is useful when parameter names have no real meaning, if you want to enforce the order of the arguments when the function is called or if you need to take some positional parameters and arbitrary keywords. Use keyword-only when names have meaning and the function definition is more understandable by being explicit with names or you want to prevent users relying on the position of the argument being passed. For an API, use positional-only to prevent breaking API changes if the parameter’s name is modified in the future. 4.9.4. Arbitrary Argument Lists ¶ Finally, the least frequently used option is to specify that a function can be called with an arbitrary number of arguments. These arguments will be wrapped up in a tuple (see Tuples and Sequences ). Before the variable number of arguments, zero or more normal arguments may occur. def write_multiple_items ( file , separator , * args ): file . write ( separator . join ( args )) Normally, these variadic arguments will be last in the list of formal parameters, because they scoop up all remaining input arguments that are passed to the function. Any formal parameters which occur after the *args parameter are ‘keyword-only’ arguments, meaning that they can only be used as keywords rather than positional arguments. >>> def concat ( * args , sep = "/" ): ... return sep . join ( args ) ... >>> concat ( "earth" , "mars" , "venus" ) 'earth/mars/venus' >>> concat ( "earth" , "mars" , "venus" , sep = "." ) 'earth.mars.venus' 4.9.5. Unpacking Argument Lists ¶ The reverse situation occurs when the arguments are already in a list or tuple but need to be unpacked for a function call requiring separate positional arguments. For instance, the built-in range() function expects separate start and stop arguments. If they are not available separately, write the function call with the * -operator to unpack the arguments out of a list or tuple: >>> list ( range ( 3 , 6 )) # normal call with separate arguments [3, 4, 5] >>> args = [ 3 , 6 ] >>> list ( range ( * args )) # call with arguments unpacked from a list [3, 4, 5] In the same fashion, dictionaries can deliver keyword arguments with the ** -operator: >>> def parrot ( voltage , state = 'a stiff' , action = 'voom' ): ... print ( "-- This parrot wouldn't" , action , end = ' ' ) ... print ( "if you put" , voltage , "volts through it." , end = ' ' ) ... print ( "E's" , state , "!" ) ... >>> d = { "voltage" : "four million" , "state" : "bleedin' demised" , "action" : "VOOM" } >>> parrot ( ** d ) -- This parrot wouldn't VOOM if you put four million volts through it. E's bleedin' demised ! 4.9.6. Lambda Expressions ¶ Small anonymous functions can be created with the lambda keyword. This function returns the sum of its two arguments: lambda a, b: a+b . Lambda functions can be used wherever function objects are required. They are syntactically restricted to a single expression. Semantically, they are just syntactic sugar for a normal function definition. Like nested function definitions, lambda functions can reference variables from the containing scope: >>> def make_incrementor ( n ): ... return lambda x : x + n ... >>> f = make_incrementor ( 42 ) >>> f ( 0 ) 42 >>> f ( 1 ) 43 The above example uses a lambda expression to return a function. Another use is to pass a small function as an argument. For instance, list.sort() takes a sorting key function key which can be a lambda function: >>> pairs = [( 1 , 'one' ), ( 2 , 'two' ), ( 3 , 'three' ), ( 4 , 'four' )] >>> pairs . sort ( key = lambda pair : pair [ 1 ]) >>> pairs [(4, 'four'), (1, 'one'), (3, 'three'), (2, 'two')] 4.9.7. Documentation Strings ¶ Here are some conventions about the content and formatting of documentation strings. The first line should always be a short, concise summary of the object’s purpose. For brevity, it should not explicitly state the object’s name or type, since these are available by other means (except if the name happens to be a verb describing a function’s operation). This line should begin with a capital letter and end with a period. If there are more lines in the documentation string, the second line should be blank, visually separating the summary from the rest of the description. The following lines should be one or more paragraphs describing the object’s calling conventions, its side effects, etc. The Python parser strips indentation from multi-line string literals when they serve as module, class, or function docstrings. Here is an example of a multi-line docstring: >>> def my_function (): ... """Do nothing, but document it. ... ... No, really, it doesn't do anything: ... ... >>> my_function() ... >>> ... """ ... pass ... >>> print ( my_function . __doc__ ) Do nothing, but document it. No, really, it doesn't do anything: >>> my_function() >>> 4.9.8. Function Annotations ¶ Function annotations are completely optional metadata information about the types used by user-defined functions (see PEP 3107 and PEP 484 for more information). Annotations are stored in the __annotations__ attribute of the function as a dictionary and have no effect on any other part of the function. Parameter annotations are defined by a colon after the parameter name, followed by an expression evaluating to the value of the annotation. Return annotations are defined by a literal -> , followed by an expression, between the parameter list and the colon denoting the end of the def statement. The following example has a required argument, an optional argument, and the return value annotated: >>> def f ( ham : str , eggs : str = 'eggs' ) -> str : ... print ( "Annotations:" , f . __annotations__ ) ... print ( "Arguments:" , ham , eggs ) ... return ham + ' and ' + eggs ... >>> f ( 'spam' ) Annotations: {'ham': <class 'str'>, 'return': <class 'str'>, 'eggs': <class 'str'>} Arguments: spam eggs 'spam and eggs' 4.10. Intermezzo: Coding Style ¶ Now that you are about to write longer, more complex pieces of Python, it is a good time to talk about coding style . Most languages can be written (or more concise, formatted ) in different styles; some are more readable than others. Making it easy for others to read your code is always a good idea, and adopting a nice coding style helps tremendously for that. For Python, PEP 8 has emerged as the style guide that most projects adhere to; it promotes a very readable and eye-pleasing coding style. Every Python developer should read it at some point; here are the most important points extracted for you: Use 4-space indentation, and no tabs. 4 spaces are a good compromise between small indentation (allows greater nesting depth) and large indentation (easier to read). Tabs introduce confusion, and are best left out. Wrap lines so that they don’t exceed 79 characters. This helps users with small displays and makes it possible to have several code files side-by-side on larger displays. Use blank lines to separate functions and classes, and larger blocks of code inside functions. When possible, put comments on a line of their own. Use docstrings. Use spaces around operators and after commas, but not directly inside bracketing constructs: a = f(1, 2) + g(3, 4) . Name your classes and functions consistently; the convention is to use UpperCamelCase for classes and lowercase_with_underscores for functions and methods. Always use self as the name for the first method argument (see A First Look at Classes for more on classes and methods). Don’t use fancy encodings if your code is meant to be used in international environments. Python’s default, UTF-8, or even plain ASCII work best in any case. Likewise, don’t use non-ASCII characters in identifiers if there is only the slightest chance people speaking a different language will read or maintain the code. Footnotes [ 1 ] Actually, call by object reference would be a better description, since if a mutable object is passed, the caller will see any changes the callee makes to it (items inserted into a list). Table of Contents 4. More Control Flow Tools 4.1. if Statements 4.2. for Statements 4.3. The range() Function 4.4. break and continue Statements 4.5. else Clauses on Loops 4.6. pass Statements 4.7. match Statements 4.8. Defining Functions 4.9. More on Defining Functions 4.9.1. Default Argument Values 4.9.2. Keyword Arguments 4.9.3. Special parameters 4.9.3.1. Positional-or-Keyword Arguments 4.9.3.2. Positional-Only Parameters 4.9.3.3. Keyword-Only Arguments 4.9.3.4. Function Examples 4.9.3.5. Recap 4.9.4. Arbitrary Argument Lists 4.9.5. Unpacking Argument Lists 4.9.6. Lambda Expressions 4.9.7. Documentation Strings 4.9.8. Function Annotations 4.10. Intermezzo: Coding Style Previous topic 3. An Informal Introduction to Python Next topic 5. Data Structures This page Report a bug Show source « Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 4. More Control Flow Tools | Theme Auto Light Dark | © Copyright 2001 Python Software Foundation. This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. See History and License for more information. The Python Software Foundation is a non-profit corporation. Please donate. Last updated on Jan 13, 2026 (06:19 UTC). Found a bug ? Created using Sphinx 8.2.3. | 2026-01-13T08:48:44 |
https://dev.to/missamarakay/following-cooking-recipes-makes-you-a-clearer-writer-460a#brevity | Following Cooking Recipes Makes You a Clearer Writer - DEV Community Forem Feed Follow new Subforems to improve your feed DEV Community Follow A space to discuss and keep up software development and manage your software career Future Follow News and discussion of science and technology such as AI, VR, cryptocurrency, quantum computing, and more. Open Forem Follow A general discussion space for the Forem community. If it doesn't have a home elsewhere, it belongs here Gamers Forem Follow An inclusive community for gaming enthusiasts Music Forem Follow From composing and gigging to gear, hot music takes, and everything in between. Vibe Coding Forem Follow Discussing AI software development, and showing off what we're building. Popcorn Movies and TV Follow Movie and TV enthusiasm, criticism and everything in-between. DUMB DEV Community Follow Memes and software development shitposting Design Community Follow Web design, graphic design and everything in-between Security Forem Follow Your central hub for all things security. From ethical hacking and CTFs to GRC and career development, for beginners and pros alike Golf Forem Follow A community of golfers and golfing enthusiasts Crypto Forem Follow A collaborative community for all things Crypto—from Bitcoin to protocol development and DeFi to NFTs and market analysis. Parenting Follow A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Forem Core Follow Discussing the core forem open source software project — features, bugs, performance, self-hosting. Maker Forem Follow A community for makers, hobbyists, and professionals to discuss Arduino, Raspberry Pi, 3D printing, and much more. HMPL.js Forem Follow For developers using HMPL.js to build fast, lightweight web apps. A space to share projects, ask questions, and discuss server-driven templating Dropdown menu Dropdown menu Skip to content Navigation menu Search Powered by Algolia Search Log in Create account DEV Community Close Add reaction Like Unicorn Exploding Head Raised Hands Fire Jump to Comments Save Boost More... Copy link Copy link Copied to Clipboard Share to X Share to LinkedIn Share to Facebook Share to Mastodon Share Post via... Report Abuse Amara Graham Posted on Jul 17, 2019 Following Cooking Recipes Makes You a Clearer Writer # devrel # documentation I'm really into cooking, baking, pickling, really anything that will end in me eating something delicious. But I didn't find it enjoyable or "get good" at cooking overnight. My parents cooked most of our meals and if you planned on eating said meal, you were required to provide some amount of assistance, regardless of your blood relation to the family. After graduating out of dorm life I realized I needed to feed myself or starve, so I started getting bolder with my kitchen experiments and I'm pleased to say I'm still alive. "Ok Amara, but where is the tech components of this blog?" Hold on, I'm setting up the metaphor. "Ok fine." In the Kitchen If you stand in a kitchen and watch my dad cook - he reads a recipe, studies it, then goes through and pulls out all the things he needs to make it happen. For banana bread he usually has to pull the frozen bananas out early to thaw them enough to peel them, he portions out the spices so he can toss them in while mixing, he sprays the loaf pan before the mixture is together. If you watched me in my first apartment attempting banana bread for the first time, you would have seen someone who barely read the recipe (I've made this before, with supervision, and watched my dad make it for years, how hard can it be?) and did exactly every step of the instruction in series. Pull frozen bananas out of the freezer, immediately realize you can't peel a banana when its extra frozen, wait just long enough you can pry the peel off, smash the mostly still frozen bananas, slowly add each spice one at a time, measuring as you go, mix everything together, spray the pan, realize the oven isn't on, wait to pre-heat, blah blah blah, why did this take double the prep time? My dad has always taken the methodical approach to everything, he's a chemist and he loves math. I'm impatient and can't spend even 30 seconds idle when I know I need to complete a task, so I pretty much have the attention span of a Border Collie (have you seen those dogs stare at a ball, full body shaking with excitement?). At My Desk I'm sure you'll be shocked to hear when I sit down to learn some kind of new tech, I barely skim the tutorial or docs, immediately start the "doing", and often end up frustrated and annoyed with the experience. In some cases I tell myself things like "oh I've used an API like this before, I can just make it work" and 3 days later I'm banging my head on the keyboard. "Amara, just slow down and actually read the tutorial." Easier said than done. Not just for me personally, but for any dev, and that includes your dev coworkers, customers, community, etc. Time is precious, workplaces are more agile than ever, and people pay money for other people to stand in line for them. In My Brain Now recipes, just like tutorials, can be poorly written, but even the good ones can suffer from poor execution as I rambled on above. There are 5 things I learned from getting better at following cooking recipes that I think apply to written technical content. Ambiguous Terms Jargon Chunking Brevity Audience Let's take a look at each one. Ambiguous Terms Have you ever read a recipe, seen the word "mix" and go... with a spoon? A stand mixer? How long? Or how about "hand mix"? Did you know that a 'Hand Mixer' is an appliance and not the things at the end of your arms? Because a few years ago when we first started dating, my now husband did not. In tech, we love using the same term for a number of different things. Or we have a number of different words for the same thing. Really friendly to beginners right? Something like "Run this" might make sense to you, the engineer who built it, because its probably never crossed your mind that you run it globally and not in a particular directory (or vice versa) but that can be one of the most irritating things for a dev struggling with the worry of doing something wrong and/or irreversible. Be explicit in your use of terms and maybe consider a glossary of terms relevant to your project/product/industry/company. What does this mean in this context, right here, right now? Don't leave your reading punching out to search for answers. Jargon Every talk I've given on AI to beginners has included a disclaimer about not only ambiguous terminology but jargon. 'Fine-tuning' is not super intuitive, neither is 'hyperparameter'. 'Fold in' or 'soft peaks' in cooking is right up there too. Mastering the jargon can disrupt retention of fundamental topics. Explaining these terms early in docs and tutorials is crucial. You should not assume knowledge of jargon, so this is another +1 for a glossary. Chunking I am a huge fan of multi-part tutorials and how-to series, so long as they are done right. At the end of each part in a series, you should have a small complete something. Developers may not have time to sit down and do a 3-6 hour tutorial, but they should be able to get 20 minutes to an hour of uninterrupted time. You don't want to tackle a slow cooker recipe at 5pm expecting to eat it for dinner, but you may want to brown some meat so it is ready to toss in the next morning. If I have 20 minutes today to set myself up for success later today or tomorrow, I need to know I can get it done in the allocated time. And I need to feel like I can pick it up again without rereading the entire thing. Brevity Unlike this blog which is probably way too long for most of you, the more concise your written technical content the easier its going to be to follow. It's part of what makes the Tasty videos so appealing to watch - someone makes a sped up, top-down recipe that feels fast and easy even if its neither. This doesn't mean you can't write an introduction or a conclusion that goes more in depth about the content, but when you get to the meat of the docs or tutorial it should be a lean, mean, executing machine. Food bloggers are great at this, they may give you step-by-step pictures and commentary, but they almost always include the recipe separately. So feel free to tell me how you are going to save the world with this tutorial, but keep it out of the exact steps I'm following so I don't get overwhelmed. Audience This is maybe the most important, although I could argue that they all are. Knowing your developer audience is extremely important in technical writing. This helps you make decisions about what languages and references to use, what their workstation may look like, and maybe even things like their attention span. If your audience is students, whether they will admit it or not, they tend to have WAY more time to sit down and really study a tutorial. Or maybe they are participating in a hackathon and it just needs to work as fast as possible. But maybe your audience is enterprise developers, like mine often is. This means it has to be production-ready, maintainable, and even trainable across teams. Your maintenance team may be entirely separate from your product engineering team, so the content they follow may need to be different. Knowing or identifying your audience can be challenging, but this is a great opportunity for your devrel team to really shine. Celebrate Those Incremental Improvements Like I mentioned earlier, I didn't wake up one day and realize if I actually read the recipe, prepped ahead of time, and researched how to do certain kitchen techniques (again, ahead of time), I could maximize my time in the kitchen and feel less overwhelmed. In fact, I'm probably 50:50 in my ability to prep and run in parallel or haphazardly skim in series today. But snaps for me because this week I measured everything out before I started cooking! I'm sure you could make an argument that my dad is a 'senior' in the kitchen and I'm not (but I'm also not junior either), but he'd prefer you only use 'senior' when used in conjunction with "senior discount" at this point in his life. Let's say 'seasoned'. Whether you are a junior or senior dev, you still need the content you are consuming to prepare you for success. But with more and more folks using services like Blue Apron, Hello Fresh, Home Chef, arguably boxed Bootcamp experiences for the kitchen, we have a new generation of folks training themselves how to follow recipes and we can translate that experience into the tech world, allowing for more confident, empowered folks in the kitchen and at the keyboard. So instead of shouting "read the docs" or "follow the tutorial" make sure your content is as consumable and delicious as a home cooked meal. Top comments (5) Subscribe Personal Trusted User Create template Templates let you quickly answer FAQs or store snippets for re-use. Submit Preview Dismiss Collapse Expand Jason C. McDonald Jason C. McDonald Jason C. McDonald Follow Author. Speaker. Time Lord. (Views are my own) Email codemouse92@outlook.com Location Time Vortex Pronouns he/him Work Author of "Dead Simple Python" (No Starch Press) Joined Jan 31, 2017 • Aug 5 '19 Dropdown menu Copy link Hide Excellent write up! I'm actually going to include this on the #beginners tag wiki for authors to read. Like comment: Like comment: 2 likes Like Comment button Reply Collapse Expand JeffD JeffD JeffD Follow Code-quality 🩺 Teamwork 🐝 & everything that can simplify the developper's life 🗂️. Location France Joined Oct 16, 2017 • Sep 16 '19 Dropdown menu Copy link Hide This post is a must-read ! It's perfect 🏆 ("Hold on, I'm setting up the metaphor." 🤣) Like comment: Like comment: 2 likes Like Comment button Reply Collapse Expand Alvarez García Alvarez García Alvarez García Follow After more than 10 years backending, now trying to make this CSS properties work. Location Buenos Aires, Argentina Work FullStack Joined Apr 24, 2019 • Jul 25 '19 Dropdown menu Copy link Hide DevRel in construction here, thanks for this really simple and enjoyable post. Like comment: Like comment: 2 likes Like Comment button Reply Collapse Expand Amara Graham Amara Graham Amara Graham Follow Enabling developers Location Austin, TX Education BS Computer Science from Trinity University Work Developer Advocate at Kestra Joined Jan 4, 2017 • Jul 25 '19 Dropdown menu Copy link Hide Thank you! :) Like comment: Like comment: 1 like Like Comment button Reply Collapse Expand Shashamura1 Shashamura1 Shashamura1 Follow Hi everyone my name is daniel.gentle loving caring I’am a type of person that always optimistic in every thing that I doing im very couriours and ambitious to lean I’m very new in this site Email ashogbondaniel292@gmail.com Location USA Education Technical college Work CEO at mylocallatest ...https://mylocallatest512644105.wordpress.com Joined Sep 12, 2022 • Oct 8 '22 Dropdown menu Copy link Hide Nice post I can use it to learn as project in dev.com ..to share the interest story of cooking Like comment: Like comment: 1 like Like Comment button Reply Code of Conduct • Report abuse Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink . Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse Amara Graham Follow Enabling developers Location Austin, TX Education BS Computer Science from Trinity University Work Developer Advocate at Kestra Joined Jan 4, 2017 More from Amara Graham Moving Config Docs From YAML to Markdown # documentation # yaml # markdown Moving DevEx from DevRel to Engineering # devrel # devex # engineering # reorg Bing Webmaster Tools De-indexed My Docs Site and Increased My Cognitive Load # webdev # seo # documentation 💎 DEV Diamond Sponsors Thank you to our Diamond Sponsors for supporting the DEV Community Google AI is the official AI Model and Platform Partner of DEV Neon is the official database partner of DEV Algolia is the official search partner of DEV DEV Community — A space to discuss and keep up software development and manage your software career Home DEV++ Podcasts Videos DEV Education Tracks DEV Challenges DEV Help Advertise on DEV DEV Showcase About Contact Free Postgres Database Software comparisons Forem Shop Code of Conduct Privacy Policy Terms of Use Built on Forem — the open source software that powers DEV and other inclusive communities. Made with love and Ruby on Rails . DEV Community © 2016 - 2026. We're a place where coders share, stay up-to-date and grow their careers. Log in Create account | 2026-01-13T08:48:44 |
https://parenting.forem.com/petrashka | Siarhei - Parenting Forem Feed Follow new Subforems to improve your feed DEV Community Follow A space to discuss and keep up software development and manage your software career Future Follow News and discussion of science and technology such as AI, VR, cryptocurrency, quantum computing, and more. Open Forem Follow A general discussion space for the Forem community. If it doesn't have a home elsewhere, it belongs here Gamers Forem Follow An inclusive community for gaming enthusiasts Music Forem Follow From composing and gigging to gear, hot music takes, and everything in between. Vibe Coding Forem Follow Discussing AI software development, and showing off what we're building. Popcorn Movies and TV Follow Movie and TV enthusiasm, criticism and everything in-between. DUMB DEV Community Follow Memes and software development shitposting Design Community Follow Web design, graphic design and everything in-between Security Forem Follow Your central hub for all things security. From ethical hacking and CTFs to GRC and career development, for beginners and pros alike Golf Forem Follow A community of golfers and golfing enthusiasts Crypto Forem Follow A collaborative community for all things Crypto—from Bitcoin to protocol development and DeFi to NFTs and market analysis. Parenting Follow A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Forem Core Follow Discussing the core forem open source software project — features, bugs, performance, self-hosting. Maker Forem Follow A community for makers, hobbyists, and professionals to discuss Arduino, Raspberry Pi, 3D printing, and much more. HMPL.js Forem Follow For developers using HMPL.js to build fast, lightweight web apps. A space to share projects, ask questions, and discuss server-driven templating Dropdown menu Dropdown menu Skip to content Navigation menu Search Powered by Algolia Search Log in Create account Parenting Close Follow User actions Siarhei 404 bio not found Joined Joined on Nov 19, 2023 More info about @petrashka Badges Two Year Club This badge celebrates the longevity of those who have been a registered member of the DEV Community for at least two years. Got it Close One Year Club This badge celebrates the longevity of those who have been a registered member of the DEV Community for at least one year. Got it Close Writing Debut Awarded for writing and sharing your first DEV post! Continue sharing your work to earn the 4 Week Writing Streak Badge. Got it Close Post 1 post published Comment 2 comments written Tag 0 tags followed I built a free baby tracker that syncs across devices without requiring an account Siarhei Siarhei Siarhei Follow Dec 1 '25 I built a free baby tracker that syncs across devices without requiring an account # dadlife # newparents 2 reactions Comments 1 comment 3 min read Want to connect with Siarhei? Create an account to connect with Siarhei. You can also sign in below to proceed if you already have an account. Create Account Already have an account? Sign in loading... 💎 DEV Diamond Sponsors Thank you to our Diamond Sponsors for supporting the DEV Community Google AI is the official AI Model and Platform Partner of DEV Neon is the official database partner of DEV Algolia is the official search partner of DEV Parenting — A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Home About Contact Code of Conduct Privacy Policy Terms of Use Built on Forem — the open source software that powers DEV and other inclusive communities. Made with love and Ruby on Rails . Parenting © 2016 - 2026. Navigating the chaos and joy of parenting. Log in Create account | 2026-01-13T08:48:44 |
https://highlight.io/traces | highlight.io: The open source monitoring platform. Star us on GitHub Star Migrate your Highlight account to LaunchDarkly by February 28, 2026. Learn more on our blog. Product Integrations Pricing Resources Docs Sign in Sign up Explore highlight.io Tracing for modern web applications. Search for and query the traces across your full-stack web app. Get started in seconds. Get started Live demo Request a Demo Call Measure performance across your application. Pinpoint latency across your entire codebase, all the way from the client to server. Dig deep into nested code execution. Scrutinize every layer of your codebase and identify bottlenecks, inefficiencies, and areas of optimization. Read the Docs Powerful search. Powered by ClickHouse. Perform fine-grained searches across all of your traces. Powered by ClickHouse, an industry leading time-series database. Read the Docs From a “click” to a server-side trace. Visualize a complete, cohesive view of your entire stack. All the way from a user clicking a button to a server-side trace. Get started for free Support for all the modern frameworks. Whether its Python, Golang, or even vanilla JS, we got you covered. Get started with just a few lines of code. View all frameworks H.init("<YOUR_PROJECT_ID>", { tracingOrigins: ['localhost', 'example.myapp.com/backend'], ... }); A few lines of code. That’s it. Install highlight.io in seconds and get tracing out of the box. Framework Docs H.init("<YOUR_PROJECT_ID>", { tracingOrigins: ['localhost', 'example.myapp.com/backend'], ... }); Above Example in Python Other Frameworks → Master OpenTelemetry with our Free Comprehensive Course From fundamentals to advanced implementations, learn how OpenTelemetry can transform your engineering team's observability practices. Ideal for engineering leaders and developers building production-ready monitoring solutions. Start Learning Our customers Highlight powers forward-thinking companies. More about our customers → Don't take our word. Read our customer review section → Highlight helps us catch bugs that would otherwise go undetected and makes it easy to replicate and debug them. Max Musing , Founder & CEO Highlight weaves together the incredible, varied, and complex interactions of our users into something understandable and actionable. Kai Hess , Founding Product Designer I love Highlight because not only does it help me debug more quickly, but it gives me insight into how customers are actually using our product. Meryl Dakin , Founding Software Engineer Highlight has helped us win over several customers by making it possible for us to provide hands-on support, based on a detailed understanding of what each user was doing. Neil Raina , CTO Highlight helps us catch bugs that would otherwise go undetected and makes it easy to replicate and debug them. Max Musing , Founder & CEO Highlight weaves together the incredible, varied, and complex interactions of our users into something understandable and actionable. Kai Hess , Founding Product Designer I love Highlight because not only does it help me debug more quickly, but it gives me insight into how customers are actually using our product. Meryl Dakin , Founding Software Engineer Highlight has helped us win over several customers by making it possible for us to provide hands-on support, based on a detailed understanding of what each user was doing. Neil Raina , CTO Try Highlight Today Get the visibility you need Get started for free Product Pricing Sign up Features Privacy & Security Customers Session Replay Error Monitoring Logging Competitors LogRocket Hotjar Fullstory Smartlook Inspectlet Datadog Sentry Site24x7 Sprig Mouseflow Pendo Heap LogicMonitor Last9 Axiom Better Stack HyperDX Dash0 Developers Changelog Documentation Ambassadors Frameworks React Next.js Angular Gatsby.js Svelte.js Vue.js Express Golang Next.js Node.js Rails Hono Contact & Legal Terms of Service Privacy Policy Careers sales@highlight.io security@highlight.io [object Object] | 2026-01-13T08:48:44 |
https://highlight.io/for/next | highlight.io: The open source monitoring platform. Star us on GitHub Star Product Integrations Pricing Resources Docs Sign in Sign up Your browser does not support the video tag. Your browser does not support the video tag. The Next.js monitoring toolkit you've been waiting for. What if monitoring your Next.js app was as easy as deploying it? With session replay and error monitoring, Highlight's got you covered. Get started Live demo Session Replay Investigate hard-to-crack bugs by playing through issues in a youtube-like UI. With access to requests, console logs and more! Error Monitoring Continuously monitor errors and exceptions in your Next.js application, all the way from your frontend to your backend. Performance Metrics Monitor and set alerts for important performance metrics in Next.js like Web Vitals, Request latency, and much more! Highlight for Next.js Get started in your Next.js app today. Get started for free Live demo Frontend import type { AppProps } from 'next/app' import { H } from 'highlight.run' import { ErrorBoundary } from '@highlight-run/react' H.init('<YOUR_PROJECT_ID>') // Get your project ID from https://app.highlight.io/setup function MyApp({ Component, pageProps }: AppProps) { return ( <ErrorBoundary> <Component {...pageProps} /> </ErrorBoundary> ) } export default MyApp Reproduce issues with high-fidelity session replay. With our pixel-perfect replays of your Next.js app, you'll get to the bottom of issues in no time and better understand how your app is being used. Read our docs Get a ping when exceptions or errors are thrown. Our alerting infrastructure can take abnormal metrics or errors raised in your Next.js app and notify your engineering team over Slack, Discord, and more! Read our docs Monitor the metrics that keep your customers around. Highlight allows you to track performance, request timings, and several other metrics in your Next.js application. Read our docs Our customers Highlight powers forward-thinking companies. More about our customers → Don't take our word. What our customers have to say → Highlight helps us catch bugs that would otherwise go undetected and makes it easy to replicate and debug them. Max Musing , Founder & CEO Highlight weaves together the incredible, varied, and complex interactions of our users into something understandable and actionable. Kai Hess , Founding Product Designer I love Highlight because not only does it help me debug more quickly, but it gives me insight into how customers are actually using our product. Meryl Dakin , Founding Software Engineer Highlight has helped us win over several customers by making it possible for us to provide hands-on support, based on a detailed understanding of what each user was doing. Neil Raina , CTO Highlight helps us catch bugs that would otherwise go undetected and makes it easy to replicate and debug them. Max Musing , Founder & CEO Highlight weaves together the incredible, varied, and complex interactions of our users into something understandable and actionable. Kai Hess , Founding Product Designer I love Highlight because not only does it help me debug more quickly, but it gives me insight into how customers are actually using our product. Meryl Dakin , Founding Software Engineer Highlight has helped us win over several customers by making it possible for us to provide hands-on support, based on a detailed understanding of what each user was doing. Neil Raina , CTO Try Highlight Today Get the visibility you need Get started for free Product Pricing Sign up Features Privacy & Security Customers Session Replay Error Monitoring Logging Competitors LogRocket Hotjar Fullstory Smartlook Inspectlet Datadog Sentry Site24x7 Sprig Mouseflow Pendo Heap LogicMonitor Last9 Axiom Better Stack HyperDX Dash0 Developers Changelog Documentation Ambassadors Frameworks React Next.js Angular Gatsby.js Svelte.js Vue.js Express Golang Next.js Node.js Rails Hono Contact & Legal Terms of Service Privacy Policy Careers sales@highlight.io security@highlight.io [object Object] | 2026-01-13T08:48:44 |
https://support.google.com/chrome/answer/13355898 | Manage your ad privacy in Chrome - Google Chrome Help Skip to main content Google Chrome Help Sign in Google Help Help Center Community Google Chrome Privacy Policy Terms of Service Submit feedback Send feedback on... This help content & information General Help Center experience Next Help Center Community Google Chrome Manage your ad privacy in Chrome To keep you safe and protect your privacy while you browse, Chrome has ad privacy features that give you more control over how advertisers can personalize and choose which ads to show you. Your topics of interest are noted by Chrome and are based on your recent browsing history. Sites can also store info with Chrome about your interests. As you keep browsing, Chrome may be asked to share stored info about ad topics or site-suggested ads to help give you a more personalized ad experience. To measure the performance of ads, limited types of data can be shared among sites and apps. You can opt out of these features in your Chrome settings anytime. Whether an ad you see is personalized depends on these settings, your cookie settings , and if the site you view personalizes ads. Edit ad privacy settings On your device, open Chrome. At the top right, select More Settings . Select Privacy and security Ad privacy . Select the ad feature you’d like to turn on or off. Manage ad topics To personalize your ad experience, Chrome notes your topics of interests based on the sites you browse, how frequently you visit them, and other considerations. Even without ad topics, sites can still show you ads but they may not interest you. Chrome can share up to 3 topics at a time with sites. You can block topics and categories of topics you don’t want shared with sites. When you block a topic, Chrome won't share that topic again, but you may still get ads related to the topic. To further protect your privacy, Chrome automatically deletes your topics that are older than 4 weeks. To block a topic: On your device, open Chrome. At the top right, select More Settings Privacy and security . Select Ad privacy Ad topics . Under "Active topics," select topics to block. To block a category of topics: On your device, open Chrome. At the top right, select More Settings Privacy and security . Select Ad privacy Ad topics Manage topics . Turn off the categories you want to block. Check the full list of topics . Tips: Based on your recent browsing history, it may take a while for a list of topics to appear. You can block categories of topics at any time, even if a list of topics hasn’t appeared. You may not get a list of topics if the sites you visit don't support this feature. When on a site, you can check if Chrome shared your topics of interest with the site. In the address bar, select View site information Ad privacy . Manage site-suggested ads To help deliver a personalized ad experience, sites can recommend and then store ad suggestions about things you may like. As you continue to browse, you may get ads based on suggestions from related sites. Chrome automatically deletes suggestions that are older than 30 days, but they may reappear if you revisit that site. If you don’t want a site to suggest ads for you, you can block the site. Once blocked, any associated ad suggestion data is deleted. Blocked sites will no longer store ad suggestions with Chrome, but you may still get ads related to those sites. To block sites: On your device, open Chrome. At the top right, select More Settings . Select Privacy and security Ad privacy Site-suggested ads . Under "Sites," block a site from the list. Tips: Based on your recent browsing history, it may take a while for a list of sites to appear. You also may not get a list of sites if this feature hasn’t been adopted by the sites that you visit. When on a site, you can check if the site is suggesting ads for you. In the address bar, select View site information Ad privacy . Ad measurement As you browse, sites share a limited amount of data to measure ad performance, such as whether you made a purchase after visiting a site. Related resources Change site settings permissions Understand privacy in Chrome Delete, allow and manage cookies in Chrome Was this helpful? How can we improve it? Yes No Submit Need more help? Try these next steps: Post to the help community Get answers from community members true Help 1 of 15 Change text, image & video sizes (zoom) 2 of 15 Use notifications to get alerts 3 of 15 Translate pages and change Chrome languages 4 of 15 Use your camera and microphone in Chrome 5 of 15 Change site settings permissions 6 of 15 Reset Chrome settings to default 7 of 15 Accessibility on Chrome 8 of 15 Turn Chrome spell check on and off 9 of 15 Personalize Chrome performance 10 of 15 Manage desktop mode settings 11 of 15 Use Reading mode in Chrome 12 of 15 Manage your ad privacy in Chrome 13 of 15 Use Listen to this page mode in Chrome 14 of 15 Give sites permission to MIDI devices in Chrome 15 of 15 Use one-click dialing on Google Voice ©2026 Google Privacy Policy Terms of Service Language Afrikaans‎ català‎ dansk‎ Deutsch‎ eesti‎ English (United Kingdom)‎ español‎ español (Latinoamérica)‎ Filipino‎ français‎ hrvatski‎ Indonesia‎ isiZulu‎ italiano‎ Kiswahili‎ latviešu‎ lietuvių‎ magyar‎ Melayu‎ Nederlands‎ norsk‎ polski‎ português‎ português (Brasil)‎ română‎ slovenčina‎ slovenščina‎ suomi‎ svenska‎ Tiếng Việt‎ Türkçe‎ čeština‎ Ελληνικά‎ български‎ русский‎ српски‎ українська‎ ‏ עברית ‏ العربية ‏ فارسی मराठी‎ हिन्दी‎ తెలుగు‎ ไทย‎ አማርኛ‎ 中文(简体)‎ 中文(繁體)‎ 日本語‎ 한국어‎ English‎ Enable Dark Mode Send feedback on... This help content & information General Help Center experience Search Clear search Close search Google apps Main menu var n,aaa=[];function la(a){return function(){return aaa[a].apply(this,arguments)}} function ma(a,b){return aaa[a]=b} var baa=typeof Object.create=="function"?Object.create:function(a){function b(){} b.prototype=a;return new b},na=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a; a[b]=c.value;return a}; function caa(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b >>0)+"_",f=0;return b}); ra("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");na(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return naa(haa(this))}}); return a}); function naa(a){a={next:a};a[Symbol.iterator]=function(){return this}; return a} ra("Promise",function(a){function b(k){this.o=0;this.oa=void 0;this.ma=[];this.ya=!1;var l=this.ua();try{k(l.resolve,l.reject)}catch(p){l.reject(p)}} function c(){this.o=null} function e(k){return k instanceof b?k:new b(function(l){l(k)})} if(a)return a;c.prototype.ma=function(k){if(this.o==null){this.o=[];var l=this;this.oa(function(){l.qa()})}this.o.push(k)}; var f=oa.setTimeout;c.prototype.oa=function(k){f(k,0)}; c.prototype.qa=function(){for(;this.o&&this.o.length;){var k=this.o;this.o=[];for(var l=0;l =h}}); ra("String.prototype.endsWith",function(a){return a?a:function(b,c){var e=Ua(this,b,"endsWith");b+="";c===void 0&&(c=e.length);c=Math.max(0,Math.min(c|0,e.length));for(var f=b.length;f>0&&c>0;)if(e[--c]!=b[--f])return!1;return f f)e=f;e=Number(e);e =0&&b 56319||b+1===e)return f;b=c.charCodeAt(b+1);return b 57343?f:(f-55296)*1024+b+9216}}}); ra("String.fromCodePoint",function(a){return a?a:function(b){for(var c="",e=0;e 1114111||f!==Math.floor(f))throw new RangeError("invalid_code_point "+f);f >>10&1023|55296),c+=String.fromCharCode(f&1023|56320))}return c}}); ra("String.prototype.repeat",function(a){return a?a:function(b){var c=Ua(this,null,"repeat");if(b 1342177279)throw new RangeError("Invalid count value");b|=0;for(var e="";b;)if(b&1&&(e+=c),b>>>=1)c+=c;return e}}); ra("Array.prototype.findIndex",function(a){return a?a:function(b,c){return oaa(this,b,c).i}}); function Wa(a){a=Math.trunc(a)||0;a =this.length))return this[a]} ra("Array.prototype.at",function(a){return a?a:Wa}); daa("at",function(a){return a?a:Wa}); ra("String.prototype.at",function(a){return a?a:Wa}); ra("String.prototype.padStart",function(a){return a?a:function(b,c){var e=Ua(this,null,"padStart");b-=e.length;c=c!==void 0?String(c):" ";return(b>0&&c?c.repeat(Math.ceil(b/c.length)).substring(0,b):"")+e}}); ra("Promise.prototype.finally",function(a){return a?a:function(b){return this.then(function(c){return Promise.resolve(b()).then(function(){return c})},function(c){return Promise.resolve(b()).then(function(){throw c; })})}}); ra("Array.prototype.flatMap",function(a){return a?a:function(b,c){var e=[];Array.prototype.forEach.call(this,function(f,h){f=b.call(c,f,h,this);Array.isArray(f)?e.push.apply(e,f):e.push(f)}); return e}}); ra("Array.prototype.flat",function(a){return a?a:function(b){b=b===void 0?1:b;var c=[];Array.prototype.forEach.call(this,function(e){Array.isArray(e)&&b>0?(e=Array.prototype.flat.call(e,b-1),c.push.apply(c,e)):c.push(e)}); return c}}); ra("Promise.allSettled",function(a){function b(e){return{status:"fulfilled",value:e}} function c(e){return{status:"rejected",reason:e}} return a?a:function(e){var f=this;e=Array.from(e,function(h){return f.resolve(h).then(b,c)}); return f.all(e)}}); ra("Array.prototype.toSpliced",function(a){return a?a:function(b,c,e){var f=Array.from(this);Array.prototype.splice.apply(f,arguments);return f}}); ra("Number.parseInt",function(a){return a||parseInt});/* Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */ var Ya=Ya||{},Za=this||self;function $a(a,b){var c=ab("CLOSURE_FLAGS");a=c&&c[a];return a!=null?a:b} function ab(a,b){a=a.split(".");b=b||Za;for(var c=0;c >>0),raa=0;function saa(a,b,c){return a.call.apply(a.bind,arguments)} function taa(a,b,c){if(!a)throw Error();if(arguments.length>2){var e=Array.prototype.slice.call(arguments,2);return function(){var f=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(f,e);return a.apply(b,f)}}return function(){return a.apply(b,arguments)}} function eb(a,b,c){eb=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?saa:taa;return eb.apply(null,arguments)} function fb(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var e=c.slice();e.push.apply(e,arguments);return a.apply(this,e)}} function gb(){return Date.now()} function hb(a,b){a=a.split(".");for(var c=Za,e;a.length&&(e=a.shift());)a.length||b===void 0?c[e]&&c[e]!==Object.prototype[e]?c=c[e]:c=c[e]={}:c[e]=b} function jb(a){return a} function kb(a,b){function c(){} c.prototype=b.prototype;a.yh=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.base=function(e,f,h){for(var k=Array(arguments.length-2),l=2;l >6|192;else{if(h>=55296&&h =56320&&k >18|240;e[c++]=h>>12&63|128;e[c++]=h>>6&63|128;e[c++]=h&63|128;continue}else f--}if(b)throw Error("Found an unpaired surrogate");h=65533}e[c++]=h>>12|224;e[c++]=h>>6&63|128}e[c++]=h&63|128}}a=c===e.length?e:e.subarray(0,c)}return a} ;function qb(a){Za.setTimeout(function(){throw a;},0)} ;function rb(a,b){return a.lastIndexOf(b,0)==0} function sb(a){return/^[\s\xa0]*$/.test(a)} var tb=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]}; function ub(a,b){return a.indexOf(b)!=-1} function Baa(a,b){var c=0;a=tb(String(a)).split(".");b=tb(String(b)).split(".");for(var e=Math.max(a.length,b.length),f=0;c==0&&f b?1:0} ;var Caa=$a(1,!0),xb=$a(610401301,!1);$a(899588437,!1);$a(772657768,!0);$a(513659523,!1);$a(568333945,!0);$a(1331761403,!1);$a(651175828,!1);$a(722764542,!1);$a(748402145,!1);$a(748402146,!1);var Daa=$a(748402147,!0),yb=$a(824648567,!0),Ab=$a(824656860,Caa);$a(333098724,!1);$a(2147483644,!1);$a(2147483645,!1);$a(2147483646,Caa);$a(2147483647,!0);function Bb(){var a=Za.navigator;return a&&(a=a.userAgent)?a:""} var Cb,Eaa=Za.navigator;Cb=Eaa?Eaa.userAgentData||null:null;function Db(a){if(!xb||!Cb)return!1;for(var b=0;b 0:!1} function Gb(){return Fb()?!1:Eb("Opera")} function Hb(){return Fb()?!1:Eb("Trident")||Eb("MSIE")} function Faa(){return Fb()?Db("Microsoft Edge"):Eb("Edg/")} function Ib(){return Eb("Firefox")||Eb("FxiOS")} function Jb(){return Eb("Safari")&&!(Lb()||(Fb()?0:Eb("Coast"))||Gb()||(Fb()?0:Eb("Edge"))||Faa()||(Fb()?Db("Opera"):Eb("OPR"))||Ib()||Eb("Silk")||Eb("Android"))} function Lb(){return Fb()?Db("Chromium"):(Eb("Chrome")||Eb("CriOS"))&&!(Fb()?0:Eb("Edge"))||Eb("Silk")} ;function Mb(){return xb?!!Cb&&!!Cb.platform:!1} function Nb(){return Mb()?Cb.platform==="Android":Eb("Android")} function Ob(){return Eb("iPhone")&&!Eb("iPod")&&!Eb("iPad")} function Pb(){return Ob()||Eb("iPad")||Eb("iPod")} function Rb(){return Mb()?Cb.platform==="macOS":Eb("Macintosh")} function Gaa(){return Mb()?Cb.platform==="Linux":Eb("Linux")} function Sb(){return Mb()?Cb.platform==="Windows":Eb("Windows")} function Haa(){return Mb()?Cb.platform==="Chrome OS":Eb("CrOS")} ;var Iaa=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(typeof a==="string")return typeof b!=="string"||b.length!=1?-1:a.indexOf(b,0); for(var c=0;c =0} function Wb(a,b){b=Iaa(a,b);var c;(c=b>=0)&&Array.prototype.splice.call(a,b,1);return c} function Xb(a){var b=a.length;if(b>0){for(var c=Array(b),e=0;e parseFloat(fc)){ec=String(ic);break a}}ec=fc}var Vaa=ec;var Waa=Ib(),Xaa=Ob()||Eb("iPod"),Yaa=Eb("iPad"),Zaa=Eb("Android")&&!(Lb()||Ib()||Gb()||Eb("Silk")),jc=Lb(),$aa=Jb()&&!Pb();var aba={},kc=null,bba=bc||cc,cba=bba||typeof Za.btoa=="function",dba=bba||!$aa&&typeof Za.atob=="function";function lc(a,b){b===void 0&&(b=0);eba();b=aba[b];for(var c=Array(Math.floor(a.length/3)),e=b[64]||"",f=0,h=0;f >2];k=b[(k&3) >4];l=b[(l&15) >6];p=b[p&63];c[h++]=""+r+k+l+p}r=0;p=e;switch(a.length-f){case 2:r=a[f+1],p=b[(r&15) >2]+b[(a&3) >4]+p+e}return c.join("")} function nc(a,b){if(cba&&!b)a=Za.btoa(a);else{for(var c=[],e=0,f=0;f 255&&(c[e++]=h&255,h>>=8);c[e++]=h}a=lc(c,b)}return a} function oc(a,b){if(cba&&!b)a=Za.btoa(unescape(encodeURIComponent(a)));else{for(var c=[],e=0,f=0;f >6|192:((h&64512)==55296&&f+1 >18|240,c[e++]=h>>12&63|128):c[e++]=h>>12|224,c[e++]=h>>6&63|128),c[e++]=h&63|128)}a=lc(c,b)}return a} function pc(a,b){if(dba&&!b)return Za.atob(a);var c="";fba(a,function(e){c+=String.fromCharCode(e)}); return c} function gba(a){var b=a.length,c=b*3/4;c%3?c=Math.floor(c):ub("=.",a[b-1])&&(c=ub("=.",a[b-2])?c-2:c-1);var e=new Uint8Array(c),f=0;fba(a,function(h){e[f++]=h}); return f!==c?e.subarray(0,f):e} function fba(a,b){function c(p){for(;e >4);k!=64&&(b(h >2),l!=64&&b(k a.o.length&&(e=a.o,c=b.o);if(c.lastIndexOf(e,0)!==0)return!1;for(b=e.length;b =b||(e[a]=c+1,uba())}} ;function Ac(){return typeof BigInt==="function"} ;var Bc=typeof Symbol==="function"&&typeof Symbol()==="symbol";function Dc(a,b,c){return typeof Symbol==="function"&&typeof Symbol()==="symbol"?(c===void 0?0:c)&&Symbol.for&&a?Symbol.for(a):a!=null?Symbol(a):Symbol():b} var vba=Dc("jas",void 0,!0),Ec=Dc(void 0,"0di"),Fc=Dc(void 0,"1oa"),wba=Dc(void 0,"0dg"),Gc=Dc(void 0,Symbol()),xba=Dc(void 0,"0ub"),yba=Dc(void 0,"0ubs"),Hc=Dc(void 0,"0ubsb"),zba=Dc(void 0,"0actk"),Aba=Dc("m_m","Hqa",!0),Bba=Dc(void 0,"vps"),Cba=Dc();var Dba={FT:{value:0,configurable:!0,writable:!0,enumerable:!1}},Eba=Object.defineProperties,Ic=Bc?vba:"FT",Jc,Fba=[];Kc(Fba,7);Jc=Object.freeze(Fba);function Lc(a,b){Bc||Ic in a||Eba(a,Dba);a[Ic]|=b} function Kc(a,b){Bc||Ic in a||Eba(a,Dba);a[Ic]=b} function Gba(a){if(4&a)return 512&a?512:1024&a?1024:0} function Mc(a){Lc(a,34);return a} function Nc(a){Lc(a,8192);return a} function Oc(a){Lc(a,32);return a} ;var Hba={};function Pc(a){return a[Aba]===Hba} function Qc(a,b){return b===void 0?a.ma!==Rc&&!!(2&(a.Aa[Ic]|0)):!!(2&b)&&a.ma!==Rc} var Rc={};function Sc(a,b,c){if(a==null){if(!c)throw Error();}else if(typeof a==="string")a=a?new uc(a,tc):vc();else if(a.constructor!==uc)if(rc(a))a=a.length?new uc(new Uint8Array(a),tc):vc();else{if(!b)throw Error();a=void 0}return a} function Tc(a,b){if(typeof b!=="number"||b =a.length)throw Error();} function Iba(a,b){if(typeof b!=="number"||b a.length)throw Error();} function Uc(a,b,c){this.o=a;this.ma=b;this.thisArg=c} Uc.prototype.next=function(){var a=this.o.next();a.done||(a.value=this.ma.call(this.thisArg,a.value));return a}; Uc.prototype[Symbol.iterator]=function(){return this}; var Vc=Object.freeze({}),Jba=Object.freeze({});function Kba(a,b,c){var e=b&128?0:-1,f=a.length,h;if(h=!!f)h=a[f-1],h=h!=null&&typeof h==="object"&&h.constructor===Object;var k=f+(h?-1:0);for(b=b&128?1:0;b =Qba&&a b.length)return!1;if(a.length f)return!1;if(e >>0;bd=b;cd=(a-b)/4294967296>>>0} function fd(a){if(a >>0;cd=b>>>0}else ed(a)} function Wba(a){var b=dd||(dd=new DataView(new ArrayBuffer(8)));b.setFloat32(0,+a,!0);cd=0;bd=b.getUint32(0,!0)} function hd(a,b){var c=b*4294967296+(a>>>0);return Number.isSafeInteger(c)?c:jd(a,b)} function Xba(a,b){return $c(Ac()?BigInt.asUintN(64,(BigInt(b>>>0) >>0)):jd(a,b))} function kd(a,b){var c=b&2147483648;c&&(a=~a+1>>>0,b=~b>>>0,a==0&&(b=b+1>>>0));a=hd(a,b);return typeof a==="number"?c?-a:a:c?"-"+a:a} function Yba(a,b){return Ac()?$c(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(b)) >31;c=(c >>31)^e;a(b >>1|b >>1^e;return c(a,b)} function jd(a,b){b>>>=0;a>>>=0;if(b >>24|b >16&65535,a=(a&16777215)+c*6777216+b*6710656,c+=b*8147497,b*=2,a>=1E7&&(c+=a/1E7>>>0,a%=1E7),c>=1E7&&(b+=c/1E7>>>0,c%=1E7),c=b+bca(c)+bca(a));return c} function bca(a){a=String(a);return"0000000".slice(a.length)+a} function ld(a,b){b&2147483648?Ac()?a=""+(BigInt(b|0) >>0)):(b=v(gd(a,b)),a=b.next().value,b=b.next().value,a="-"+jd(a,b)):a=jd(a,b);return a} function md(a){if(a.length >>0,cd=Number(a>>BigInt(32)&BigInt(4294967295));else{var b=+(a[0]==="-");cd=bd=0;for(var c=a.length,e=0+b,f=(c-b)%6+b;f =4294967296&&(cd+=Math.trunc(bd/4294967296),cd>>>=0,bd>>>=0);b&&(b=v(gd(bd,cd)),a=b.next().value,b=b.next().value,bd=a,cd=b)}} function gd(a,b){b=~b;a?a=~a+1:b+=1;return[a,b]} ;function nd(a){return Array.prototype.slice.call(a)} ;function od(a,b){throw Error(b===void 0?"unexpected value "+a+"!":b);} ;var pd=typeof BigInt==="function"?BigInt.asIntN:void 0,qd=typeof BigInt==="function"?BigInt.asUintN:void 0,rd=Number.isSafeInteger,sd=Number.isFinite,td=Math.trunc;function ud(a){if(a==null||typeof a==="number")return a;if(a==="NaN"||a==="Infinity"||a==="-Infinity")return Number(a)} function cca(a){return Sc(a,!1,!1)} function vd(a){if(a!=null&&typeof a!=="boolean")throw Error("Expected boolean but got "+bb(a)+": "+a);return a} function wd(a){if(a==null||typeof a==="boolean")return a;if(typeof a==="number")return!!a} var dca=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function xd(a){switch(typeof a){case "bigint":return!0;case "number":return sd(a);case "string":return dca.test(a);default:return!1}} function yd(a){if(!sd(a))throw yc("enum");return a|0} function zd(a){return a==null?a:yd(a)} function Ad(a){return a==null?a:sd(a)?a|0:void 0} function Bd(a){if(typeof a!=="number")throw yc("int32");if(!sd(a))throw yc("int32");return a|0} function Cd(a){return a==null?a:Bd(a)} function Dd(a){if(a==null)return a;if(typeof a==="string"&&a)a=+a;else if(typeof a!=="number")return;return sd(a)?a|0:void 0} function Ed(a){if(typeof a!=="number")throw yc("uint32");if(!sd(a))throw yc("uint32");return a>>>0} function Fd(a){if(a==null)return a;if(typeof a==="string"&&a)a=+a;else if(typeof a!=="number")return;return sd(a)?a>>>0:void 0} function Gd(a,b){b!=null||(b=Ab?1024:0);if(!xd(a))throw yc("int64");var c=typeof a;switch(b){case 512:switch(c){case "string":return Hd(a);case "bigint":return String(pd(64,a));default:return Id(a)}case 1024:switch(c){case "string":return eca(a);case "bigint":return $c(pd(64,a));default:return fca(a)}case 0:switch(c){case "string":return Hd(a);case "bigint":return $c(pd(64,a));default:return Jd(a)}default:return od(b,"Unknown format requested type for int64")}} function Kd(a){return a==null?a:Gd(a,void 0)} function gca(a){var b=a.length;if(a[0]==="-"?b =0&&rd(a)||(fd(a),a=hd(bd,cd));return a} function Id(a){a=td(a);rd(a)?a=String(a):(fd(a),a=ld(bd,cd));return a} function Md(a){a=td(a);a>=0&&rd(a)?a=String(a):(fd(a),a=jd(bd,cd));return a} function Hd(a){var b=td(Number(a));if(rd(b))return String(b);b=a.indexOf(".");b!==-1&&(a=a.substring(0,b));return gca(a)} function eca(a){var b=td(Number(a));if(rd(b))return $c(b);b=a.indexOf(".");b!==-1&&(a=a.substring(0,b));return Ac()?$c(pd(64,BigInt(a))):$c(gca(a))} function fca(a){return rd(a)?$c(Jd(a)):$c(Id(a))} function ica(a){return rd(a)?$c(Ld(a)):$c(Md(a))} function Nd(a){var b=td(Number(a));if(rd(b)&&b>=0)return String(b);b=a.indexOf(".");b!==-1&&(a=a.substring(0,b));return hca(a)} function jca(a){var b=td(Number(a));if(rd(b)&&b>=0)return $c(b);b=a.indexOf(".");b!==-1&&(a=a.substring(0,b));return Ac()?$c(qd(64,BigInt(a))):$c(hca(a))} function Od(a){if(a==null)return a;if(typeof a==="bigint")return ad(a)?a=Number(a):(a=pd(64,a),a=ad(a)?Number(a):String(a)),a;if(xd(a))return typeof a==="number"?Jd(a):Hd(a)} function Pd(a,b){b=b===void 0?!1:b;var c=typeof a;if(a==null)return a;if(c==="bigint")return String(pd(64,a));if(xd(a))return c==="string"?Hd(a):b?Id(a):Jd(a)} function Qd(a){var b=typeof a;if(a==null)return a;if(b==="bigint")return $c(pd(64,a));if(xd(a))return b==="string"?eca(a):fca(a)} function kca(a){var b=void 0;b!=null||(b=Ab?1024:0);if(!xd(a))throw yc("uint64");var c=typeof a;switch(b){case 512:switch(c){case "string":return Nd(a);case "bigint":return String(qd(64,a));default:return Md(a)}case 1024:switch(c){case "string":return jca(a);case "bigint":return $c(qd(64,a));default:return ica(a)}case 0:switch(c){case "string":return Nd(a);case "bigint":return $c(qd(64,a));default:return Ld(a)}default:return od(b,"Unknown format requested type for int64")}} function Rd(a){var b=typeof a;if(a==null)return a;if(b==="bigint")return $c(qd(64,a));if(xd(a))return b==="string"?jca(a):ica(a)} function Td(a){if(a==null)return a;var b=typeof a;if(b==="bigint")return String(pd(64,a));if(xd(a)){if(b==="string")return Hd(a);if(b==="number")return Jd(a)}} function Ud(a){if(a==null)return a;var b=typeof a;if(b==="bigint")return String(qd(64,a));if(xd(a)){if(b==="string")return Nd(a);if(b==="number")return Ld(a)}} function lca(a){if(a==null||typeof a=="string"||a instanceof uc)return a} function Vd(a){if(typeof a!=="string")throw Error();return a} function Wd(a){if(a!=null&&typeof a!=="string")throw Error();return a} function Xd(a){return a==null||typeof a==="string"?a:void 0} function Yd(a,b,c,e){if(a!=null&&Pc(a))return a;if(!Array.isArray(a))return c?e&2?b[Ec]||(b[Ec]=mca(b)):new b:void 0;c=a[Ic]|0;e=c|e&32|e&2;e!==c&&Kc(a,e);return new b(a)} function mca(a){a=new a;Mc(a.Aa);return a} ;var nca={};function Zd(a){return a} ;function oca(a,b){if(typeof b==="string")try{b=qc(b)}catch(c){return!1}return rc(b)&&mba(a,b)} function pca(a){switch(a){case "bigint":case "string":case "number":return!0;default:return!1}} function qca(a,b){if(Pc(a))a=a.Aa;else if(!Array.isArray(a))return!1;if(Pc(b))b=b.Aa;else if(!Array.isArray(b))return!1;return $d(a,b,void 0,2)} function ae(a,b,c){return $d(a,b,c,0)} function $d(a,b,c,e){if(a===b||a==null&&b==null)return!0;if(a instanceof Map)return rca(a,b,c);if(b instanceof Map)return rca(b,a,c);if(a==null||b==null)return!1;if(a instanceof uc)return rba(a,b);if(b instanceof uc)return rba(b,a);if(rc(a))return oca(a,b);if(rc(b))return oca(b,a);var f=typeof a,h=typeof b;if(f!=="object"||h!=="object")return Number.isNaN(a)||Number.isNaN(b)?String(a)===String(b):pca(f)&&pca(h)?""+a===""+b:f==="boolean"&&h==="number"||f==="number"&&h==="boolean"?!a===!b:!1;if(Pc(a)|| Pc(b))return qca(a,b);if(a.constructor!=b.constructor)return!1;if(a.constructor===Array){h=a[Ic]|0;var k=b[Ic]|0,l=a.length,p=b.length,r=Math.max(l,p);f=(h|k|64)&128?0:-1;if(e===1||(h|k)&1)e=1;else if((h|k)&8192)return sca(a,b);h=l&&a[l-1];k=p&&b[p-1];h!=null&&typeof h==="object"&&h.constructor===Object||(h=null);k!=null&&typeof k==="object"&&k.constructor===Object||(k=null);l=l-f-+!!h;p=p-f-+!!k;for(var t=0;t b.length)return!1;b=nd(b);Array.prototype.sort.call(b,je);for(var e=0,f=void 0,h=b.length-1;h>=0;h--){var k=b[h];if(!k||!Array.isArray(k)||k.length!==2)return!1;var l=k[0];if(l!==f){f=void 0;if(!ae(a.get(l),k[1],(f=c)==null?void 0:f.o(2)))return!1;f=l;e++}}return e===a.size} function sca(a,b){if(!Array.isArray(a)||!Array.isArray(b))return!1;a=nd(a);b=nd(b);Array.prototype.sort.call(a,je);Array.prototype.sort.call(b,je);var c=a.length,e=b.length;if(c===0&&e===0)return!0;for(var f=0,h=0;f =c&&h>=e} function yca(a){return[a,this.get(a)]} var Bca;function Cca(){return Bca||(Bca=new ee(Mc([]),void 0,void 0,void 0,uca))} ;function ke(a){var b=jb(Gc);return b?a[b]:void 0} function le(){} function me(a,b){for(var c in a)!isNaN(c)&&b(a,+c,a[c])} function Dca(a){var b=new le;me(a,function(c,e,f){b[e]=nd(f)}); b.zG=a.zG;return b} function Eca(a,b){a=a.Aa;var c=jb(Gc);c&&c in a&&(a=a[c])&&delete a[b]} var Fca={yV:!0};function Gca(a,b){var c=c===void 0?!1:c;if(jb(Cba)&&jb(Gc)&&void 0===Cba){var e=a.Aa,f=e[Gc];if(!f)return;if(f=f.zG)try{f(e,b,Fca);return}catch(h){qb(h)}}c&&Eca(a,b)} function Hca(a,b){var c=jb(Gc),e;Bc&&c&&((e=a[c])==null?void 0:e[b])!=null&&zc(xba,3)} function Ica(a,b){b =k){var pa=y-t,ta=void 0;((ta=b)!=null?ta:b={})[pa]=E}else h[y]=E}if(w)for(var Aa in w)l= w[Aa],l!=null&&(l=c(l,e))!=null&&(y=+Aa,E=void 0,r&&!Number.isNaN(y)&&(E=y+t) 0?void 0:a===0?Nca||(Nca=[0,void 0]):[-a,void 0];case "string":return[0,a];case "object":return a}} function re(a,b){return Pca(a,b[0],b[1])} function se(a,b,c){return Pca(a,b,c,2048)} function Pca(a,b,c,e){e=e===void 0?0:e;if(a==null){var f=32;c?(a=[c],f|=128):a=[];b&&(f=f&-16760833|(b&1023) =1024)throw Error("pvtlmt");for(var p in l)h= +p,h 1024)throw Error("spvt");f=f&-16760833|(p&1023) =h){var k=a[h];if(k!=null&&typeof k==="object"&&k.constructor===Object){c=k[b];var l=!0}else if(f===h)c=k;else return}else c=a[f];if(e&&c!=null){e=e(c);if(e==null)return e;if(!Object.is(e,c))return l?k[b]=e:a[f]=e,e}return c}} function Ce(a,b,c,e){xe(a);var f=a.Aa;De(f,f[Ic]|0,b,c,e);return a} function De(a,b,c,e,f){var h=c+(f?0:-1),k=a.length-1;if(k>=1+(f?0:-1)&&h>=k){var l=a[k];if(l!=null&&typeof l==="object"&&l.constructor===Object)return l[c]=e,b}if(h >14&1023||536870912;c>=k?e!=null&&(h={},a[k+(f?0:-1)]=(h[c]=e,h)):a[h]=e}return b} function Ee(a,b,c){a=a.Aa;return Fe(a,a[Ic]|0,b,c)!==void 0} function Ge(a,b,c,e){var f=a.Aa;return Fe(f,f[Ic]|0,b,He(a,e,c))!==void 0} function Ie(a,b){return Ke(a,a[Ic]|0,b)} function Le(a,b,c){var e=a.Aa;return Me(a,e,e[Ic]|0,b,c,3).length} function Ne(a,b,c,e,f){Oe(a,b,c,f,e,1);return a} function Pe(a){return a===Vc?2:4} function Qe(a,b,c,e,f,h,k){var l=a.Aa,p=l[Ic]|0;e=Qc(a,p)?1:e;f=!!f||e===3;e===2&&we(a)&&(l=a.Aa,p=l[Ic]|0);var r=Re(l,b,k),t=r===Jc?7:r[Ic]|0,w=Se(t,p);var y=w;4&y?h==null?a=!1:(!f&&h===0&&(512&y||1024&y)&&(a.constructor[wba]=(a.constructor[wba]|0)+1) 32)for(e|=(l&127)>>4,f=3;f >>0,e>>>0);throw Error();} function dda(a){return og(a,function(b,c){return aca(b,c,Yba)})} function qg(a,b){a.o=b;if(b>a.oa)throw Error();} function rg(a){var b=a.ma,c=a.o,e=b[c++],f=e&127;if(e&128&&(e=b[c++],f|=(e&127) >>0} function tg(a){return og(a,kd)} function ug(a){return og(a,ld)} function vg(a){return og(a,Yba)} function wg(a){var b=a.ma,c=a.o,e=b[c+0],f=b[c+1],h=b[c+2];b=b[c+3];qg(a,a.o+4);return(e >>0} function xg(a){var b=wg(a);a=wg(a);return Xba(b,a)} function yg(a){var b=wg(a);a=(b>>31)*2+1;var c=b>>>23&255;b&=8388607;return c==255?b?NaN:a*Infinity:c==0?a*1.401298464324817E-45*b:a*Math.pow(2,c-150)*(b+8388608)} function zg(a){var b=wg(a),c=wg(a);a=(c>>31)*2+1;var e=c>>>20&2047;b=4294967296*(c&1048575)+b;return e==2047?b?NaN:a*Infinity:e==0?a*4.9E-324*b:a*Math.pow(2,e-1075)*(b+4503599627370496)} function Ag(a){for(var b=0,c=a.o,e=c+10,f=a.ma;c a.oa)throw Error();a.o=b;return c} function gda(a,b){if(b==0)return vc();var c=fda(a,b);a.Ww&&a.qa?c=a.ma.subarray(c,c+b):(a=a.ma,b=c+b,c=c===b?new Uint8Array(0):Vba?a.slice(c,b):new Uint8Array(a.subarray(c,b)));return c.length==0?vc():new uc(c,tc)} var mg=[];function hda(a,b,c,e){if(mg.length){var f=mg.pop();f.init(a,b,c,e);a=f}else a=new cda(a,b,c,e);this.ma=a;this.qa=this.ma.getCursor();this.o=this.ua=this.oa=-1;this.setOptions(e)} n=hda.prototype;n.setOptions=function(a){a=a===void 0?{}:a;this.UC=a.UC===void 0?!1:a.UC}; function ida(a,b,c,e){if(Bg.length){var f=Bg.pop();f.setOptions(e);f.ma.init(a,b,c,e);return f}return new hda(a,b,c,e)} n.free=function(){this.ma.clear();this.o=this.oa=this.ua=-1;Bg.length >>3,e=b&7;if(!(e>=0&&e =b?mb():(p=a[h++],l =b-1?mb():(p=a[h++],(p&192)!==128||l===224&&p =160||((f=a[h++])&192)!==128?(h--,mb()):c.push((l&15) =b-2?mb():(p=a[h++],(p&192)!==128||(l >30!==0||((f=a[h++])&192)!==128||((e=a[h++])&192)!==128?(h--,mb()):(l=(l&7) >10&1023)+55296,(l&1023)+56320))):mb(),c.length>=8192&&(k=vaa(k,c),c.length=0);h=vaa(k,c)}return h} function Fg(a){var b=sg(a.ma);return gda(a.ma,b)} function Gg(a,b,c){var e=sg(a.ma);for(e=a.ma.getCursor()+e;a.ma.getCursor() >>0;this.o=b>>>0} function kda(a){a=BigInt.asUintN(64,a);return new Hg(Number(a&BigInt(4294967295)),Number(a>>BigInt(32)))} function Ig(a){if(!a)return lda||(lda=new Hg(0,0));if(!/^\d+$/.test(a))return null;md(a);return new Hg(bd,cd)} var lda;function Jg(a,b){this.ma=a>>>0;this.o=b>>>0} function mda(a){a=BigInt.asUintN(64,a);return new Jg(Number(a&BigInt(4294967295)),Number(a>>BigInt(32)))} function Kg(a){if(!a)return nda||(nda=new Jg(0,0));if(!/^-?\d+$/.test(a))return null;md(a);return new Jg(bd,cd)} var nda;function Lg(){this.o=[]} Lg.prototype.length=function(){return this.o.length}; Lg.prototype.end=function(){var a=this.o;this.o=[];return a}; function Mg(a,b,c){for(;c>0||b>127;)a.o.push(b&127|128),b=(b>>>7|c >>0,c>>>=7;a.o.push(b)} function Og(a,b){for(;b>127;)a.o.push(b&127|128),b>>>=7;a.o.push(b)} function Pg(a,b){if(b>=0)Og(a,b);else{for(var c=0;c >=7;a.o.push(1)}} function oda(a,b){md(b);Zba(function(c,e){Mg(a,c>>>0,e>>>0)})} Lg.prototype.writeUint8=function(a){this.o.push(a>>>0&255)}; function Qg(a,b){a.o.push(b>>>0&255);a.o.push(b>>>8&255);a.o.push(b>>>16&255);a.o.push(b>>>24&255)} Lg.prototype.writeInt8=function(a){this.o.push(a>>>0&255)};function pda(){this.oa=[];this.ma=0;this.o=new Lg} function Rg(a,b){b.length!==0&&(a.oa.push(b),a.ma+=b.length)} function Sg(a,b){Tg(a,b,2);b=a.o.end();Rg(a,b);b.push(a.ma);return b} function Ug(a,b){var c=b.pop();for(c=a.ma+a.o.length()-c;c>127;)b.push(c&127|128),c>>>=7,a.ma++;b.push(c);a.ma++} function Tg(a,b,c){Og(a.o,b*8+c)} function qda(a,b,c){if(c!=null)switch(Tg(a,b,0),typeof c){case "number":a=a.o;fd(c);Mg(a,bd,cd);break;case "bigint":c=mda(c);Mg(a.o,c.ma,c.o);break;default:c=Kg(c),Mg(a.o,c.ma,c.o)}} function rda(a,b,c){if(c!=null)switch(sda(c),Tg(a,b,1),typeof c){case "number":a=a.o;ed(c);Qg(a,bd);Qg(a,cd);break;case "bigint":c=kda(c);a=a.o;b=c.o;Qg(a,c.ma);Qg(a,b);break;default:c=Ig(c),a=a.o,b=c.o,Qg(a,c.ma),Qg(a,b)}} function tda(a,b,c){c!=null&&(c=parseInt(c,10),Tg(a,b,0),Pg(a.o,c))} function Wg(a,b,c){Tg(a,b,2);Og(a.o,c.length);Rg(a,a.o.end());Rg(a,c)} function Xg(a,b,c,e){c!=null&&(b=Sg(a,b),e(c,a),Ug(a,b))} function uda(a){switch(typeof a){case "string":Kg(a)}} function sda(a){switch(typeof a){case "string":Ig(a)}} ;function Yg(){function a(){throw Error();} Object.setPrototypeOf(a,a.prototype);return a} var Zg=Yg(),vda=Yg(),$g=Yg(),ah=Yg(),bh=Yg(),wda=Yg(),xda=Yg(),ch=Yg(),yda=Yg(),zda=Yg(),dh=Yg(),eh=Yg(),fh=Yg(),gh=Yg(),hh=Yg();function ih(a,b,c){this.Aa=se(a,b,c)} n=ih.prototype;n.toJSON=function(){return Lca(this)}; n.serialize=function(a){return JSON.stringify(Lca(this,a))}; function jh(a,b){if(b==null||b=="")return new a;b=JSON.parse(b);if(!Array.isArray(b))throw Error("dnarr");return new a(Oc(b))} function kh(a,b){return a===b||a==null&&b==null||!(!a||!b)&&a instanceof b.constructor&&qca(a,b)} n.clone=function(){var a=this.Aa,b=a[Ic]|0;return ve(this,a,b)?ue(this,a,!0):new this.constructor(te(a,b,!1))}; n.Gr=function(){return!Qc(this)}; function lh(a,b,c){Eca(a,b.fieldIndex);return b.ctor?b.oa(a,b.ctor,b.fieldIndex,c,b.o):b.oa(a,b.fieldIndex,c,b.o)} n.toBuilder=function(){return he(this)}; ih.prototype[Aba]=Hba;ih.prototype.toString=function(){return this.Aa.toString()}; function Ada(a,b){if(b==null)return new a;if(!Array.isArray(b))throw Error();if(Object.isFrozen(b)||Object.isSealed(b)||!Object.isExtensible(b))throw Error();return new a(Oc(b))} ;function mh(a,b,c){this.o=a;this.ma=b;a=jb(Zg);(a=!!a&&c===a)||(a=jb(vda),a=!!a&&c===a);this.oa=a} function nh(a,b){var c=c===void 0?Zg:c;return new mh(a,b,c)} function Bda(a,b,c,e,f){Xg(a,c,oh(b,e),f)} var Cda=nh(function(a,b,c,e,f){if(a.o!==2)return!1;Dg(a,kf(b,e,c),f);return!0},Bda),Dda=nh(function(a,b,c,e,f){if(a.o!==2)return!1; Dg(a,kf(b,e,c),f);return!0},Bda),qh=Symbol(),rh=Symbol(),sh=Symbol(),Eda=Symbol(),Fda=Symbol(),th,uh; function vh(a,b,c,e){var f=e[a];if(f)return f;f={};f.NQ=e;f.Hv=Oca(e[0]);var h=e[1],k=1;h&&h.constructor===Object&&(f.extensions=h,h=e[++k],typeof h==="function"&&(f.lL=!0,th!=null||(th=h),uh!=null||(uh=e[k+1]),h=e[k+=2]));for(var l={};h&&Gda(h);){for(var p=0;p 0} function Hda(a){return Array.isArray(a)?a[0]instanceof mh?a:[Dda,a]:[a,void 0]} function oh(a,b){if(a instanceof ih)return a.Aa;if(Array.isArray(a))return re(a,b)} ;function wh(a,b,c,e){var f=c.o;a[b]=e?function(h,k,l){return f(h,k,l,e)}:f} function xh(a,b,c,e,f){var h=c.o,k,l;a[b]=function(p,r,t){return h(p,r,t,l||(l=vh(rh,wh,xh,e).Hv),k||(k=yh(e)),f)}} function yh(a){var b=a[sh];if(b!=null)return b;var c=vh(rh,wh,xh,a);b=c.lL?function(e,f){return th(e,f,c)}:function(e,f){for(;jda(f)&&f.o!=4;){var h=f.oa,k=c[h]; if(k==null){var l=c.extensions;l&&(l=l[h])&&(l=Ida(l),l!=null&&(k=c[h]=l))}if(k==null||!k(f,e,h)){k=f;l=k.qa;Cg(k);if(k.UC)var p=void 0;else{var r=k.ma.getCursor()-l;k.ma.setCursor(l);p=gda(k.ma,r)}r=l=k=void 0;var t=e;p&&((k=(l=(r=t[Gc])!=null?r:t[Gc]=new le)[h])!=null?k:l[h]=[]).push(p)}}if(e=ke(e))e.zG=c.NQ[Fda];return!0}; a[sh]=b;a[Fda]=Jda.bind(a);return b} function Jda(a,b,c,e){var f=this[rh],h=this[sh],k=re(void 0,f.Hv),l=ke(a);if(l){var p=!1,r=f.extensions;if(r){f=function(pa,ta,Aa){if(Aa.length!==0)if(r[ta])for(pa=v(Aa),ta=pa.next();!ta.done;ta=pa.next()){ta=ida(ta.value);try{p=!0,h(k,ta)}finally{ta.free()}}else e==null||e(a,ta,Aa)}; if(b==null)me(l,f);else if(l!=null){var t=l[b];t&&f(l,b,t)}if(p){var w=a[Ic]|0;if(w&2&&w&2048&&(c==null||!c.yV))throw Error();var y=Xc(w),E=function(pa,ta){if(Be(a,pa,y)!=null)switch(c==null?void 0:c.Sqa){case 1:return;default:throw Error();}ta!=null&&(w=De(a,w,pa,ta,y));delete l[pa]}; b==null?Kba(k,k[Ic]|0,function(pa,ta){E(pa,ta)}):E(b,Be(k,b,y))}}}} function Ida(a){a=Hda(a);var b=a[0].o;if(a=a[1]){var c=yh(a),e=vh(rh,wh,xh,a).Hv;return function(f,h,k){return b(f,h,k,e,c)}}return b} ;function zh(a,b,c){a[b]=c.ma} function Ah(a,b,c,e){var f,h,k=c.ma;a[b]=function(l,p,r){return k(l,p,r,h||(h=vh(qh,zh,Ah,e).Hv),f||(f=Kda(e)))}} function Kda(a){var b=a[Eda];if(!b){var c=vh(qh,zh,Ah,a);b=function(e,f){return Lda(e,f,c)}; a[Eda]=b}return b} function Lda(a,b,c){Kba(a,a[Ic]|0,function(e,f){if(f!=null){var h=Mda(c,e);h?h(b,f,e):e >BigInt(63);bd=Number(BigInt.asUintN(32,b));cd=Number(BigInt.asUintN(32,b>>BigInt(32)));Mg(a,bd,cd);break;default:oda(a.o,b)}},zda),oea=[!0, x,ci],Ai=[!0,x,hi],pea=[!0,x,x];function Bi(a,b,c){this.fieldIndex=a;this.ctor=c;this.isRepeated=0;this.ma=lf;this.oa=of;this.defaultValue=void 0;this.o=b.messageId!=null?Lba:void 0} Bi.prototype.register=function(){Zb(this)};function Ci(a,b){return function(c,e){var f={gB:!0};e&&Object.assign(f,e);c=ida(c,void 0,void 0,f);try{var h=new a,k=h.Aa;yh(b)(k,c);var l=h}finally{c.free()}return l}} function Di(a){return function(){return Pda(this,a)}} function Ei(a){return Yc(function(b){return b instanceof a&&!Qc(b)})} function Fi(a){return function(b){return jh(a,b)}} ;var qea=[0,[4],vi,2,oi,[0,hi,-1]];var Gi=[0,vi];var rea=[0,Gi,qea,Wh];var sea=[0,vi,bi,Wh];function Hi(a){this.Aa=se(a)} u(Hi,ih);Hi.prototype.getLanguage=function(){return Ef(this,3)}; Hi.prototype.setLanguage=function(a){return dg(this,3,a)};var tea=[0,x,Wh,x];Hi.prototype.Ca=Di(tea);var uea=[0,Wh,-1];function Ii(a){this.Aa=se(a)} u(Ii,ih);var Ji=[2,3];var Ki=[0,Ji,Wh,oi,uea,oi,tea];Ii.prototype.Ca=Di(Ki);var Li=[0,vi,bi];var vea=[0,x,-1];function Mi(a){this.Aa=se(a)} u(Mi,ih);Mi.prototype.Tf=function(){return Ef(this,4)};var Ni=[0,Wh,vi,hi,x,-1,ni,vea,vi,-1,ni,[0,[5,6,7,8],x,-3,oi,[0,x,-2],oi,[0,x,-3,ni,[0,x,-5]],oi,[0,x,-2],oi,[0,x,-1]],hi];Mi.prototype.Ca=Di(Ni);var Oi=[0,Wh,-1];function Pi(a){this.Aa=se(a)} u(Pi,ih);Pi.prototype.getType=function(){return Ff(this,1,1)}; Pi.prototype.setType=function(a){return fg(this,1,a)};var wea=[0,vi,Oi,-1,Wh,-1,Oi,-3];Pi.prototype.Ca=Di(wea);function Qi(a){this.Aa=se(a)} u(Qi,ih);Qi.prototype.getId=function(){return Cf(this,1)}; Qi.prototype.setId=function(a){return $f(this,1,a)}; function Ri(a){return wf(a,1)} ;function Si(a){this.Aa=se(a)} u(Si,ih);Si.prototype.getState=function(){return Ff(this,1)}; Si.prototype.getVisibility=function(){return Ff(this,2)}; Si.prototype.setVisibility=function(a){return fg(this,2,a)}; Si.prototype.clearOffTopic=function(){return Ce(this,7)};function Ti(a){this.Aa=se(a)} u(Ti,ih);n=Ti.prototype;n.getInfo=function(){return lf(this,Qi,1)}; n.getIndex=function(){return Df(this,2)}; n.getMetadata=function(){return lf(this,Si,5)}; n.Lf=function(a){return of(this,Si,5,a)}; n.getTypeInfo=function(){return lf(this,Pi,6)}; n.aE=la(0);n.getLanguage=function(){return Ef(this,39)}; n.setLanguage=function(a){return dg(this,39,a)}; n.gp=la(2);var xea=[0,vi,Wh,-1];var Ui=[0,[4,5,6,7],vi,Wh,-1,zi,-3];var Vi=[0,Ph,-1,hi,x,-2];var Wi=[0,x,-1,ci,x,vi,-1,Gi,x,vi,-1,x,hi];var yea=[0,x,-3,ni,[0,x,-1,vi],ki];var Xi=[0,Wh,ai,Wh,bi];Qi.prototype.Ca=Di(Xi);var zea=[0,hi,bi,hi,wi];var Yi=[0,vi,-1,hi,Gi,x,-1,hi,-2,zea];Si.prototype.Ca=Di(Yi);var Zi=[0,qi,bi,-1,x];var $i=[0,Xi,bi,Wh,x,Yi,wea,-1,1,ni,Wi,1,vi,bi,vi,yea,x,Wh,bi,17,Vi,xea,Wh,ni,Zi,x,-1,1,Ni,Ui,ni,Ni,Li];Ti.prototype.Ca=Di($i);var Aea=[0,vi,bi];var Bea=[0,x,-1];var Cea=[0,x,-1];function aj(a){this.Aa=se(a)} u(aj,ih);n=aj.prototype;n.getKey=function(){return Of(this,1)}; n.setKey=function(a){return dg(this,1,a)}; n.getValue=function(){return Of(this,2)}; n.setValue=function(a){return dg(this,2,a)}; n.Tb=function(){return ig(this,2)};var Dea=[0,x,-1];aj.prototype.Ca=Di(Dea);var Eea=[0,Wh,-2,bi,vi,[0,vi,-1,Wh,-1],Wh];function bj(a){this.Aa=se(a)} u(bj,ih);n=bj.prototype;n.getInfo=function(){return lf(this,Qi,1)}; n.Ms=la(4);n.getTitle=function(){return Of(this,9)}; n.setTitle=function(a){return dg(this,9,a)}; n.getLanguage=function(){return Of(this,14)}; n.setLanguage=function(a){return dg(this,14,a)}; n.getState=function(){return Ff(this,15,10)}; n.setProperty=function(a,b){return Ne(this,16,aj,a,b)}; n.getMetadata=function(){return lf(this,Si,12)}; n.Lf=function(a){return of(this,Si,12,a)}; n.bE=la(5);n.Bc=function(){return Of(this,22)}; n.Yb=function(){return Jf(this,44)}; n.Lc=function(a,b){return af(this,44,Vd,a,b,Xd)}; n.lw=la(6);var cj=[49,50];var Fea=[0,vi,Ph,Wh,-1];var Gea=[0,x,hi,x,Wh,1,x,-1,Wh,1,x,Wh,vi,-1];var Hea=[0,Wh,vi,x];var Iea=[0,x,-6,ki,hi,2,Wh,[0,x,ui,-1],-4];var Jea=[0,Iea,Gea,vi,ni,Hea,hi];var dj=[0,cj,Xi,2,hi,-1,1,Wh,bi,x,bi,1,Yi,x,-1,vi,ni,Dea,bi,ni,Wi,1,bi,vi,x,bi,vi,hi,Ki,yea,vi,x,-1,Wh,vi,Xh,ni,Eea,Vi,hi,Wh,xea,bi,ni,Fea,bi,1,Ki,ki,x,ki,ni,Zi,x,oi,Bea,oi,Cea,hi,Jea,bi,x,Ui,hi,Aea,Li,x];bj.prototype.Ca=Di(dj);var ej=[0,vi,hi];var Kea=[0,ui,-2];var Lea=[0,hi,-4];var Mea=[0,5,Rh,hi,-1,vi];var fj=[0,1,Wh,vi,ki,wi];var gj=[0,fj,Mea,ni,Kea,-6];var Nea=[0,rea,-2,ci,hi,Yh,ni,sea];function hj(a){this.Aa=se(a)} u(hj,ih);hj.prototype.getLanguage=function(a){return Jf(this,5,a)}; hj.prototype.setLanguage=function(a,b){return af(this,5,Vd,a,b,Xd)};var Oea=[0,x,hi,-2,ki,x,hi,Xh,hi,x,bi,x,Lea,ej,vi,-1,x,hi,-2,Wh,hi,Wh,hi,-1,Yh,Wh,-1,hi];hj.prototype.Ca=Di(Oea);function ij(a){this.Aa=se(a)} u(ij,ih);ij.prototype.getName=function(){return Ef(this,1)}; ij.prototype.Sf=function(){return Of(this,1)}; ij.prototype.setName=function(a){return dg(this,1,a)}; ij.prototype.tf=la(10);var jj=[0,x,-1,Wh,x,-3];ij.prototype.Ca=Di(jj);function kj(a){this.Aa=se(a)} u(kj,ih);function lj(a,b){return of(a,ij,2,b)} kj.prototype.yk=la(11);kj.prototype.gH=function(a){return of(this,hj,3,a)};var mj=[0,Wh,jj,Oea,hi,-1,Gi,Wi,Nea,hi,Ui];kj.prototype.Ca=Di(mj);var Pea=[0,ki];var Qea=[0,x];var nj=[0,x,-1];var oj=[0,Wh,-2,ni,nj,x,hi,-1];var Rea=[0,Wh,-2,x,-1];function pj(a){this.Aa=se(a)} u(pj,ih);pj.prototype.getSeconds=function(){return Cf(this,1)}; pj.prototype.setSeconds=function(a){return Ye(this,1,Kd(a),"0")}; pj.prototype.getNanos=function(){return Bf(this,2)}; pj.prototype.setNanos=function(a){return Ye(this,2,Cd(a),0)}; function qj(a){var b=Number;var c=c===void 0?"0":c;var e;var f=(e=ada(a,1))!=null?e:c;b=b(f);a=a.getNanos();return new Date(b*1E3+a/1E6)} function rj(){var a=new Date(Date.now()),b=new pj;a=a.getTime();Number.isFinite(a)||(a=0);return b.setSeconds(Math.floor(a/1E3)).setNanos((a%1E3+1E3)%1E3*1E6)} ;function sj(a){this.Aa=se(a)} u(sj,ih);var tj=[0,Zh,fi];pj.prototype.Ca=Di(tj);var uj=[0,ni,oj,x,Gh,Ai,ni,Qea,ni,Rea,x,[0,[0,vi,tj],tj],Gh,[!0,Wh,Pea]];sj.prototype.Ca=Di(uj);var vj=[0,ni,function(){return vj}, x,-3,Xh,hi,ni,function(){return vj}, hi,vi,x,vi,x,-1,vi];function wj(a){this.Aa=se(a)} u(wj,ih);n=wj.prototype;n.getName=function(){return Ef(this,1)}; n.Sf=function(){return Of(this,1)}; n.setName=function(a){return dg(this,1,a)}; n.tf=la(9);n.Uo=function(){return Af(this,3)}; n.Qh=function(a){return Xf(this,3,a)};var xj=[0,x,-1,hi,Wh];wj.prototype.Ca=Di(xj);function yj(a){this.Aa=se(a)} u(yj,ih);yj.prototype.getFrdIdentifier=function(){return Ff(this,1)}; function zj(a,b){return fg(a,1,b)} yj.prototype.Yq=function(){return Ff(this,2)}; yj.prototype.Wc=function(a){return fg(this,2,a)};function Aj(a){this.Aa=se(a)} u(Aj,ih);Aj.prototype.Lg=function(a){return Xe(this,1,a,cca)}; Aj.prototype.getValue=function(a){var b=Kf(this,3,void 0,!0);Tc(b,a);return b[a]}; Aj.prototype.setValue=function(a,b){return af(this,1,cca,a,b,Ve)};function Bj(a){this.Aa=se(a)} u(Bj,ih);function Cj(a){return Qe(a,1,Qd,1,void 0,1024)} function Sea(a,b){return Xe(a,1,b,Gd)} ;function Dj(a){this.Aa=se(a)} u(Dj,ih);function Ej(a){return Qe(a,1,Qd,1,void 0,1024)} Dj.prototype.Lg=function(a){return Xe(this,1,a,Gd)}; Dj.prototype.getValue=function(a){return Hf(this,1,a)}; Dj.prototype.setValue=function(a,b){return af(this,1,Gd,a,b,Od)};function Fj(a){this.Aa=se(a)} u(Fj,ih);function Gj(a){return nf(a,Dj,1,Pe())} function Hj(a,b){return qf(a,1,b)} ;function Ij(a){this.Aa=se(a)} u(Ij,ih);function Jj(a,b){return If(a,1,Pe(b))} Ij.prototype.Lg=function(a){return Xe(this,1,a,Vd)}; Ij.prototype.getValue=function(a){return Jf(this,1,a)}; Ij.prototype.setValue=function(a,b){return af(this,1,Vd,a,b,Xd)};function Kj(a){this.Aa=se(a)} u(Kj,ih);function Lj(a){return Pf(a,Ij,8,Rf)} function Mj(a,b){return pf(a,8,Rf,b)} n=Kj.prototype;n.zg=function(){return Pf(this,Dj,2,Rf)}; n.Ji=function(a){return pf(this,2,Rf,a)}; n.ej=function(){return Pf(this,Ij,3,Rf)}; n.Kg=function(a){return pf(this,3,Rf,a)}; function Nj(a){return Pf(a,Bj,4,Rf)} function Oj(a,b){return pf(a,4,Rf,b)} function Pj(a){return Pf(a,Aj,5,Rf)} function Qj(a,b){return pf(a,5,Rf,b)} n.hm=function(){return Pf(this,Fj,6,Rf)}; n.hw=function(a){return pf(this,6,Rf,a)}; n.Uo=function(){return Lf(this,7,Rf)}; n.Qh=function(a){return bf(this,7,Rf,vd(a))}; var Rf=[2,3,4,5,6,7,8];function Rj(a){this.Aa=se(a)} u(Rj,ih);Rj.prototype.getFrdContext=function(){return lf(this,yj,1)}; function Sj(a,b){return of(a,yj,1,b)} Rj.prototype.Oy=function(){return Ee(this,yj,1)}; Rj.prototype.getFrdIdentifier=function(){return Ff(this,5)}; function Tj(a,b){return fg(a,5,b)} function Uj(a){return lf(a,Kj,2)} function Vj(a,b){return of(a,Kj,2,b)} Rj.prototype.setFieldName=function(a){return dg(this,4,a)};var Wj=[0,Wh,x];var Yj=[0,vi,-1];yj.prototype.Ca=Di(Yj);var Tea=[0,ri];Aj.prototype.Ca=Di(Tea);var Uea=[0,Xh];Bj.prototype.Ca=Di(Uea);var Zj=[0,Xh];Dj.prototype.Ca=Di(Zj);var Vea=[0,ni,Zj];Fj.prototype.Ca=Di(Vea);var ak=[0,ki];Ij.prototype.Ca=Di(ak);var bk=[0,Rf,1,oi,Zj,oi,ak,oi,Uea,oi,Tea,oi,Vea,ji,oi,ak];Kj.prototype.Ca=Di(bk);var ck=[0,Yj,bk,vi,x,vi,bk];Rj.prototype.Ca=Di(ck);var Wea=[0,1,x,3,x,vi,2,x];var Xea=[0,x,hi,-1,Xh,hi,x,-2];var Yea=[0,x,-4,ni,[0,x,Xh]];var dk=[0,x,-1,vi,x,Xh,x,-1,hi,91,x];var Zea=[0,x,-1,[0,ki],x];var $ea=[0,ni,nj];var afa=[0,x,-2,hi,ki,hi];var bfa=[0,x,Wh];var ek=[0,Wj,ck,-1,ni,ck];var cfa=[0,x,-2,vi];var dfa=[0,x,ni,[0,x,vi]];var efa=[0,x];var ffa=[0,x,vi];var gfa=[0,x,-2];var hfa=[0,vi,1,vi,ni,[0,vi,x,-1]];var ifa=[0,[4],vi,ci,x,gi,x];var jfa=[0,ni,[0,[2,3],x,oi,[0,ki],oi,[0,x],hi,-1],vi];var kfa=[0,x,-2];var lfa=[0,hi,ci];var mfa=[0,lfa];var nfa=[0,ci];var gk=[0,Gh,[!0,x,function(){return fk}]],fk=[0, [1,2,3,4,5,6],zi,Qh,mi,ji,oi,function(){return gk}, oi,function(){return ofa}],ofa=[0, ni,function(){return fk}];var pfa=[0,x,vi,[0,hi,ni,[0,vi,ni,[0,x,-2,fk]]],[0,hi,ni,[0,x,-1,ni,[0,x,-1]]]];var qfa=[0,ni,[0,x,ci,hi,vi,hi,vi,[0,vi,x],pfa],ci,vi,pfa,hi];var rfa=[0,vi,ni,nj];var sfa=[0,vi,2,wi];var tfa=[0,x,-1,ci];var ufa=[0,x,-1,hi,-1,x,-1,1,hi,Xh,ck,sfa,Yh,ki];function hk(a){this.Aa=se(a)} u(hk,ih);function ik(a,b){return qf(a,1,b)} function jk(a){var b=new hk;return rf(b,1,Rj,a)} var vfa=Fi(hk);function kk(a){this.Aa=se(a)} u(kk,ih);n=kk.prototype;n.getId=function(){return Ef(this,1)}; n.setId=function(a){return dg(this,1,a)}; n.getType=function(){return Ff(this,3)}; n.setType=function(a){return fg(this,3,a)}; n.getTitle=function(){return Ef(this,4)}; n.setTitle=function(a){return dg(this,4,a)}; n.getDescription=function(){return Ef(this,5)}; n.setDescription=function(a){return dg(this,5,a)}; n.getValue=function(){return Ef(this,6)}; n.setValue=function(a){return dg(this,6,a)}; n.Tb=function(){return ig(this,6)};function lk(a){this.Aa=se(a)} u(lk,ih);function mk(a){this.Aa=se(a)} u(mk,ih);function nk(a){this.Aa=se(a)} u(nk,ih);n=nk.prototype;n.getType=function(){return Ff(this,1)}; n.setType=function(a){return fg(this,1,a)}; n.getDescription=function(){return Ef(this,3)}; n.setDescription=function(a){return dg(this,3,a)}; n.getValue=function(){return Ef(this,4)}; n.setValue=function(a){return dg(this,4,a)}; n.Tb=function(){return ig(this,4)}; var ok=[10,17];function pk(a){this.Aa=se(a,3)} u(pk,ih);function qk(a){return lf(a,nk,1)} var wfa=Fi(pk);var rk=[0,ni,ck,Wh,x,Wj];hk.prototype.Ca=Di(rk);var xfa=[0,x,Xh,vi,x,-6,ki,-1,x,vi,-1,ni,ck,ni,rk,rk,x,-1];kk.prototype.Ca=Di(xfa);var yfa=[0,ci,x];lk.prototype.Ca=Di(yfa);var sk=[0,hi,x,-3];mk.prototype.Ca=Di(sk);var zfa=[0,ok,vi,x,-2,ci,x,ci,-2,mi,1,vi,-1,di,ni,rk,1,oi,yfa,1,sk,Xh,ni,[0,rk,vi]];nk.prototype.Ca=Di(zfa);var tk=[-3,{},zfa,xfa];pk.prototype.Ca=Di(tk);var Afa=[0,[27,28,29,30,31,35,38,40,41,43,45,46,47],x,-1,hi,vi,ni,ufa,x,rfa,tfa,x,-5,Xh,x,hi,ki,ni,ufa,vi,x,ci,hi,ci,uj,ki,oi,nfa,oi,jfa,oi,qfa,oi,hfa,oi,gfa,ck,sfa,x,oi,dfa,hi,1,oi,tk,vi,oi,mfa,oi,kfa,hi,oi,cfa,1,oi,ifa,oi,efa,oi,ffa,hi];function uk(a){this.Aa=se(a)} u(uk,ih);function vk(a){return lf(a,Rj,1)} function yk(a,b){return of(a,Rj,1,b)} ;var zk=[0,ck,ci,vi,wi,hi];uk.prototype.Ca=Di(zk);var Ak=[0,[0,x,-2],qi,3,x];var Bfa=[0,x,ki,ni,Afa,x,-2,2,x,-3,hi,-2,ki,ci,vi,1,ki,-1,afa,x,hi,-1,x,-1,1,hi,lfa,vi,x,ci,Xh,Ak,-1,uj,x,-1,bfa,2,ek,1,hi,-1,1,vi,ni,zk,x,-1,ci,Wh,46,x];var Bk=[0,ni,zk,Wj,vi,Xh];var Ck=[0,Zh,fi];function Dk(a){this.Aa=se(a)} u(Dk,ih);Dk.prototype.jr=function(){return Vf(this,1)}; Dk.prototype.getTimestamp=function(){return xf(this,5,ze)}; Dk.prototype.setTimestamp=function(a){return cg(this,5,a)};function Ek(a){this.Aa=se(a)} u(Ek,ih);Ek.prototype.getUrl=function(){return Of(this,1)}; Ek.prototype.setUrl=function(a){return dg(this,1,a)};function Fk(a){this.Aa=se(a)} u(Fk,ih);function Gk(a){this.Aa=se(a)} u(Gk,ih);n=Gk.prototype;n.getViews=function(){return wf(this,1,ze)}; n.getThumbnail=function(){return Of(this,2)}; n.hasThumbnail=function(){return ig(this,2)}; n.getTimestamp=function(){return xf(this,4,ze)}; n.setTimestamp=function(a){return cg(this,4,a)};function Hk(a){this.Aa=se(a)} u(Hk,ih);n=Hk.prototype;n.getUrl=function(){return Of(this,1)}; n.setUrl=function(a){return dg(this,1,a)}; n.getTitle=function(){return Of(this,2)}; n.setTitle=function(a){return dg(this,2,a)}; n.Td=function(){return Of(this,3)}; function Ik(a,b){return dg(a,3,b)} n.getLanguage=function(){return Of(this,10)}; n.setLanguage=function(a){return dg(this,10,a)}; n.getPageType=function(){return Wf(this,15)}; function Jk(a,b){return dg(a,21,b)} n.Rb=function(){return Of(this,22)}; function Kk(a,b){return dg(a,22,b)} function Lk(a){return lf(a,Dk,26)} function Mk(a){return lf(a,Gk,28)} ;function Nk(a){this.Aa=se(a)} u(Nk,ih);function Ok(a){return nf(a,Hk,1,Pe())} ;function Pk(a){this.Aa=se(a)} u(Pk,ih);Pk.prototype.dj=function(){return Of(this,3)}; Pk.prototype.Rb=function(){return Of(this,14)};function Qk(a){this.Aa=se(a)} u(Qk,ih);Qk.prototype.getActive=function(){return Uf(this,3)}; Qk.prototype.setActive=function(a){return Xf(this,3,a)};function Rk(a){this.Aa=se(a)} u(Rk,ih);function Sk(a){this.Aa=se(a)} u(Sk,ih);Sk.prototype.getQuery=function(){return Nf(this,1,Tk)}; Sk.prototype.setQuery=function(a){return bf(this,1,Tk,Wd(a))}; Sk.prototype.getStartIndex=function(){return Vf(this,2)}; var Tk=[1,5];function Uk(a){this.Aa=se(a)} u(Uk,ih);function Vk(a){this.Aa=se(a)} u(Vk,ih);function Wk(a){this.Aa=se(a)} u(Wk,ih);n=Wk.prototype;n.getId=function(){return Of(this,1)}; n.setId=function(a){return dg(this,1,a)}; n.getLanguage=function(){return Of(this,2)}; n.setLanguage=function(a){return dg(this,2,a)}; n.getName=funct | 2026-01-13T08:48:44 |
https://porkbun.com/products/email_forwarding | porkbun.com | Free Email Forwarding Toggle navigation porkbun $0.00 (0) products Domains Transfers Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting All Web Hosting Options Easy WordPress Link In Bio Articulation Sitebuilder Cloud WordPress Shared cPanel Hosting Static Hosting Website Builder Easy PHP Email Hosting All Email Hosting Options Proton Mail Porkbun Email Free Email Forwarding Marketing Tools Textla - SMS Marketing Free WHOIS Privacy Free SSL Certificates Free URL Forwarding transfer Free WordPress SALE! .COM SALE! About --> About Who We Are Why Choose Porkbun Porkbun vs Cloudflare FAQs Resources Knowledge Base Porkbun Blog Service Status Help $0.00 (0) sign in × Choose A Domain Cancel Submit Free Email Forwarding You've got email! Our email forwarding service allows you to receive email from an email address on your domain and have it sent to an existing email address that you already have. This is ideal if you’re only looking to receive emails sent to an email address on your domain but don’t need to respond from that same email address. We offer up to 20 free email forwarding addresses with each domain, with additional forwarding addresses available for $3.00 per address per year. Get Organized with Free Email Forwarding Get started today by registering a domain! Find New Domain Why use email forwarding? Email forwarding is great when you need to receive email at your domain, but don't need the features of a dedicated inbox. Some use cases include: Set up a generic inbox like info@ or hello@ and forward to the appropriate person. Forward support emails to a helpdesk ticketing system such as Jira, Zendesk, Helpscout, etc. If you change your primary email or domain, forwarding can help ease the changeover. Sign up for services without having to risk your real email being exposed in a data breach. And many more! Learn more about email forwarding Visit our knowledge base to learn how to setup an email forwarding address. Need a full professional email solution for sending and receiving? Check out our email hosting . × Modal Title Close Close × Modal Title Close porkbun Porkbun is an amazingly awesome ICANN accredited domain name registrar based out of the Pacific Northwest. We're different, we're easy, and we're affordable. Use us, you won't be sorry. If you don't use us we'll be sad, but we'll still love you. Get Pork-Puns In Your Inbox Stay in the loop on all things Porkbun by signing up for our newsletter! 21370 SW Langer Farms Parkway, Suite 142-429 Sherwood, OR 97140, US If you're looking for support, you might be able to answer your own question using our Knowledge Base . Support Hours Impacted From January 3rd to January 11th we will be holding our annual company summit which will impact live and after hours support. Our goal is to provide you with an excellent domain registration experience and support and we all appreciate your patience as the whole company works together to make Porkbun even better. Thank you. Reach our USA-Based phone support team: 1.855.PORKBUN (1.855.767.5286) 9AM - 5PM Pacific Time Other Hours: Your mileage may vary, but give it a whirl support@porkbun.com 24 / 7 Email Support Chat Support Hours Vary Your browser does not support the audio element. This plays a little Porkbun jingle. Stay up to date with Porkbun. Sign up for our cool newsletter and we'll keep you up to date with sweet deals, amazing info, and maybe even the occasional limerick or sonnet. Sign Up Products Domain Names Greatest Deals Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting Link In Bio Articulation Sitebuilder Cloud WordPress cPanel Hosting Static Hosting Easy PHP Website Builder Email Hosting WHOIS Privacy DNS Management SSL Certificates Email Forwarding URL Forwarding Quick Connect Domain Transfer Affiliate Program Handshake Names Ethereum Name Service International Domain Names API Access Support Contact Us Knowledge Base Payment Options Report Abuse Tools Domain Search Domain Suggestion Generator RDAP (WHOIS) Password Generator Service Status Don't like our name? The Buniverse Your IP Address Online DNS Lookup Our Company About Us Our Official Blog Careers Branding Guidelines Policies and Legal Privacy Policy Data Disclosure Policy Bug Bounty Program Porkbun Merchandise Awesomeness Copyright © Porkbun LLC. All rights reserved. Porkbun is a Top Level Design Company Made in the USA 🇺🇸 This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. WARNING: This site has been known to cause a mind blowing experience. We recommend you prepare yourself mentally and if possible be sitting down. Side effects may include saving money, letting out a chuckle, and sporadic oinking. 1 × Modal Title Cancel Continue | 2026-01-13T08:48:44 |
https://porkbun.com/products/webhosting/managedPHP | porkbun.com | An oddly satisfying experience. Toggle navigation porkbun $0.00 (0) products Domains Transfers Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting All Web Hosting Options Easy WordPress Link In Bio Articulation Sitebuilder Cloud WordPress Shared cPanel Hosting Static Hosting Website Builder Easy PHP Email Hosting All Email Hosting Options Proton Mail Porkbun Email Free Email Forwarding Marketing Tools Textla - SMS Marketing Free WHOIS Privacy Free SSL Certificates Free URL Forwarding transfer Free WordPress SALE! .COM SALE! About --> About Who We Are Why Choose Porkbun Porkbun vs Cloudflare FAQs Resources Knowledge Base Porkbun Blog Service Status Help $0.00 (0) sign in × Choose A Domain READ ME: If you continue, your nameservers will be updated to our defaults and any conflicting DNS records will be deleted and replaced. Cancel Submit Easy PHP <? echo($funnyQuip); ?> Our dedicated PHP hosting gives you all of the tools you need to create secure and high performing custom PHP sites. Easily select between supported PHP versions, securely upload your files via SFTP, and store data in a MySQL database. SSH access is also available after passing a security screening. Standard Plans Choose the plan that's right for you!. Monthly Yearly * * Save 17% with yearly That's two months FREE Most popular! Starter Monthly FREE 15 day trial then $12.00 month Find a Domain Includes: 10GB disk space 10 subdomains 5 dedicated PHP processes 64M default memory limit 128M max memory limit Pro Monthly FREE 15 day trial then $24.00 month Find a Domain Includes: 20GB disk space 20 subdomains 10 dedicated PHP processes 64M default memory limit 256M max memory limit Most popular! Starter Yearly FREE 15 day trial then $120.00 save 50% $60.00 first year sale! Renews at $120.00 / year Find a Domain Includes: 10GB disk space 10 subdomains 5 dedicated PHP processes 64M default memory limit 128M max memory limit Pro Yearly FREE 15 day trial then $240.00 save 25% $180.00 first year sale! Renews at $240.00 / year Find a Domain Includes: 20GB disk space 20 subdomains 10 dedicated PHP processes 64M default memory limit 256M max memory limit Special Offer Buy one year of hosting and get one year of domain registration free! Free domain! Starter Yearly Easy PHP + Free Domain Bundle $60.00 for first year renews at $120.00 hosting + domain renewal (varies by TLD) per year Learn more Includes: FREE Domain Registration (select TLDs) 1 Year of Starter Yearly Easy PHP Available domain extensions: .app, .boo, .blog, .dad, .day, .dev, .email, .esq, .foo, .info, .ing, .meme, .mov, .nexus, .page, .phd, .prof, .rsvp, .zip. Included with all paid plans PHP Versions 7.4 and 8.0 Unmetered Bandwidth Free SSL Certificate Performance Enhancements SFTP Access SSH Access Available * MySQL Database Extra Security Easily Switch Between Plans Who Is Porkbun PHP Hosting Best For? So who is Porkbun Easy PHP hosting best for? This is a solid choice if you’re a student interested in web development, a power user (experienced coder), or someone who wants a database for your site or to run PHP scripts. It’s the most advanced of the Porkbun hosting options and is best if you want full control over your website and have the technical skillset to completely customize every component of it. Launch your hosting project the Easy PHP Way Choose your Easy PHP hosting plan and get started. Choose A Plan ☝️ The Fine print: Please note that while we want you to be able to host everything you need to make your website a success, this is a shared hosting environment and resource usage must be within reason. Disk space and bandwidth is meant for files needed for your website; not for archives, personal storage, backups, unrelated files, etc. Do not host your latest and greatest crypto mining / minting scheme on our hosting platforms, chances are that it will get blocked. Caveats: * For plans that include SSH you must first pass a basic security screening before being granted access. × Modal Title Close Close × Modal Title Close porkbun Porkbun is an amazingly awesome ICANN accredited domain name registrar based out of the Pacific Northwest. We're different, we're easy, and we're affordable. Use us, you won't be sorry. If you don't use us we'll be sad, but we'll still love you. Get Pork-Puns In Your Inbox Stay in the loop on all things Porkbun by signing up for our newsletter! 21370 SW Langer Farms Parkway, Suite 142-429 Sherwood, OR 97140, US If you're looking for support, you might be able to answer your own question using our Knowledge Base . Support Hours Impacted From January 3rd to January 11th we will be holding our annual company summit which will impact live and after hours support. Our goal is to provide you with an excellent domain registration experience and support and we all appreciate your patience as the whole company works together to make Porkbun even better. Thank you. Reach our USA-Based phone support team: 1.855.PORKBUN (1.855.767.5286) 9AM - 5PM Pacific Time Other Hours: Your mileage may vary, but give it a whirl support@porkbun.com 24 / 7 Email Support Chat Support Hours Vary Your browser does not support the audio element. This plays a little Porkbun jingle. Stay up to date with Porkbun. Sign up for our cool newsletter and we'll keep you up to date with sweet deals, amazing info, and maybe even the occasional limerick or sonnet. Sign Up Products Domain Names Greatest Deals Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting Link In Bio Articulation Sitebuilder Cloud WordPress cPanel Hosting Static Hosting Easy PHP Website Builder Email Hosting WHOIS Privacy DNS Management SSL Certificates Email Forwarding URL Forwarding Quick Connect Domain Transfer Affiliate Program Handshake Names Ethereum Name Service International Domain Names API Access Support Contact Us Knowledge Base Payment Options Report Abuse Tools Domain Search Domain Suggestion Generator RDAP (WHOIS) Password Generator Service Status Don't like our name? The Buniverse Your IP Address Online DNS Lookup Our Company About Us Our Official Blog Careers Branding Guidelines Policies and Legal Privacy Policy Data Disclosure Policy Bug Bounty Program Porkbun Merchandise Awesomeness Copyright © Porkbun LLC. All rights reserved. Porkbun is a Top Level Design Company Made in the USA 🇺🇸 This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. WARNING: This site has been known to cause a mind blowing experience. We recommend you prepare yourself mentally and if possible be sitting down. Side effects may include saving money, letting out a chuckle, and sporadic oinking. 1 × Modal Title Cancel Continue | 2026-01-13T08:48:44 |
https://parenting.forem.com/petrashka/i-built-a-free-baby-tracker-that-syncs-across-devices-without-requiring-an-account-35bp | I built a free baby tracker that syncs across devices without requiring an account - Parenting Forem Feed Follow new Subforems to improve your feed DEV Community Follow A space to discuss and keep up software development and manage your software career Future Follow News and discussion of science and technology such as AI, VR, cryptocurrency, quantum computing, and more. Open Forem Follow A general discussion space for the Forem community. If it doesn't have a home elsewhere, it belongs here Gamers Forem Follow An inclusive community for gaming enthusiasts Music Forem Follow From composing and gigging to gear, hot music takes, and everything in between. Vibe Coding Forem Follow Discussing AI software development, and showing off what we're building. Popcorn Movies and TV Follow Movie and TV enthusiasm, criticism and everything in-between. DUMB DEV Community Follow Memes and software development shitposting Design Community Follow Web design, graphic design and everything in-between Security Forem Follow Your central hub for all things security. From ethical hacking and CTFs to GRC and career development, for beginners and pros alike Golf Forem Follow A community of golfers and golfing enthusiasts Crypto Forem Follow A collaborative community for all things Crypto—from Bitcoin to protocol development and DeFi to NFTs and market analysis. Parenting Follow A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Forem Core Follow Discussing the core forem open source software project — features, bugs, performance, self-hosting. Maker Forem Follow A community for makers, hobbyists, and professionals to discuss Arduino, Raspberry Pi, 3D printing, and much more. HMPL.js Forem Follow For developers using HMPL.js to build fast, lightweight web apps. A space to share projects, ask questions, and discuss server-driven templating Dropdown menu Dropdown menu Skip to content Navigation menu Search Powered by Algolia Search Log in Create account Parenting Close Add reaction Like Unicorn Exploding Head Raised Hands Fire Jump to Comments Save Boost More... Copy link Copy link Copied to Clipboard Share to X Share to LinkedIn Share to Facebook Share to Mastodon Share Post via... Report Abuse Siarhei Posted on Dec 1, 2025 I built a free baby tracker that syncs across devices without requiring an account # dadlife # newparents Hey everyone! I recently became a dad, and let me tell you - nobody warns you about the logistics nightmare that comes with a newborn. The Problem First few days home, we tried tracking everything on paper. Feeding times, which breast, how long, diaper changes, sleep... The notebook quickly became an unreadable mess. Then came the constant texts between me and my wife: "When did you last feed her?" "Which side?" "Did you change her?" "How long has she been sleeping?" We tried existing baby tracker apps. One wanted us to create accounts and verify emails - not happening at 3 AM with a screaming baby. Another had half the features locked behind a $10/month subscription. A third one had sync, but required both of us to sign up separately and then somehow "connect" our accounts through a confusing process. I just wanted something simple. Log stuff. Share with my wife. That's it. The Solution (That Grew Into Something More) So I built a quick app for myself. Just feedings at first - tap, log, done. Shared it with my wife through a simple sync key. Then we needed sleep tracking. Added that. Then diapers. Then weight for doctor visits. Then a timer because we kept forgetting when the feeding started. Then dark mode because I blinded myself one too many times at night. Two months later, that "quick app" became Zaspa - a full baby tracker that actually solves the problems we had. What Makes It Different No accounts, no passwords, no BS - You generate a random sync key, text it to your partner, they enter it, done. You're both tracking the same baby in real-time. No email verification, no "forgot password", no account management. Your data stays anonymous on our servers - we don't store baby names or any personal info. Actually works at 3 AM - Big buttons, one-handed operation, minimal steps to log anything. When you're half-asleep holding a baby, you don't want to navigate through menus. Fix mistakes easily - Forgot to log a feeding an hour ago? Just adjust the timestamp. Started the timer late? Edit the start time. Life with a newborn is messy, the app handles that. Key Features for Parents Feeding tracker - Breastfeeding with side switching, formula with amounts, solid foods when you get there. Built-in timer so you don't have to watch the clock. Sleep tracker - Log naps and night sleep. Timer for real-time tracking. Helps you spot patterns in your baby's schedule (if they have one). Diaper log - Quick taps for wet/dirty. Simple but important for making sure baby is eating enough. Growth tracking - Weight and height over time. Have real data ready when the pediatrician asks "how's the weight gain?" Activity log - Walks, baths, tummy time, medicine, pumping. Notes on everything. Excel export - Generate spreadsheets for doctor visits. No more "I think she ate around... maybe 6 times yesterday?" Multiple kids - Twins? Toddler and newborn? Separate profiles for each. Dark mode - Your eyes will thank you. 6 languages - English, Spanish, German, Ukrainian, Belarusian, Polish. Completely Free No ads. No premium tier. No subscriptions. I built this because my family needed it, and I figured other parents might too. Try It https://zaspa.online/ Works on iOS, Android. Your data is encrypted and private. You can disconnect sync anytime and keep everything local. Would love to hear from other parents - what's missing? What would make this actually useful for your situation? Thanks for checking it out! Top comments (1) Subscribe Personal Trusted User Create template Templates let you quickly answer FAQs or store snippets for re-use. Submit Preview Dismiss Some comments may only be visible to logged-in visitors. Sign in to view all comments. Code of Conduct • Report abuse Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink . Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse Siarhei Follow Joined Nov 19, 2023 💎 DEV Diamond Sponsors Thank you to our Diamond Sponsors for supporting the DEV Community Google AI is the official AI Model and Platform Partner of DEV Neon is the official database partner of DEV Algolia is the official search partner of DEV Parenting — A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Home About Contact Code of Conduct Privacy Policy Terms of Use Built on Forem — the open source software that powers DEV and other inclusive communities. Made with love and Ruby on Rails . Parenting © 2016 - 2026. Navigating the chaos and joy of parenting. Log in Create account | 2026-01-13T08:48:44 |
https://reactjs.org/docs/getting-started.html#undefined | Quick Start – React React v 19.2 Search ⌘ Ctrl K Learn Reference Community Blog GET STARTED Quick Start Tutorial: Tic-Tac-Toe Thinking in React Installation Creating a React App Build a React App from Scratch Add React to an Existing Project Setup Editor Setup Using TypeScript React Developer Tools React Compiler Introduction Installation Incremental Adoption Debugging and Troubleshooting LEARN REACT Describing the UI Your First Component Importing and Exporting Components Writing Markup with JSX JavaScript in JSX with Curly Braces Passing Props to a Component Conditional Rendering Rendering Lists Keeping Components Pure Your UI as a Tree Adding Interactivity Responding to Events State: A Component's Memory Render and Commit State as a Snapshot Queueing a Series of State Updates Updating Objects in State Updating Arrays in State Managing State Reacting to Input with State Choosing the State Structure Sharing State Between Components Preserving and Resetting State Extracting State Logic into a Reducer Passing Data Deeply with Context Scaling Up with Reducer and Context Escape Hatches Referencing Values with Refs Manipulating the DOM with Refs Synchronizing with Effects You Might Not Need an Effect Lifecycle of Reactive Effects Separating Events from Effects Removing Effect Dependencies Reusing Logic with Custom Hooks Is this page useful? Learn React Quick Start Welcome to the React documentation! This page will give you an introduction to 80% of the React concepts that you will use on a daily basis. You will learn How to create and nest components How to add markup and styles How to display data How to render conditions and lists How to respond to events and update the screen How to share data between components Creating and nesting components React apps are made out of components . A component is a piece of the UI (user interface) that has its own logic and appearance. A component can be as small as a button, or as large as an entire page. React components are JavaScript functions that return markup: function MyButton ( ) { return ( < button > I'm a button </ button > ) ; } Now that you’ve declared MyButton , you can nest it into another component: export default function MyApp ( ) { return ( < div > < h1 > Welcome to my app </ h1 > < MyButton /> </ div > ) ; } Notice that <MyButton /> starts with a capital letter. That’s how you know it’s a React component. React component names must always start with a capital letter, while HTML tags must be lowercase. Have a look at the result: App.js App.js Reload Clear Fork function MyButton ( ) { return ( < button > I'm a button </ button > ) ; } export default function MyApp ( ) { return ( < div > < h1 > Welcome to my app </ h1 > < MyButton /> </ div > ) ; } Show more The export default keywords specify the main component in the file. If you’re not familiar with some piece of JavaScript syntax, MDN and javascript.info have great references. Writing markup with JSX The markup syntax you’ve seen above is called JSX . It is optional, but most React projects use JSX for its convenience. All of the tools we recommend for local development support JSX out of the box. JSX is stricter than HTML. You have to close tags like <br /> . Your component also can’t return multiple JSX tags. You have to wrap them into a shared parent, like a <div>...</div> or an empty <>...</> wrapper: function AboutPage ( ) { return ( < > < h1 > About </ h1 > < p > Hello there. < br /> How do you do? </ p > </ > ) ; } If you have a lot of HTML to port to JSX, you can use an online converter. Adding styles In React, you specify a CSS class with className . It works the same way as the HTML class attribute: < img className = "avatar" /> Then you write the CSS rules for it in a separate CSS file: /* In your CSS */ .avatar { border-radius : 50 % ; } React does not prescribe how you add CSS files. In the simplest case, you’ll add a <link> tag to your HTML. If you use a build tool or a framework, consult its documentation to learn how to add a CSS file to your project. Displaying data JSX lets you put markup into JavaScript. Curly braces let you “escape back” into JavaScript so that you can embed some variable from your code and display it to the user. For example, this will display user.name : return ( < h1 > { user . name } </ h1 > ) ; You can also “escape into JavaScript” from JSX attributes, but you have to use curly braces instead of quotes. For example, className="avatar" passes the "avatar" string as the CSS class, but src={user.imageUrl} reads the JavaScript user.imageUrl variable value, and then passes that value as the src attribute: return ( < img className = "avatar" src = { user . imageUrl } /> ) ; You can put more complex expressions inside the JSX curly braces too, for example, string concatenation : App.js App.js Reload Clear Fork const user = { name : 'Hedy Lamarr' , imageUrl : 'https://i.imgur.com/yXOvdOSs.jpg' , imageSize : 90 , } ; export default function Profile ( ) { return ( < > < h1 > { user . name } </ h1 > < img className = "avatar" src = { user . imageUrl } alt = { 'Photo of ' + user . name } style = { { width : user . imageSize , height : user . imageSize } } /> </ > ) ; } Show more In the above example, style={{}} is not a special syntax, but a regular {} object inside the style={ } JSX curly braces. You can use the style attribute when your styles depend on JavaScript variables. Conditional rendering In React, there is no special syntax for writing conditions. Instead, you’ll use the same techniques as you use when writing regular JavaScript code. For example, you can use an if statement to conditionally include JSX: let content ; if ( isLoggedIn ) { content = < AdminPanel /> ; } else { content = < LoginForm /> ; } return ( < div > { content } </ div > ) ; If you prefer more compact code, you can use the conditional ? operator. Unlike if , it works inside JSX: < div > { isLoggedIn ? ( < AdminPanel /> ) : ( < LoginForm /> ) } </ div > When you don’t need the else branch, you can also use a shorter logical && syntax : < div > { isLoggedIn && < AdminPanel /> } </ div > All of these approaches also work for conditionally specifying attributes. If you’re unfamiliar with some of this JavaScript syntax, you can start by always using if...else . Rendering lists You will rely on JavaScript features like for loop and the array map() function to render lists of components. For example, let’s say you have an array of products: const products = [ { title : 'Cabbage' , id : 1 } , { title : 'Garlic' , id : 2 } , { title : 'Apple' , id : 3 } , ] ; Inside your component, use the map() function to transform an array of products into an array of <li> items: const listItems = products . map ( product => < li key = { product . id } > { product . title } </ li > ) ; return ( < ul > { listItems } </ ul > ) ; Notice how <li> has a key attribute. For each item in a list, you should pass a string or a number that uniquely identifies that item among its siblings. Usually, a key should be coming from your data, such as a database ID. React uses your keys to know what happened if you later insert, delete, or reorder the items. App.js App.js Reload Clear Fork const products = [ { title : 'Cabbage' , isFruit : false , id : 1 } , { title : 'Garlic' , isFruit : false , id : 2 } , { title : 'Apple' , isFruit : true , id : 3 } , ] ; export default function ShoppingList ( ) { const listItems = products . map ( product => < li key = { product . id } style = { { color : product . isFruit ? 'magenta' : 'darkgreen' } } > { product . title } </ li > ) ; return ( < ul > { listItems } </ ul > ) ; } Show more Responding to events You can respond to events by declaring event handler functions inside your components: function MyButton ( ) { function handleClick ( ) { alert ( 'You clicked me!' ) ; } return ( < button onClick = { handleClick } > Click me </ button > ) ; } Notice how onClick={handleClick} has no parentheses at the end! Do not call the event handler function: you only need to pass it down . React will call your event handler when the user clicks the button. Updating the screen Often, you’ll want your component to “remember” some information and display it. For example, maybe you want to count the number of times a button is clicked. To do this, add state to your component. First, import useState from React: import { useState } from 'react' ; Now you can declare a state variable inside your component: function MyButton ( ) { const [ count , setCount ] = useState ( 0 ) ; // ... You’ll get two things from useState : the current state ( count ), and the function that lets you update it ( setCount ). You can give them any names, but the convention is to write [something, setSomething] . The first time the button is displayed, count will be 0 because you passed 0 to useState() . When you want to change state, call setCount() and pass the new value to it. Clicking this button will increment the counter: function MyButton ( ) { const [ count , setCount ] = useState ( 0 ) ; function handleClick ( ) { setCount ( count + 1 ) ; } return ( < button onClick = { handleClick } > Clicked { count } times </ button > ) ; } React will call your component function again. This time, count will be 1 . Then it will be 2 . And so on. If you render the same component multiple times, each will get its own state. Click each button separately: App.js App.js Reload Clear Fork import { useState } from 'react' ; export default function MyApp ( ) { return ( < div > < h1 > Counters that update separately </ h1 > < MyButton /> < MyButton /> </ div > ) ; } function MyButton ( ) { const [ count , setCount ] = useState ( 0 ) ; function handleClick ( ) { setCount ( count + 1 ) ; } return ( < button onClick = { handleClick } > Clicked { count } times </ button > ) ; } Show more Notice how each button “remembers” its own count state and doesn’t affect other buttons. Using Hooks Functions starting with use are called Hooks . useState is a built-in Hook provided by React. You can find other built-in Hooks in the API reference. You can also write your own Hooks by combining the existing ones. Hooks are more restrictive than other functions. You can only call Hooks at the top of your components (or other Hooks). If you want to use useState in a condition or a loop, extract a new component and put it there. Sharing data between components In the previous example, each MyButton had its own independent count , and when each button was clicked, only the count for the button clicked changed: Initially, each MyButton ’s count state is 0 The first MyButton updates its count to 1 However, often you’ll need components to share data and always update together . To make both MyButton components display the same count and update together, you need to move the state from the individual buttons “upwards” to the closest component containing all of them. In this example, it is MyApp : Initially, MyApp ’s count state is 0 and is passed down to both children On click, MyApp updates its count state to 1 and passes it down to both children Now when you click either button, the count in MyApp will change, which will change both of the counts in MyButton . Here’s how you can express this in code. First, move the state up from MyButton into MyApp : export default function MyApp ( ) { const [ count , setCount ] = useState ( 0 ) ; function handleClick ( ) { setCount ( count + 1 ) ; } return ( < div > < h1 > Counters that update separately </ h1 > < MyButton /> < MyButton /> </ div > ) ; } function MyButton ( ) { // ... we're moving code from here ... } Then, pass the state down from MyApp to each MyButton , together with the shared click handler. You can pass information to MyButton using the JSX curly braces, just like you previously did with built-in tags like <img> : export default function MyApp ( ) { const [ count , setCount ] = useState ( 0 ) ; function handleClick ( ) { setCount ( count + 1 ) ; } return ( < div > < h1 > Counters that update together </ h1 > < MyButton count = { count } onClick = { handleClick } /> < MyButton count = { count } onClick = { handleClick } /> </ div > ) ; } The information you pass down like this is called props . Now the MyApp component contains the count state and the handleClick event handler, and passes both of them down as props to each of the buttons. Finally, change MyButton to read the props you have passed from its parent component: function MyButton ( { count , onClick } ) { return ( < button onClick = { onClick } > Clicked { count } times </ button > ) ; } When you click the button, the onClick handler fires. Each button’s onClick prop was set to the handleClick function inside MyApp , so the code inside of it runs. That code calls setCount(count + 1) , incrementing the count state variable. The new count value is passed as a prop to each button, so they all show the new value. This is called “lifting state up”. By moving state up, you’ve shared it between components. App.js App.js Reload Clear Fork import { useState } from 'react' ; export default function MyApp ( ) { const [ count , setCount ] = useState ( 0 ) ; function handleClick ( ) { setCount ( count + 1 ) ; } return ( < div > < h1 > Counters that update together </ h1 > < MyButton count = { count } onClick = { handleClick } /> < MyButton count = { count } onClick = { handleClick } /> </ div > ) ; } function MyButton ( { count , onClick } ) { return ( < button onClick = { onClick } > Clicked { count } times </ button > ) ; } Show more Next Steps By now, you know the basics of how to write React code! Check out the Tutorial to put them into practice and build your first mini-app with React. Next Tutorial: Tic-Tac-Toe Copyright © Meta Platforms, Inc no uwu plz uwu? Logo by @sawaratsuki1004 Learn React Quick Start Installation Describing the UI Adding Interactivity Managing State Escape Hatches API Reference React APIs React DOM APIs Community Code of Conduct Meet the Team Docs Contributors Acknowledgements More Blog React Native Privacy Terms On this page Overview Creating and nesting components Writing markup with JSX Adding styles Displaying data Conditional rendering Rendering lists Responding to events Updating the screen Using Hooks Sharing data between components Next Steps | 2026-01-13T08:48:44 |
https://docs.suprsend.com/reference/cli-workflow-enable | Enable Workflow - SuprSend, Notification infrastructure for Product teams Skip to main content SuprSend, Notification infrastructure for Product teams home page Search... ⌘ K Community Trust Center Platform Status Postman Collection Versioning Versioning and Support Policy CLI Changelog Getting Started with CLI CLI Overview BETA Quickstart Installation Authentication Enable Autocompletion Global Flags Profile Commands and Flags Add Profile Use Profile List Profile Modify Profile Remove Profile Sync Sync Assets Workflow Commands and Flags List Workflows Pull Workflows Push Workflows Enable Workflow Disable Workflow Schema Commands and Flags List Schemas Pull Schemas Push Schemas Commit Schema Generate Types Event Commands and Flags List Events Pull Events Push Events Preference Category Commands and Flags List Categories Pull Categories Push Categories Commit Categories List Category Translations Pull Category Translations Push Category Translations Translation Commands and Flags List Translations Pull Translations Push Translations Commit Translations Contact Us Get Started SuprSend, Notification infrastructure for Product teams home page Search... ⌘ K Ask AI Contact Us Get Started Get Started Search... Navigation Workflow Enable Workflow Documentation API Reference Management API CLI Reference Developer Resources Changelog Documentation API Reference Management API CLI Reference Developer Resources Changelog Workflow Enable Workflow OpenAI Open in ChatGPT Enable a workflow in a SuprSend workspace to start processing notifications. OpenAI Open in ChatGPT All pushed workflows are enabled by default. Workflows have to be live to be enabled. Syntax Copy Ask AI suprsend workflow enable < workflow-slu g > [flags] Arguments: <workflow-slug> - Slug of the workflow to enable (required) Example Copy Ask AI # Enable workflow in staging workspace suprsend workflow enable my-workflow # Enable workflow in another workspace suprsend workflow enable user-signup --workspace production Was this page helpful? Yes No Suggest edits Raise issue Previous Disable Workflow Deactivate a workflow in a SuprSend workspace to stop processing notifications. Next ⌘ I x github linkedin youtube Powered by On this page Syntax Example | 2026-01-13T08:48:44 |
https://docs.python.org/3/tutorial/controlflow.html | 4. More Control Flow Tools — Python 3.14.2 documentation Theme Auto Light Dark Table of Contents 4. More Control Flow Tools 4.1. if Statements 4.2. for Statements 4.3. The range() Function 4.4. break and continue Statements 4.5. else Clauses on Loops 4.6. pass Statements 4.7. match Statements 4.8. Defining Functions 4.9. More on Defining Functions 4.9.1. Default Argument Values 4.9.2. Keyword Arguments 4.9.3. Special parameters 4.9.3.1. Positional-or-Keyword Arguments 4.9.3.2. Positional-Only Parameters 4.9.3.3. Keyword-Only Arguments 4.9.3.4. Function Examples 4.9.3.5. Recap 4.9.4. Arbitrary Argument Lists 4.9.5. Unpacking Argument Lists 4.9.6. Lambda Expressions 4.9.7. Documentation Strings 4.9.8. Function Annotations 4.10. Intermezzo: Coding Style Previous topic 3. An Informal Introduction to Python Next topic 5. Data Structures This page Report a bug Show source Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 4. More Control Flow Tools | Theme Auto Light Dark | 4. More Control Flow Tools ¶ As well as the while statement just introduced, Python uses a few more that we will encounter in this chapter. 4.1. if Statements ¶ Perhaps the most well-known statement type is the if statement. For example: >>> x = int ( input ( "Please enter an integer: " )) Please enter an integer: 42 >>> if x < 0 : ... x = 0 ... print ( 'Negative changed to zero' ) ... elif x == 0 : ... print ( 'Zero' ) ... elif x == 1 : ... print ( 'Single' ) ... else : ... print ( 'More' ) ... More There can be zero or more elif parts, and the else part is optional. The keyword ‘ elif ’ is short for ‘else if’, and is useful to avoid excessive indentation. An if … elif … elif … sequence is a substitute for the switch or case statements found in other languages. If you’re comparing the same value to several constants, or checking for specific types or attributes, you may also find the match statement useful. For more details see match Statements . 4.2. for Statements ¶ The for statement in Python differs a bit from what you may be used to in C or Pascal. Rather than always iterating over an arithmetic progression of numbers (like in Pascal), or giving the user the ability to define both the iteration step and halting condition (as C), Python’s for statement iterates over the items of any sequence (a list or a string), in the order that they appear in the sequence. For example (no pun intended): >>> # Measure some strings: >>> words = [ 'cat' , 'window' , 'defenestrate' ] >>> for w in words : ... print ( w , len ( w )) ... cat 3 window 6 defenestrate 12 Code that modifies a collection while iterating over that same collection can be tricky to get right. Instead, it is usually more straight-forward to loop over a copy of the collection or to create a new collection: # Create a sample collection users = { 'Hans' : 'active' , 'Éléonore' : 'inactive' , '景太郎' : 'active' } # Strategy: Iterate over a copy for user , status in users . copy () . items (): if status == 'inactive' : del users [ user ] # Strategy: Create a new collection active_users = {} for user , status in users . items (): if status == 'active' : active_users [ user ] = status 4.3. The range() Function ¶ If you do need to iterate over a sequence of numbers, the built-in function range() comes in handy. It generates arithmetic progressions: >>> for i in range ( 5 ): ... print ( i ) ... 0 1 2 3 4 The given end point is never part of the generated sequence; range(10) generates 10 values, the legal indices for items of a sequence of length 10. It is possible to let the range start at another number, or to specify a different increment (even negative; sometimes this is called the ‘step’): >>> list ( range ( 5 , 10 )) [5, 6, 7, 8, 9] >>> list ( range ( 0 , 10 , 3 )) [0, 3, 6, 9] >>> list ( range ( - 10 , - 100 , - 30 )) [-10, -40, -70] To iterate over the indices of a sequence, you can combine range() and len() as follows: >>> a = [ 'Mary' , 'had' , 'a' , 'little' , 'lamb' ] >>> for i in range ( len ( a )): ... print ( i , a [ i ]) ... 0 Mary 1 had 2 a 3 little 4 lamb In most such cases, however, it is convenient to use the enumerate() function, see Looping Techniques . A strange thing happens if you just print a range: >>> range ( 10 ) range(0, 10) In many ways the object returned by range() behaves as if it is a list, but in fact it isn’t. It is an object which returns the successive items of the desired sequence when you iterate over it, but it doesn’t really make the list, thus saving space. We say such an object is iterable , that is, suitable as a target for functions and constructs that expect something from which they can obtain successive items until the supply is exhausted. We have seen that the for statement is such a construct, while an example of a function that takes an iterable is sum() : >>> sum ( range ( 4 )) # 0 + 1 + 2 + 3 6 Later we will see more functions that return iterables and take iterables as arguments. In chapter Data Structures , we will discuss in more detail about list() . 4.4. break and continue Statements ¶ The break statement breaks out of the innermost enclosing for or while loop: >>> for n in range ( 2 , 10 ): ... for x in range ( 2 , n ): ... if n % x == 0 : ... print ( f " { n } equals { x } * { n // x } " ) ... break ... 4 equals 2 * 2 6 equals 2 * 3 8 equals 2 * 4 9 equals 3 * 3 The continue statement continues with the next iteration of the loop: >>> for num in range ( 2 , 10 ): ... if num % 2 == 0 : ... print ( f "Found an even number { num } " ) ... continue ... print ( f "Found an odd number { num } " ) ... Found an even number 2 Found an odd number 3 Found an even number 4 Found an odd number 5 Found an even number 6 Found an odd number 7 Found an even number 8 Found an odd number 9 4.5. else Clauses on Loops ¶ In a for or while loop the break statement may be paired with an else clause. If the loop finishes without executing the break , the else clause executes. In a for loop, the else clause is executed after the loop finishes its final iteration, that is, if no break occurred. In a while loop, it’s executed after the loop’s condition becomes false. In either kind of loop, the else clause is not executed if the loop was terminated by a break . Of course, other ways of ending the loop early, such as a return or a raised exception, will also skip execution of the else clause. This is exemplified in the following for loop, which searches for prime numbers: >>> for n in range ( 2 , 10 ): ... for x in range ( 2 , n ): ... if n % x == 0 : ... print ( n , 'equals' , x , '*' , n // x ) ... break ... else : ... # loop fell through without finding a factor ... print ( n , 'is a prime number' ) ... 2 is a prime number 3 is a prime number 4 equals 2 * 2 5 is a prime number 6 equals 2 * 3 7 is a prime number 8 equals 2 * 4 9 equals 3 * 3 (Yes, this is the correct code. Look closely: the else clause belongs to the for loop, not the if statement.) One way to think of the else clause is to imagine it paired with the if inside the loop. As the loop executes, it will run a sequence like if/if/if/else. The if is inside the loop, encountered a number of times. If the condition is ever true, a break will happen. If the condition is never true, the else clause outside the loop will execute. When used with a loop, the else clause has more in common with the else clause of a try statement than it does with that of if statements: a try statement’s else clause runs when no exception occurs, and a loop’s else clause runs when no break occurs. For more on the try statement and exceptions, see Handling Exceptions . 4.6. pass Statements ¶ The pass statement does nothing. It can be used when a statement is required syntactically but the program requires no action. For example: >>> while True : ... pass # Busy-wait for keyboard interrupt (Ctrl+C) ... This is commonly used for creating minimal classes: >>> class MyEmptyClass : ... pass ... Another place pass can be used is as a place-holder for a function or conditional body when you are working on new code, allowing you to keep thinking at a more abstract level. The pass is silently ignored: >>> def initlog ( * args ): ... pass # Remember to implement this! ... For this last case, many people use the ellipsis literal ... instead of pass . This use has no special meaning to Python, and is not part of the language definition (you could use any constant expression here), but ... is used conventionally as a placeholder body as well. See The Ellipsis Object . 4.7. match Statements ¶ A match statement takes an expression and compares its value to successive patterns given as one or more case blocks. This is superficially similar to a switch statement in C, Java or JavaScript (and many other languages), but it’s more similar to pattern matching in languages like Rust or Haskell. Only the first pattern that matches gets executed and it can also extract components (sequence elements or object attributes) from the value into variables. If no case matches, none of the branches is executed. The simplest form compares a subject value against one or more literals: def http_error ( status ): match status : case 400 : return "Bad request" case 404 : return "Not found" case 418 : return "I'm a teapot" case _ : return "Something's wrong with the internet" Note the last block: the “variable name” _ acts as a wildcard and never fails to match. You can combine several literals in a single pattern using | (“or”): case 401 | 403 | 404 : return "Not allowed" Patterns can look like unpacking assignments, and can be used to bind variables: # point is an (x, y) tuple match point : case ( 0 , 0 ): print ( "Origin" ) case ( 0 , y ): print ( f "Y= { y } " ) case ( x , 0 ): print ( f "X= { x } " ) case ( x , y ): print ( f "X= { x } , Y= { y } " ) case _ : raise ValueError ( "Not a point" ) Study that one carefully! The first pattern has two literals, and can be thought of as an extension of the literal pattern shown above. But the next two patterns combine a literal and a variable, and the variable binds a value from the subject ( point ). The fourth pattern captures two values, which makes it conceptually similar to the unpacking assignment (x, y) = point . If you are using classes to structure your data you can use the class name followed by an argument list resembling a constructor, but with the ability to capture attributes into variables: class Point : def __init__ ( self , x , y ): self . x = x self . y = y def where_is ( point ): match point : case Point ( x = 0 , y = 0 ): print ( "Origin" ) case Point ( x = 0 , y = y ): print ( f "Y= { y } " ) case Point ( x = x , y = 0 ): print ( f "X= { x } " ) case Point (): print ( "Somewhere else" ) case _ : print ( "Not a point" ) You can use positional parameters with some builtin classes that provide an ordering for their attributes (e.g. dataclasses). You can also define a specific position for attributes in patterns by setting the __match_args__ special attribute in your classes. If it’s set to (“x”, “y”), the following patterns are all equivalent (and all bind the y attribute to the var variable): Point ( 1 , var ) Point ( 1 , y = var ) Point ( x = 1 , y = var ) Point ( y = var , x = 1 ) A recommended way to read patterns is to look at them as an extended form of what you would put on the left of an assignment, to understand which variables would be set to what. Only the standalone names (like var above) are assigned to by a match statement. Dotted names (like foo.bar ), attribute names (the x= and y= above) or class names (recognized by the “(…)” next to them like Point above) are never assigned to. Patterns can be arbitrarily nested. For example, if we have a short list of Points, with __match_args__ added, we could match it like this: class Point : __match_args__ = ( 'x' , 'y' ) def __init__ ( self , x , y ): self . x = x self . y = y match points : case []: print ( "No points" ) case [ Point ( 0 , 0 )]: print ( "The origin" ) case [ Point ( x , y )]: print ( f "Single point { x } , { y } " ) case [ Point ( 0 , y1 ), Point ( 0 , y2 )]: print ( f "Two on the Y axis at { y1 } , { y2 } " ) case _ : print ( "Something else" ) We can add an if clause to a pattern, known as a “guard”. If the guard is false, match goes on to try the next case block. Note that value capture happens before the guard is evaluated: match point : case Point ( x , y ) if x == y : print ( f "Y=X at { x } " ) case Point ( x , y ): print ( f "Not on the diagonal" ) Several other key features of this statement: Like unpacking assignments, tuple and list patterns have exactly the same meaning and actually match arbitrary sequences. An important exception is that they don’t match iterators or strings. Sequence patterns support extended unpacking: [x, y, *rest] and (x, y, *rest) work similar to unpacking assignments. The name after * may also be _ , so (x, y, *_) matches a sequence of at least two items without binding the remaining items. Mapping patterns: {"bandwidth": b, "latency": l} captures the "bandwidth" and "latency" values from a dictionary. Unlike sequence patterns, extra keys are ignored. An unpacking like **rest is also supported. (But **_ would be redundant, so it is not allowed.) Subpatterns may be captured using the as keyword: case ( Point ( x1 , y1 ), Point ( x2 , y2 ) as p2 ): ... will capture the second element of the input as p2 (as long as the input is a sequence of two points) Most literals are compared by equality, however the singletons True , False and None are compared by identity. Patterns may use named constants. These must be dotted names to prevent them from being interpreted as capture variable: from enum import Enum class Color ( Enum ): RED = 'red' GREEN = 'green' BLUE = 'blue' color = Color ( input ( "Enter your choice of 'red', 'blue' or 'green': " )) match color : case Color . RED : print ( "I see red!" ) case Color . GREEN : print ( "Grass is green" ) case Color . BLUE : print ( "I'm feeling the blues :(" ) For a more detailed explanation and additional examples, you can look into PEP 636 which is written in a tutorial format. 4.8. Defining Functions ¶ We can create a function that writes the Fibonacci series to an arbitrary boundary: >>> def fib ( n ): # write Fibonacci series less than n ... """Print a Fibonacci series less than n.""" ... a , b = 0 , 1 ... while a < n : ... print ( a , end = ' ' ) ... a , b = b , a + b ... print () ... >>> # Now call the function we just defined: >>> fib ( 2000 ) 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 The keyword def introduces a function definition . It must be followed by the function name and the parenthesized list of formal parameters. The statements that form the body of the function start at the next line, and must be indented. The first statement of the function body can optionally be a string literal; this string literal is the function’s documentation string, or docstring . (More about docstrings can be found in the section Documentation Strings .) There are tools which use docstrings to automatically produce online or printed documentation, or to let the user interactively browse through code; it’s good practice to include docstrings in code that you write, so make a habit of it. The execution of a function introduces a new symbol table used for the local variables of the function. More precisely, all variable assignments in a function store the value in the local symbol table; whereas variable references first look in the local symbol table, then in the local symbol tables of enclosing functions, then in the global symbol table, and finally in the table of built-in names. Thus, global variables and variables of enclosing functions cannot be directly assigned a value within a function (unless, for global variables, named in a global statement, or, for variables of enclosing functions, named in a nonlocal statement), although they may be referenced. The actual parameters (arguments) to a function call are introduced in the local symbol table of the called function when it is called; thus, arguments are passed using call by value (where the value is always an object reference , not the value of the object). [ 1 ] When a function calls another function, or calls itself recursively, a new local symbol table is created for that call. A function definition associates the function name with the function object in the current symbol table. The interpreter recognizes the object pointed to by that name as a user-defined function. Other names can also point to that same function object and can also be used to access the function: >>> fib <function fib at 10042ed0> >>> f = fib >>> f ( 100 ) 0 1 1 2 3 5 8 13 21 34 55 89 Coming from other languages, you might object that fib is not a function but a procedure since it doesn’t return a value. In fact, even functions without a return statement do return a value, albeit a rather boring one. This value is called None (it’s a built-in name). Writing the value None is normally suppressed by the interpreter if it would be the only value written. You can see it if you really want to using print() : >>> fib ( 0 ) >>> print ( fib ( 0 )) None It is simple to write a function that returns a list of the numbers of the Fibonacci series, instead of printing it: >>> def fib2 ( n ): # return Fibonacci series up to n ... """Return a list containing the Fibonacci series up to n.""" ... result = [] ... a , b = 0 , 1 ... while a < n : ... result . append ( a ) # see below ... a , b = b , a + b ... return result ... >>> f100 = fib2 ( 100 ) # call it >>> f100 # write the result [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] 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 . The statement result.append(a) calls a method of the list object result . A method is a function that ‘belongs’ to an object and is named obj.methodname , where obj is some object (this may be an expression), and methodname is the name of a method that is defined by the object’s type. Different types define different methods. Methods of different types may have the same name without causing ambiguity. (It is possible to define your own object types and methods, using classes , see Classes ) The method append() shown in the example is defined for list objects; it adds a new element at the end of the list. In this example it is equivalent to result = result + [a] , but more efficient. 4.9. More on Defining Functions ¶ It is also possible to define functions with a variable number of arguments. There are three forms, which can be combined. 4.9.1. Default Argument Values ¶ The most useful form is to specify a default value for one or more arguments. This creates a function that can be called with fewer arguments than it is defined to allow. For example: def ask_ok ( prompt , retries = 4 , reminder = 'Please try again!' ): while True : reply = input ( prompt ) if reply in { 'y' , 'ye' , 'yes' }: return True if reply in { 'n' , 'no' , 'nop' , 'nope' }: return False retries = retries - 1 if retries < 0 : raise ValueError ( 'invalid user response' ) print ( reminder ) This function can be called in several ways: giving only the mandatory argument: ask_ok('Do you really want to quit?') giving one of the optional arguments: ask_ok('OK to overwrite the file?', 2) or even giving all arguments: ask_ok('OK to overwrite the file?', 2, 'Come on, only yes or no!') This example also introduces the in keyword. This tests whether or not a sequence contains a certain value. The default values are evaluated at the point of function definition in the defining scope, so that i = 5 def f ( arg = i ): print ( arg ) i = 6 f () will print 5 . Important warning: The default value is evaluated only once. This makes a difference when the default is a mutable object such as a list, dictionary, or instances of most classes. For example, the following function accumulates the arguments passed to it on subsequent calls: def f ( a , L = []): L . append ( a ) return L print ( f ( 1 )) print ( f ( 2 )) print ( f ( 3 )) This will print [ 1 ] [ 1 , 2 ] [ 1 , 2 , 3 ] If you don’t want the default to be shared between subsequent calls, you can write the function like this instead: def f ( a , L = None ): if L is None : L = [] L . append ( a ) return L 4.9.2. Keyword Arguments ¶ Functions can also be called using keyword arguments of the form kwarg=value . For instance, the following function: def parrot ( voltage , state = 'a stiff' , action = 'voom' , type = 'Norwegian Blue' ): print ( "-- This parrot wouldn't" , action , end = ' ' ) print ( "if you put" , voltage , "volts through it." ) print ( "-- Lovely plumage, the" , type ) print ( "-- It's" , state , "!" ) accepts one required argument ( voltage ) and three optional arguments ( state , action , and type ). This function can be called in any of the following ways: parrot ( 1000 ) # 1 positional argument parrot ( voltage = 1000 ) # 1 keyword argument parrot ( voltage = 1000000 , action = 'VOOOOOM' ) # 2 keyword arguments parrot ( action = 'VOOOOOM' , voltage = 1000000 ) # 2 keyword arguments parrot ( 'a million' , 'bereft of life' , 'jump' ) # 3 positional arguments parrot ( 'a thousand' , state = 'pushing up the daisies' ) # 1 positional, 1 keyword but all the following calls would be invalid: parrot () # required argument missing parrot ( voltage = 5.0 , 'dead' ) # non-keyword argument after a keyword argument parrot ( 110 , voltage = 220 ) # duplicate value for the same argument parrot ( actor = 'John Cleese' ) # unknown keyword argument In a function call, keyword arguments must follow positional arguments. All the keyword arguments passed must match one of the arguments accepted by the function (e.g. actor is not a valid argument for the parrot function), and their order is not important. This also includes non-optional arguments (e.g. parrot(voltage=1000) is valid too). No argument may receive a value more than once. Here’s an example that fails due to this restriction: >>> def function ( a ): ... pass ... >>> function ( 0 , a = 0 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : function() got multiple values for argument 'a' When a final formal parameter of the form **name is present, it receives a dictionary (see Mapping Types — dict ) containing all keyword arguments except for those corresponding to a formal parameter. This may be combined with a formal parameter of the form *name (described in the next subsection) which receives a tuple containing the positional arguments beyond the formal parameter list. ( *name must occur before **name .) For example, if we define a function like this: def cheeseshop ( kind , * arguments , ** keywords ): print ( "-- Do you have any" , kind , "?" ) print ( "-- I'm sorry, we're all out of" , kind ) for arg in arguments : print ( arg ) print ( "-" * 40 ) for kw in keywords : print ( kw , ":" , keywords [ kw ]) It could be called like this: cheeseshop ( "Limburger" , "It's very runny, sir." , "It's really very, VERY runny, sir." , shopkeeper = "Michael Palin" , client = "John Cleese" , sketch = "Cheese Shop Sketch" ) and of course it would print: -- Do you have any Limburger ? -- I'm sorry, we're all out of Limburger It's very runny, sir. It's really very, VERY runny, sir. ---------------------------------------- shopkeeper : Michael Palin client : John Cleese sketch : Cheese Shop Sketch Note that the order in which the keyword arguments are printed is guaranteed to match the order in which they were provided in the function call. 4.9.3. Special parameters ¶ By default, arguments may be passed to a Python function either by position or explicitly by keyword. For readability and performance, it makes sense to restrict the way arguments can be passed so that a developer need only look at the function definition to determine if items are passed by position, by position or keyword, or by keyword. A function definition may look like: def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2): ----------- ---------- ---------- | | | | Positional or keyword | | - Keyword only -- Positional only where / and * are optional. If used, these symbols indicate the kind of parameter by how the arguments may be passed to the function: positional-only, positional-or-keyword, and keyword-only. Keyword parameters are also referred to as named parameters. 4.9.3.1. Positional-or-Keyword Arguments ¶ If / and * are not present in the function definition, arguments may be passed to a function by position or by keyword. 4.9.3.2. Positional-Only Parameters ¶ Looking at this in a bit more detail, it is possible to mark certain parameters as positional-only . If positional-only , the parameters’ order matters, and the parameters cannot be passed by keyword. Positional-only parameters are placed before a / (forward-slash). The / is used to logically separate the positional-only parameters from the rest of the parameters. If there is no / in the function definition, there are no positional-only parameters. Parameters following the / may be positional-or-keyword or keyword-only . 4.9.3.3. Keyword-Only Arguments ¶ To mark parameters as keyword-only , indicating the parameters must be passed by keyword argument, place an * in the arguments list just before the first keyword-only parameter. 4.9.3.4. Function Examples ¶ Consider the following example function definitions paying close attention to the markers / and * : >>> def standard_arg ( arg ): ... print ( arg ) ... >>> def pos_only_arg ( arg , / ): ... print ( arg ) ... >>> def kwd_only_arg ( * , arg ): ... print ( arg ) ... >>> def combined_example ( pos_only , / , standard , * , kwd_only ): ... print ( pos_only , standard , kwd_only ) The first function definition, standard_arg , the most familiar form, places no restrictions on the calling convention and arguments may be passed by position or keyword: >>> standard_arg ( 2 ) 2 >>> standard_arg ( arg = 2 ) 2 The second function pos_only_arg is restricted to only use positional parameters as there is a / in the function definition: >>> pos_only_arg ( 1 ) 1 >>> pos_only_arg ( arg = 1 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : pos_only_arg() got some positional-only arguments passed as keyword arguments: 'arg' The third function kwd_only_arg only allows keyword arguments as indicated by a * in the function definition: >>> kwd_only_arg ( 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : kwd_only_arg() takes 0 positional arguments but 1 was given >>> kwd_only_arg ( arg = 3 ) 3 And the last uses all three calling conventions in the same function definition: >>> combined_example ( 1 , 2 , 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : combined_example() takes 2 positional arguments but 3 were given >>> combined_example ( 1 , 2 , kwd_only = 3 ) 1 2 3 >>> combined_example ( 1 , standard = 2 , kwd_only = 3 ) 1 2 3 >>> combined_example ( pos_only = 1 , standard = 2 , kwd_only = 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : combined_example() got some positional-only arguments passed as keyword arguments: 'pos_only' Finally, consider this function definition which has a potential collision between the positional argument name and **kwds which has name as a key: def foo ( name , ** kwds ): return 'name' in kwds There is no possible call that will make it return True as the keyword 'name' will always bind to the first parameter. For example: >>> foo ( 1 , ** { 'name' : 2 }) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : foo() got multiple values for argument 'name' >>> But using / (positional only arguments), it is possible since it allows name as a positional argument and 'name' as a key in the keyword arguments: >>> def foo ( name , / , ** kwds ): ... return 'name' in kwds ... >>> foo ( 1 , ** { 'name' : 2 }) True In other words, the names of positional-only parameters can be used in **kwds without ambiguity. 4.9.3.5. Recap ¶ The use case will determine which parameters to use in the function definition: def f ( pos1 , pos2 , / , pos_or_kwd , * , kwd1 , kwd2 ): As guidance: Use positional-only if you want the name of the parameters to not be available to the user. This is useful when parameter names have no real meaning, if you want to enforce the order of the arguments when the function is called or if you need to take some positional parameters and arbitrary keywords. Use keyword-only when names have meaning and the function definition is more understandable by being explicit with names or you want to prevent users relying on the position of the argument being passed. For an API, use positional-only to prevent breaking API changes if the parameter’s name is modified in the future. 4.9.4. Arbitrary Argument Lists ¶ Finally, the least frequently used option is to specify that a function can be called with an arbitrary number of arguments. These arguments will be wrapped up in a tuple (see Tuples and Sequences ). Before the variable number of arguments, zero or more normal arguments may occur. def write_multiple_items ( file , separator , * args ): file . write ( separator . join ( args )) Normally, these variadic arguments will be last in the list of formal parameters, because they scoop up all remaining input arguments that are passed to the function. Any formal parameters which occur after the *args parameter are ‘keyword-only’ arguments, meaning that they can only be used as keywords rather than positional arguments. >>> def concat ( * args , sep = "/" ): ... return sep . join ( args ) ... >>> concat ( "earth" , "mars" , "venus" ) 'earth/mars/venus' >>> concat ( "earth" , "mars" , "venus" , sep = "." ) 'earth.mars.venus' 4.9.5. Unpacking Argument Lists ¶ The reverse situation occurs when the arguments are already in a list or tuple but need to be unpacked for a function call requiring separate positional arguments. For instance, the built-in range() function expects separate start and stop arguments. If they are not available separately, write the function call with the * -operator to unpack the arguments out of a list or tuple: >>> list ( range ( 3 , 6 )) # normal call with separate arguments [3, 4, 5] >>> args = [ 3 , 6 ] >>> list ( range ( * args )) # call with arguments unpacked from a list [3, 4, 5] In the same fashion, dictionaries can deliver keyword arguments with the ** -operator: >>> def parrot ( voltage , state = 'a stiff' , action = 'voom' ): ... print ( "-- This parrot wouldn't" , action , end = ' ' ) ... print ( "if you put" , voltage , "volts through it." , end = ' ' ) ... print ( "E's" , state , "!" ) ... >>> d = { "voltage" : "four million" , "state" : "bleedin' demised" , "action" : "VOOM" } >>> parrot ( ** d ) -- This parrot wouldn't VOOM if you put four million volts through it. E's bleedin' demised ! 4.9.6. Lambda Expressions ¶ Small anonymous functions can be created with the lambda keyword. This function returns the sum of its two arguments: lambda a, b: a+b . Lambda functions can be used wherever function objects are required. They are syntactically restricted to a single expression. Semantically, they are just syntactic sugar for a normal function definition. Like nested function definitions, lambda functions can reference variables from the containing scope: >>> def make_incrementor ( n ): ... return lambda x : x + n ... >>> f = make_incrementor ( 42 ) >>> f ( 0 ) 42 >>> f ( 1 ) 43 The above example uses a lambda expression to return a function. Another use is to pass a small function as an argument. For instance, list.sort() takes a sorting key function key which can be a lambda function: >>> pairs = [( 1 , 'one' ), ( 2 , 'two' ), ( 3 , 'three' ), ( 4 , 'four' )] >>> pairs . sort ( key = lambda pair : pair [ 1 ]) >>> pairs [(4, 'four'), (1, 'one'), (3, 'three'), (2, 'two')] 4.9.7. Documentation Strings ¶ Here are some conventions about the content and formatting of documentation strings. The first line should always be a short, concise summary of the object’s purpose. For brevity, it should not explicitly state the object’s name or type, since these are available by other means (except if the name happens to be a verb describing a function’s operation). This line should begin with a capital letter and end with a period. If there are more lines in the documentation string, the second line should be blank, visually separating the summary from the rest of the description. The following lines should be one or more paragraphs describing the object’s calling conventions, its side effects, etc. The Python parser strips indentation from multi-line string literals when they serve as module, class, or function docstrings. Here is an example of a multi-line docstring: >>> def my_function (): ... """Do nothing, but document it. ... ... No, really, it doesn't do anything: ... ... >>> my_function() ... >>> ... """ ... pass ... >>> print ( my_function . __doc__ ) Do nothing, but document it. No, really, it doesn't do anything: >>> my_function() >>> 4.9.8. Function Annotations ¶ Function annotations are completely optional metadata information about the types used by user-defined functions (see PEP 3107 and PEP 484 for more information). Annotations are stored in the __annotations__ attribute of the function as a dictionary and have no effect on any other part of the function. Parameter annotations are defined by a colon after the parameter name, followed by an expression evaluating to the value of the annotation. Return annotations are defined by a literal -> , followed by an expression, between the parameter list and the colon denoting the end of the def statement. The following example has a required argument, an optional argument, and the return value annotated: >>> def f ( ham : str , eggs : str = 'eggs' ) -> str : ... print ( "Annotations:" , f . __annotations__ ) ... print ( "Arguments:" , ham , eggs ) ... return ham + ' and ' + eggs ... >>> f ( 'spam' ) Annotations: {'ham': <class 'str'>, 'return': <class 'str'>, 'eggs': <class 'str'>} Arguments: spam eggs 'spam and eggs' 4.10. Intermezzo: Coding Style ¶ Now that you are about to write longer, more complex pieces of Python, it is a good time to talk about coding style . Most languages can be written (or more concise, formatted ) in different styles; some are more readable than others. Making it easy for others to read your code is always a good idea, and adopting a nice coding style helps tremendously for that. For Python, PEP 8 has emerged as the style guide that most projects adhere to; it promotes a very readable and eye-pleasing coding style. Every Python developer should read it at some point; here are the most important points extracted for you: Use 4-space indentation, and no tabs. 4 spaces are a good compromise between small indentation (allows greater nesting depth) and large indentation (easier to read). Tabs introduce confusion, and are best left out. Wrap lines so that they don’t exceed 79 characters. This helps users with small displays and makes it possible to have several code files side-by-side on larger displays. Use blank lines to separate functions and classes, and larger blocks of code inside functions. When possible, put comments on a line of their own. Use docstrings. Use spaces around operators and after commas, but not directly inside bracketing constructs: a = f(1, 2) + g(3, 4) . Name your classes and functions consistently; the convention is to use UpperCamelCase for classes and lowercase_with_underscores for functions and methods. Always use self as the name for the first method argument (see A First Look at Classes for more on classes and methods). Don’t use fancy encodings if your code is meant to be used in international environments. Python’s default, UTF-8, or even plain ASCII work best in any case. Likewise, don’t use non-ASCII characters in identifiers if there is only the slightest chance people speaking a different language will read or maintain the code. Footnotes [ 1 ] Actually, call by object reference would be a better description, since if a mutable object is passed, the caller will see any changes the callee makes to it (items inserted into a list). Table of Contents 4. More Control Flow Tools 4.1. if Statements 4.2. for Statements 4.3. The range() Function 4.4. break and continue Statements 4.5. else Clauses on Loops 4.6. pass Statements 4.7. match Statements 4.8. Defining Functions 4.9. More on Defining Functions 4.9.1. Default Argument Values 4.9.2. Keyword Arguments 4.9.3. Special parameters 4.9.3.1. Positional-or-Keyword Arguments 4.9.3.2. Positional-Only Parameters 4.9.3.3. Keyword-Only Arguments 4.9.3.4. Function Examples 4.9.3.5. Recap 4.9.4. Arbitrary Argument Lists 4.9.5. Unpacking Argument Lists 4.9.6. Lambda Expressions 4.9.7. Documentation Strings 4.9.8. Function Annotations 4.10. Intermezzo: Coding Style Previous topic 3. An Informal Introduction to Python Next topic 5. Data Structures This page Report a bug Show source « Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 4. More Control Flow Tools | Theme Auto Light Dark | © Copyright 2001 Python Software Foundation. This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. See History and License for more information. The Python Software Foundation is a non-profit corporation. Please donate. Last updated on Jan 13, 2026 (06:19 UTC). Found a bug ? Created using Sphinx 8.2.3. | 2026-01-13T08:48:44 |
https://parenting.forem.com/junothreadborne/the-sturdy-pillar-doesnt-need-reinforcement-the-silent-myth-of-single-parenthood-3cde | The Sturdy Pillar Doesn’t Need Reinforcement - Parenting Forem Feed Follow new Subforems to improve your feed DEV Community Follow A space to discuss and keep up software development and manage your software career Future Follow News and discussion of science and technology such as AI, VR, cryptocurrency, quantum computing, and more. Open Forem Follow A general discussion space for the Forem community. If it doesn't have a home elsewhere, it belongs here Gamers Forem Follow An inclusive community for gaming enthusiasts Music Forem Follow From composing and gigging to gear, hot music takes, and everything in between. Vibe Coding Forem Follow Discussing AI software development, and showing off what we're building. Popcorn Movies and TV Follow Movie and TV enthusiasm, criticism and everything in-between. DUMB DEV Community Follow Memes and software development shitposting Design Community Follow Web design, graphic design and everything in-between Security Forem Follow Your central hub for all things security. From ethical hacking and CTFs to GRC and career development, for beginners and pros alike Golf Forem Follow A community of golfers and golfing enthusiasts Crypto Forem Follow A collaborative community for all things Crypto—from Bitcoin to protocol development and DeFi to NFTs and market analysis. Parenting Follow A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Forem Core Follow Discussing the core forem open source software project — features, bugs, performance, self-hosting. Maker Forem Follow A community for makers, hobbyists, and professionals to discuss Arduino, Raspberry Pi, 3D printing, and much more. HMPL.js Forem Follow For developers using HMPL.js to build fast, lightweight web apps. A space to share projects, ask questions, and discuss server-driven templating Dropdown menu Dropdown menu Skip to content Navigation menu Search Powered by Algolia Search Log in Create account Parenting Close Add reaction Like Unicorn Exploding Head Raised Hands Fire Jump to Comments Save Boost More... Copy link Copy link Copied to Clipboard Share to X Share to LinkedIn Share to Facebook Share to Mastodon Share Post via... Report Abuse Juno Threadborne Posted on Nov 21, 2025 The Sturdy Pillar Doesn’t Need Reinforcement # mentalhealth # singleparenting The morning is quiet. Suspiciously so. You're already up. The coffee's cooling. One kid is curled up on the couch half awake, another is still asleep, the third already left for school an hour earlier. You head to Food Lion early. Make it back in time for a good breakfast, get lunch in a backpack, and still find the missing shoe on time for the bus. Everything functions. Everything flows. And no one sees the tension in your jaw or the checklist running behind your eyes. No one praises the pillar for not falling. When you're parenting alone, silence is what you earn for that work. And sometimes that's nice. But it's easy to mistake silence for success. When you parent together—when the structure includes more than one load-bearing wall—the silence means something different. It's not the absence of failure. It's the presence of shared effort. And I miss that. Here's the myth we don't say aloud: Stable people don't need checking on. We're biased that way. Biologically. We respond to visible wounds. We reach for the limping, not the marching. The smoother the performance, the less people notice the skill it takes to hold it together. That's true in code, in classrooms, and in kitchens at 7AM. When my wife is home, she doesn't assume I've got it. She checks . Gently, but intentionally. And sometimes that check-in—the one question no one else thought to ask—is the only thing keeping me from cracking. For years, it was just me. Now, even with her, when she's away, the old muscle memory kicks in. Stress finds the quietest route downhill. And in every system—families, friend groups, even workplaces—it flows toward the person who looks like they can carry it. In this house, that's me. Because I'm stable. Because I don't yell. Because I'm able to bear the load. But here's the secret: The emotionally self-sufficient get trusted with everyone's burdens—but rarely their care. And now, with my better half gone, the architecture has no other path. So it reroutes everything through me. And I don't always succeed. Some mornings, I forget a permission slip. Some nights, I realize too late I forgot to make that important phone call. There are entire weeks where dinner is just triage. But I keep going. Because the illusion of stability is loud enough to quiet concern. When she's here—and this is what partnership actually means—she catches the things I miss. Or catches me , when I start slipping. That's not backup. That's ballast. And without ballast the ship rolls. We don't design anything to bear endless weight without maintenance. Your car needs new shocks every 60,000 miles. Your roof needs replacing every few decades. People need regular check-ups. And without them, small stresses compound. The missed check-in. The postponed conversation. The promise that slips. The dinner date with a friend that keeps getting rescheduled. The call you let go to voicemail one too many times. That's how cracks form. Quietly. Unnoticed. Two parents can distribute that load. Sometimes you alternate—who carries, who coasts. Sometimes one catches the fall when the other can't. But right now, there's no fallback. Just wear. And grit. And the knowledge that cracks spread long before they show. It's not even about splitting the work evenly, really. It's about being seen. I only understood this when I found someone who actually looked. My wife is the first person since I became a parent who looked at the way I hold my own world together and said: "I appreciate what you're doing for us." And in that moment, the myth collapsed a little. She doesn't walk around measuring cracks. She walks the perimeter with me. If you're lucky enough to be in a shared load-bearing system—or if you're building one with friends, family, a village—don't just lean on them. Look up. Ask how the structure's doing. She always has. And when she comes home again, I'll do better at meeting her halfway. Because even shared weight needs redistribution. A pillar reinforced becomes part of a structure. The house is quiet again tonight. The kind of quiet I used to welcome. Now it just sounds like echoes. There's still work to do. Dishes, deadlines, dramas waiting around corners. But for now, just a breath. If this essay does anything, let it be this: Don't wait for collapse. Walk the perimeter. Check the load. Ask who's holding it all up—and whether they're doing it alone. When she comes home, I'll tell her this. But until then, I'm telling you. Because if this pillar could speak, it wouldn't ask for praise. It would ask you to help carry the next beam. Just for a while. Top comments (2) Subscribe Personal Trusted User Create template Templates let you quickly answer FAQs or store snippets for re-use. Submit Preview Dismiss Collapse Expand Jess Lee Jess Lee Jess Lee Follow Building DEV and Forem with everyone here. Interested in the future. Email jess@forem.com Location USA / TAIWAN Pronouns she/they Work Co-Founder & COO at Forem Joined Jul 29, 2016 • Nov 24 '25 Dropdown menu Copy link Hide <3 Like comment: Like comment: 1 like Like Comment button Reply Collapse Expand Narnaiezzsshaa Truong Narnaiezzsshaa Truong Narnaiezzsshaa Truong Follow Security tools for bootstrapped startups Location Texas, United States Joined Oct 24, 2025 • Dec 21 '25 Dropdown menu Copy link Hide Love this. Empowerment isn’t about removing the weight; it’s about making sure no one feels invisible beneath it. Presence can be its own form of care. Like comment: Like comment: 1 like Like Comment button Reply Code of Conduct • Report abuse Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink . Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse Juno Threadborne Follow 🧵 Writer. 🧑💻 Coder. ✨ Often found bending reality for sport. https://thrd.me Location Hampton, VA Pronouns he/him Joined Oct 16, 2025 💎 DEV Diamond Sponsors Thank you to our Diamond Sponsors for supporting the DEV Community Google AI is the official AI Model and Platform Partner of DEV Neon is the official database partner of DEV Algolia is the official search partner of DEV Parenting — A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Home About Contact Code of Conduct Privacy Policy Terms of Use Built on Forem — the open source software that powers DEV and other inclusive communities. Made with love and Ruby on Rails . Parenting © 2016 - 2026. Navigating the chaos and joy of parenting. Log in Create account | 2026-01-13T08:48:44 |
https://porkbun.com/about/why-choose-porkbun-domain-registrar | porkbun.com | Find the perfect domain! Toggle navigation porkbun $0.00 (0) products Domains Transfers Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting All Web Hosting Options Easy WordPress Link In Bio Articulation Sitebuilder Cloud WordPress Shared cPanel Hosting Static Hosting Website Builder Easy PHP Email Hosting All Email Hosting Options Proton Mail Porkbun Email Free Email Forwarding Marketing Tools Textla - SMS Marketing Free WHOIS Privacy Free SSL Certificates Free URL Forwarding transfer Free WordPress SALE! .COM SALE! About --> About Who We Are Why Choose Porkbun Porkbun vs Cloudflare FAQs Resources Knowledge Base Porkbun Blog Service Status Help $0.00 (0) sign in Why Choose Porkbun? We know that there are lots of domain registrars out there to choose from, so why choose Porkbun? Admittedly, we’re a little bit biased, but we’ve also got plenty of reasons to share why you should choose Porkbun vs GoDaddy or other domain registrars! For starters, we’ve been named the #1 domain registrar by USA Today and Forbes Advisor ! Not too shabby, right? Plus every domain name from Porkbun comes with free domain name features like WHOIS Privacy, SSL certificates, URL forwarding, DNS management, and so much more. Why pay for things that should be free, right? When comparing Porkbun vs GoDaddy or other domain registrars, don’t just look at flashy promotions — dig a little deeper. From renewal prices to more free features and amazing customer support, we stand out in all the ways that matter. In the end, here at Porkbun we’re all about what’s best for your experience, so whether you choose us or not, we want you to make an informed decision. Transparent Pricing With No Hidden Fees We’ve got nothing to hide! Other registrars may try to lure you in with low initial prices but hit you with high renewal rates. At Porkbun, we believe in honest, upfront pricing. What you see is what you get — no surprises, no hidden fees. All registrars like Porkbun and GoDaddy are retailers – and we buy domains at prices set by wholesale registries. GoDaddy’s strategy is to mark up wholesale prices on domain names. We sell most of our domains at cost , and the ones that do have a markup are often $1 or less on standard domain names! Affordable domain renewal cost. (not just cheap first-year pricing) WHOIS Privacy is always free. (some other registrars charge extra) Free SSL certificates. (we take security seriously, and we don’t charge for it) If you're comparing GoDaddy vs Porkbun, take a close look at what you're really paying for year after year. At Porkbun, we put first year and renewal pricing front and center, so you’ll always be able to easily see what the current cost is. We think you’ll like what you find at the Bun! Domains At Cost Porkbun's .com Price Explained 📦 .com Wholesale $10.26 🌐 ICANN Fee $0.20 💳 Credit Card Fees $0.64 👻 Hidden Fees NONE 🛒 Total $11.08 ✌️ Leaving GoDaddy PRICELESS Transparent pricing. Zero markup. Now that's Oddly Satisfying. Updated July 1, 2025. Customer Support That Actually Cares Our customers love us not just because we offer great prices, but because we actually care. We put our customers first in everything we do to try and provide the best domain registrar experience possible. It’s you who make us what we are! Is there anything worse than trying to contact a support team because you need some help and you’re getting stuck in a loop of automated responses? Not at Porkbun! Our amazing support team is available 365 days a year via email, phone, and chat, so you can get help whenever you need it — from a real human! As far as we know, GoDaddy is the only other registrar offering live phone support. Some other registrars provide chat support (which we have too!) but they bury their agents behind a confusing maze of automated questions. Our live chat, on the other hand, connects you directly to a real human agent without all the fuss. Unlike some other domain registrars that make you jump through hoops to get assistance, we keep things friendly, fast, and frustration-free. Whether you’re super tech savvy or need a little help, Porkbun is ready to assist. A Fun, Friendly Experience (With a Pig Butt Logo!) Domain registration doesn’t have to be boring. We’re serious about domains, but we also like to have fun. That’s why we’ve got: A quirky name that stands out. (come on, admit it, you know Porkbun is a fun name) A team that genuinely loves helping you. (we’re pretty awesome) An award-winning reputation as the best domain registrar . (remember that USA Today grand slam?) It doesn’t matter if you're a first-time buyer or a long-time domainer, Porkbun makes registering and selling domains easy, affordable, and enjoyable. Porkbun Domain Aftermarket Options Speaking of selling domains, we’re pretty awesome for that, too! Lots of folks choose Porkbun vs GoDaddy or other registrars for our domain marketplace and domain auctions options. Porkbun Marketplace at a Glance Porkbun has integrated with Afternic and SedoMLS for fast transfer services so you can list and sell domains on major marketplaces that reach a global audience. People have noticed and they’re loving this update from the Bun. We’ve also got our Porkbun marketplace and auctions powered by Dynadot to give you extra reach and sell your domains faster. The only requirement is that the domain must be with us, but you can still use third party nameservers, landers, and aftermarket services. Some Porkbun Marketplace Features: Auction and Buy It Now options. Free landers, which can generate a sales blurb/description using ChatGPT. Low 7% commission on Marketplace sales as compared to other platforms. No additional listing fees, just commission if it sells (paid out via PayPal). Instant fast transfer, no need to communicate with the buyer or another registry. Porkbun Domain Auctions Overview We’ve also now added extra user auction functionality so Porkbun customers can list their own domains at auction via Dynadot's DAX platform. You can list your domains for sale at auction with a minimum bid amount as well as start/end dates. These work identical to normal auction domains in that users at Porkbun and other registrars can place bids. Porkbun will take a 15% commission on all domain names sold through the user auctions. The seller will earn 85% of the final winning bid amount. All payouts will be made via PayPal. Choose Porkbun vs GoDaddy and Other Registrars It doesn’t matter if you’re registering a domain name for the first time or listing your portfolio on our domain marketplace, we like to think there are lots of reasons to choose Porkbun vs GoDaddy and other registrars. Our focus on putting our customers first and giving you the best experience possible makes all the difference. We listen to what you’re saying about us and constantly make new changes to improve ourselves. Ready to make the change? Choose Porkbun and see why we’re the talk of the trough! Get Your Domain Name You're In Good Hooves We are the highest-rated domain name registrar on Trustpilot, as reviewed by real customers. Trustpilot × Modal Title Close Close × Modal Title Close porkbun Porkbun is an amazingly awesome ICANN accredited domain name registrar based out of the Pacific Northwest. We're different, we're easy, and we're affordable. Use us, you won't be sorry. If you don't use us we'll be sad, but we'll still love you. Get Pork-Puns In Your Inbox Stay in the loop on all things Porkbun by signing up for our newsletter! 21370 SW Langer Farms Parkway, Suite 142-429 Sherwood, OR 97140, US If you're looking for support, you might be able to answer your own question using our Knowledge Base . Support Hours Impacted From January 3rd to January 11th we will be holding our annual company summit which will impact live and after hours support. Our goal is to provide you with an excellent domain registration experience and support and we all appreciate your patience as the whole company works together to make Porkbun even better. Thank you. Reach our USA-Based phone support team: 1.855.PORKBUN (1.855.767.5286) 9AM - 5PM Pacific Time Other Hours: Your mileage may vary, but give it a whirl support@porkbun.com 24 / 7 Email Support Chat Support Hours Vary Your browser does not support the audio element. This plays a little Porkbun jingle. Stay up to date with Porkbun. Sign up for our cool newsletter and we'll keep you up to date with sweet deals, amazing info, and maybe even the occasional limerick or sonnet. Sign Up Products Domain Names Greatest Deals Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting Link In Bio Articulation Sitebuilder Cloud WordPress cPanel Hosting Static Hosting Easy PHP Website Builder Email Hosting WHOIS Privacy DNS Management SSL Certificates Email Forwarding URL Forwarding Quick Connect Domain Transfer Affiliate Program Handshake Names Ethereum Name Service International Domain Names API Access Support Contact Us Knowledge Base Payment Options Report Abuse Tools Domain Search Domain Suggestion Generator RDAP (WHOIS) Password Generator Service Status Don't like our name? The Buniverse Your IP Address Online DNS Lookup Our Company About Us Our Official Blog Careers Branding Guidelines Policies and Legal Privacy Policy Data Disclosure Policy Bug Bounty Program Porkbun Merchandise Awesomeness Copyright © Porkbun LLC. All rights reserved. Porkbun is a Top Level Design Company Made in the USA 🇺🇸 This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. WARNING: This site has been known to cause a mind blowing experience. We recommend you prepare yourself mentally and if possible be sitting down. Side effects may include saving money, letting out a chuckle, and sporadic oinking. 1 × Modal Title Cancel Continue | 2026-01-13T08:48:44 |
https://docs.python.org/3/library/stdtypes.html#old-string-formatting | Built-in Types — Python 3.14.2 documentation Theme Auto Light Dark Table of Contents Built-in Types Truth Value Testing Boolean Operations — and , or , not Comparisons Numeric Types — int , float , complex Bitwise Operations on Integer Types Additional Methods on Integer Types Additional Methods on Float Additional Methods on Complex Hashing of numeric types Boolean Type - bool Iterator Types Generator Types Sequence Types — list , tuple , range Common Sequence Operations Immutable Sequence Types Mutable Sequence Types Lists Tuples Ranges Text and Binary Sequence Type Methods Summary Text Sequence Type — str String Methods Formatted String Literals (f-strings) Debug specifier Conversion specifier Format specifier Template String Literals (t-strings) printf -style String Formatting Binary Sequence Types — bytes , bytearray , memoryview Bytes Objects Bytearray Objects Bytes and Bytearray Operations printf -style Bytes Formatting Memory Views Set Types — set , frozenset Mapping Types — dict Dictionary view objects Context Manager Types Type Annotation Types — Generic Alias , Union Generic Alias Type Standard Generic Classes Special Attributes of GenericAlias objects Union Type Other Built-in Types Modules Classes and Class Instances Functions Methods Code Objects Type Objects The Null Object The Ellipsis Object The NotImplemented Object Internal Objects Special Attributes Integer string conversion length limitation Affected APIs Configuring the limit Recommended configuration Previous topic Built-in Constants Next topic Built-in Exceptions This page Report a bug Show source Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Standard Library » Built-in Types | Theme Auto Light Dark | Built-in Types ¶ The following sections describe the standard types that are built into the interpreter. The principal built-in types are numerics, sequences, mappings, classes, instances and exceptions. Some collection classes are mutable. The methods that add, subtract, or rearrange their members in place, and don’t return a specific item, never return the collection instance itself but None . Some operations are supported by several object types; in particular, practically all objects can be compared for equality, tested for truth value, and converted to a string (with the repr() function or the slightly different str() function). The latter function is implicitly used when an object is written by the print() function. Truth Value Testing ¶ Any object can be tested for truth value, for use in an if or while condition or as operand of the Boolean operations below. By default, an object is considered true unless its class defines either a __bool__() method that returns False or a __len__() method that returns zero, when called with the object. [ 1 ] If one of the methods raises an exception when called, the exception is propagated and the object does not have a truth value (for example, NotImplemented ). Here are most of the built-in objects considered false: constants defined to be false: None and False zero of any numeric type: 0 , 0.0 , 0j , Decimal(0) , Fraction(0, 1) empty sequences and collections: '' , () , [] , {} , set() , range(0) Operations and built-in functions that have a Boolean result always return 0 or False for false and 1 or True for true, unless otherwise stated. (Important exception: the Boolean operations or and and always return one of their operands.) Boolean Operations — and , or , not ¶ These are the Boolean operations, ordered by ascending priority: Operation Result Notes x or y if x is true, then x , else y (1) x and y if x is false, then x , else y (2) not x if x is false, then True , else False (3) Notes: This is a short-circuit operator, so it only evaluates the second argument if the first one is false. This is a short-circuit operator, so it only evaluates the second argument if the first one is true. not has a lower priority than non-Boolean operators, so not a == b is interpreted as not (a == b) , and a == not b is a syntax error. Comparisons ¶ There are eight comparison operations in Python. They all have the same priority (which is higher than that of the Boolean operations). Comparisons can be chained arbitrarily; for example, x < y <= z is equivalent to x < y and y <= z , except that y is evaluated only once (but in both cases z is not evaluated at all when x < y is found to be false). This table summarizes the comparison operations: Operation Meaning < strictly less than <= less than or equal > strictly greater than >= greater than or equal == equal != not equal is object identity is not negated object identity Unless stated otherwise, objects of different types never compare equal. The == operator is always defined but for some object types (for example, class objects) is equivalent to is . The < , <= , > and >= operators are only defined where they make sense; for example, they raise a TypeError exception when one of the arguments is a complex number. Non-identical instances of a class normally compare as non-equal unless the class defines the __eq__() method. Instances of a class cannot be ordered with respect to other instances of the same class, or other types of object, unless the class defines enough of the methods __lt__() , __le__() , __gt__() , and __ge__() (in general, __lt__() and __eq__() are sufficient, if you want the conventional meanings of the comparison operators). The behavior of the is and is not operators cannot be customized; also they can be applied to any two objects and never raise an exception. Two more operations with the same syntactic priority, in and not in , are supported by types that are iterable or implement the __contains__() method. Numeric Types — int , float , complex ¶ There are three distinct numeric types: integers , floating-point numbers , and complex numbers . In addition, Booleans are a subtype of integers. Integers have unlimited precision. Floating-point numbers are usually implemented using double in C; information about the precision and internal representation of floating-point numbers for the machine on which your program is running is available in sys.float_info . Complex numbers have a real and imaginary part, which are each a floating-point number. To extract these parts from a complex number z , use z.real and z.imag . (The standard library includes the additional numeric types fractions.Fraction , for rationals, and decimal.Decimal , for floating-point numbers with user-definable precision.) Numbers are created by numeric literals or as the result of built-in functions and operators. Unadorned integer literals (including hex, octal and binary numbers) yield integers. Numeric literals containing a decimal point or an exponent sign yield floating-point numbers. Appending 'j' or 'J' to a numeric literal yields an imaginary number (a complex number with a zero real part) which you can add to an integer or float to get a complex number with real and imaginary parts. The constructors int() , float() , and complex() can be used to produce numbers of a specific type. Python fully supports mixed arithmetic: when a binary arithmetic operator has operands of different numeric types, the operand with the “narrower” type is widened to that of the other, where integer is narrower than floating point. Arithmetic with complex and real operands is defined by the usual mathematical formula, for example: x + complex ( u , v ) = complex ( x + u , v ) x * complex ( u , v ) = complex ( x * u , x * v ) A comparison between numbers of different types behaves as though the exact values of those numbers were being compared. [ 2 ] All numeric types (except complex) support the following operations (for priorities of the operations, see Operator precedence ): Operation Result Notes Full documentation x + y sum of x and y x - y difference of x and y x * y product of x and y x / y quotient of x and y x // y floored quotient of x and y (1)(2) x % y remainder of x / y (2) -x x negated +x x unchanged abs(x) absolute value or magnitude of x abs() int(x) x converted to integer (3)(6) int() float(x) x converted to floating point (4)(6) float() complex(re, im) a complex number with real part re , imaginary part im . im defaults to zero. (6) complex() c.conjugate() conjugate of the complex number c divmod(x, y) the pair (x // y, x % y) (2) divmod() pow(x, y) x to the power y (5) pow() x ** y x to the power y (5) Notes: Also referred to as integer division. For operands of type int , the result has type int . For operands of type float , the result has type float . In general, the result is a whole integer, though the result’s type is not necessarily int . The result is always rounded towards minus infinity: 1//2 is 0 , (-1)//2 is -1 , 1//(-2) is -1 , and (-1)//(-2) is 0 . Not for complex numbers. Instead convert to floats using abs() if appropriate. Conversion from float to int truncates, discarding the fractional part. See functions math.floor() and math.ceil() for alternative conversions. float also accepts the strings “nan” and “inf” with an optional prefix “+” or “-” for Not a Number (NaN) and positive or negative infinity. Python defines pow(0, 0) and 0 ** 0 to be 1 , as is common for programming languages. The numeric literals accepted include the digits 0 to 9 or any Unicode equivalent (code points with the Nd property). See the Unicode Standard for a complete list of code points with the Nd property. All numbers.Real types ( int and float ) also include the following operations: Operation Result math.trunc(x) x truncated to Integral round(x[, n]) x rounded to n digits, rounding half to even. If n is omitted, it defaults to 0. math.floor(x) the greatest Integral <= x math.ceil(x) the least Integral >= x For additional numeric operations see the math and cmath modules. Bitwise Operations on Integer Types ¶ Bitwise operations only make sense for integers. The result of bitwise operations is calculated as though carried out in two’s complement with an infinite number of sign bits. The priorities of the binary bitwise operations are all lower than the numeric operations and higher than the comparisons; the unary operation ~ has the same priority as the other unary numeric operations ( + and - ). This table lists the bitwise operations sorted in ascending priority: Operation Result Notes x | y bitwise or of x and y (4) x ^ y bitwise exclusive or of x and y (4) x & y bitwise and of x and y (4) x << n x shifted left by n bits (1)(2) x >> n x shifted right by n bits (1)(3) ~x the bits of x inverted Notes: Negative shift counts are illegal and cause a ValueError to be raised. A left shift by n bits is equivalent to multiplication by pow(2, n) . A right shift by n bits is equivalent to floor division by pow(2, n) . Performing these calculations with at least one extra sign extension bit in a finite two’s complement representation (a working bit-width of 1 + max(x.bit_length(), y.bit_length()) or more) is sufficient to get the same result as if there were an infinite number of sign bits. Additional Methods on Integer Types ¶ The int type implements the numbers.Integral abstract base class . In addition, it provides a few more methods: int. bit_length ( ) ¶ Return the number of bits necessary to represent an integer in binary, excluding the sign and leading zeros: >>> n = - 37 >>> bin ( n ) '-0b100101' >>> n . bit_length () 6 More precisely, if x is nonzero, then x.bit_length() is the unique positive integer k such that 2**(k-1) <= abs(x) < 2**k . Equivalently, when abs(x) is small enough to have a correctly rounded logarithm, then k = 1 + int(log(abs(x), 2)) . If x is zero, then x.bit_length() returns 0 . Equivalent to: def bit_length ( self ): s = bin ( self ) # binary representation: bin(-37) --> '-0b100101' s = s . lstrip ( '-0b' ) # remove leading zeros and minus sign return len ( s ) # len('100101') --> 6 Added in version 3.1. int. bit_count ( ) ¶ Return the number of ones in the binary representation of the absolute value of the integer. This is also known as the population count. Example: >>> n = 19 >>> bin ( n ) '0b10011' >>> n . bit_count () 3 >>> ( - n ) . bit_count () 3 Equivalent to: def bit_count ( self ): return bin ( self ) . count ( "1" ) Added in version 3.10. int. to_bytes ( length = 1 , byteorder = 'big' , * , signed = False ) ¶ Return an array of bytes representing an integer. >>> ( 1024 ) . to_bytes ( 2 , byteorder = 'big' ) b'\x04\x00' >>> ( 1024 ) . to_bytes ( 10 , byteorder = 'big' ) b'\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00' >>> ( - 1024 ) . to_bytes ( 10 , byteorder = 'big' , signed = True ) b'\xff\xff\xff\xff\xff\xff\xff\xff\xfc\x00' >>> x = 1000 >>> x . to_bytes (( x . bit_length () + 7 ) // 8 , byteorder = 'little' ) b'\xe8\x03' The integer is represented using length bytes, and defaults to 1. An OverflowError is raised if the integer is not representable with the given number of bytes. The byteorder argument determines the byte order used to represent the integer, and defaults to "big" . If byteorder is "big" , the most significant byte is at the beginning of the byte array. If byteorder is "little" , the most significant byte is at the end of the byte array. The signed argument determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised. The default value for signed is False . The default values can be used to conveniently turn an integer into a single byte object: >>> ( 65 ) . to_bytes () b'A' However, when using the default arguments, don’t try to convert a value greater than 255 or you’ll get an OverflowError . Equivalent to: def to_bytes ( n , length = 1 , byteorder = 'big' , signed = False ): if byteorder == 'little' : order = range ( length ) elif byteorder == 'big' : order = reversed ( range ( length )) else : raise ValueError ( "byteorder must be either 'little' or 'big'" ) return bytes (( n >> i * 8 ) & 0xff for i in order ) Added in version 3.2. Changed in version 3.11: Added default argument values for length and byteorder . classmethod int. from_bytes ( bytes , byteorder = 'big' , * , signed = False ) ¶ Return the integer represented by the given array of bytes. >>> int . from_bytes ( b ' \x00\x10 ' , byteorder = 'big' ) 16 >>> int . from_bytes ( b ' \x00\x10 ' , byteorder = 'little' ) 4096 >>> int . from_bytes ( b ' \xfc\x00 ' , byteorder = 'big' , signed = True ) -1024 >>> int . from_bytes ( b ' \xfc\x00 ' , byteorder = 'big' , signed = False ) 64512 >>> int . from_bytes ([ 255 , 0 , 0 ], byteorder = 'big' ) 16711680 The argument bytes must either be a bytes-like object or an iterable producing bytes. The byteorder argument determines the byte order used to represent the integer, and defaults to "big" . If byteorder is "big" , the most significant byte is at the beginning of the byte array. If byteorder is "little" , the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. The signed argument indicates whether two’s complement is used to represent the integer. Equivalent to: def from_bytes ( bytes , byteorder = 'big' , signed = False ): if byteorder == 'little' : little_ordered = list ( bytes ) elif byteorder == 'big' : little_ordered = list ( reversed ( bytes )) else : raise ValueError ( "byteorder must be either 'little' or 'big'" ) n = sum ( b << i * 8 for i , b in enumerate ( little_ordered )) if signed and little_ordered and ( little_ordered [ - 1 ] & 0x80 ): n -= 1 << 8 * len ( little_ordered ) return n Added in version 3.2. Changed in version 3.11: Added default argument value for byteorder . int. as_integer_ratio ( ) ¶ Return a pair of integers whose ratio is equal to the original integer and has a positive denominator. The integer ratio of integers (whole numbers) is always the integer as the numerator and 1 as the denominator. Added in version 3.8. int. is_integer ( ) ¶ Returns True . Exists for duck type compatibility with float.is_integer() . Added in version 3.12. Additional Methods on Float ¶ The float type implements the numbers.Real abstract base class . float also has the following additional methods. classmethod float. from_number ( x ) ¶ Class method to return a floating-point number constructed from a number x . If the argument is an integer or a floating-point number, a floating-point number with the same value (within Python’s floating-point precision) is returned. If the argument is outside the range of a Python float, an OverflowError will be raised. For a general Python object x , float.from_number(x) delegates to x.__float__() . If __float__() is not defined then it falls back to __index__() . Added in version 3.14. float. as_integer_ratio ( ) ¶ Return a pair of integers whose ratio is exactly equal to the original float. The ratio is in lowest terms and has a positive denominator. Raises OverflowError on infinities and a ValueError on NaNs. float. is_integer ( ) ¶ Return True if the float instance is finite with integral value, and False otherwise: >>> ( - 2.0 ) . is_integer () True >>> ( 3.2 ) . is_integer () False Two methods support conversion to and from hexadecimal strings. Since Python’s floats are stored internally as binary numbers, converting a float to or from a decimal string usually involves a small rounding error. In contrast, hexadecimal strings allow exact representation and specification of floating-point numbers. This can be useful when debugging, and in numerical work. float. hex ( ) ¶ Return a representation of a floating-point number as a hexadecimal string. For finite floating-point numbers, this representation will always include a leading 0x and a trailing p and exponent. classmethod float. fromhex ( s ) ¶ Class method to return the float represented by a hexadecimal string s . The string s may have leading and trailing whitespace. Note that float.hex() is an instance method, while float.fromhex() is a class method. A hexadecimal string takes the form: [ sign ] [ '0x' ] integer [ '.' fraction ] [ 'p' exponent ] where the optional sign may by either + or - , integer and fraction are strings of hexadecimal digits, and exponent is a decimal integer with an optional leading sign. Case is not significant, and there must be at least one hexadecimal digit in either the integer or the fraction. This syntax is similar to the syntax specified in section 6.4.4.2 of the C99 standard, and also to the syntax used in Java 1.5 onwards. In particular, the output of float.hex() is usable as a hexadecimal floating-point literal in C or Java code, and hexadecimal strings produced by C’s %a format character or Java’s Double.toHexString are accepted by float.fromhex() . Note that the exponent is written in decimal rather than hexadecimal, and that it gives the power of 2 by which to multiply the coefficient. For example, the hexadecimal string 0x3.a7p10 represents the floating-point number (3 + 10./16 + 7./16**2) * 2.0**10 , or 3740.0 : >>> float . fromhex ( '0x3.a7p10' ) 3740.0 Applying the reverse conversion to 3740.0 gives a different hexadecimal string representing the same number: >>> float . hex ( 3740.0 ) '0x1.d380000000000p+11' Additional Methods on Complex ¶ The complex type implements the numbers.Complex abstract base class . complex also has the following additional methods. classmethod complex. from_number ( x ) ¶ Class method to convert a number to a complex number. For a general Python object x , complex.from_number(x) delegates to x.__complex__() . If __complex__() is not defined then it falls back to __float__() . If __float__() is not defined then it falls back to __index__() . Added in version 3.14. Hashing of numeric types ¶ For numbers x and y , possibly of different types, it’s a requirement that hash(x) == hash(y) whenever x == y (see the __hash__() method documentation for more details). For ease of implementation and efficiency across a variety of numeric types (including int , float , decimal.Decimal and fractions.Fraction ) Python’s hash for numeric types is based on a single mathematical function that’s defined for any rational number, and hence applies to all instances of int and fractions.Fraction , and all finite instances of float and decimal.Decimal . Essentially, this function is given by reduction modulo P for a fixed prime P . The value of P is made available to Python as the modulus attribute of sys.hash_info . CPython implementation detail: Currently, the prime used is P = 2**31 - 1 on machines with 32-bit C longs and P = 2**61 - 1 on machines with 64-bit C longs. Here are the rules in detail: If x = m / n is a nonnegative rational number and n is not divisible by P , define hash(x) as m * invmod(n, P) % P , where invmod(n, P) gives the inverse of n modulo P . If x = m / n is a nonnegative rational number and n is divisible by P (but m is not) then n has no inverse modulo P and the rule above doesn’t apply; in this case define hash(x) to be the constant value sys.hash_info.inf . If x = m / n is a negative rational number define hash(x) as -hash(-x) . If the resulting hash is -1 , replace it with -2 . The particular values sys.hash_info.inf and -sys.hash_info.inf are used as hash values for positive infinity or negative infinity (respectively). For a complex number z , the hash values of the real and imaginary parts are combined by computing hash(z.real) + sys.hash_info.imag * hash(z.imag) , reduced modulo 2**sys.hash_info.width so that it lies in range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width - 1)) . Again, if the result is -1 , it’s replaced with -2 . To clarify the above rules, here’s some example Python code, equivalent to the built-in hash, for computing the hash of a rational number, float , or complex : import sys , math def hash_fraction ( m , n ): """Compute the hash of a rational number m / n. Assumes m and n are integers, with n positive. Equivalent to hash(fractions.Fraction(m, n)). """ P = sys . hash_info . modulus # Remove common factors of P. (Unnecessary if m and n already coprime.) while m % P == n % P == 0 : m , n = m // P , n // P if n % P == 0 : hash_value = sys . hash_info . inf else : # Fermat's Little Theorem: pow(n, P-1, P) is 1, so # pow(n, P-2, P) gives the inverse of n modulo P. hash_value = ( abs ( m ) % P ) * pow ( n , P - 2 , P ) % P if m < 0 : hash_value = - hash_value if hash_value == - 1 : hash_value = - 2 return hash_value def hash_float ( x ): """Compute the hash of a float x.""" if math . isnan ( x ): return object . __hash__ ( x ) elif math . isinf ( x ): return sys . hash_info . inf if x > 0 else - sys . hash_info . inf else : return hash_fraction ( * x . as_integer_ratio ()) def hash_complex ( z ): """Compute the hash of a complex number z.""" hash_value = hash_float ( z . real ) + sys . hash_info . imag * hash_float ( z . imag ) # do a signed reduction modulo 2**sys.hash_info.width M = 2 ** ( sys . hash_info . width - 1 ) hash_value = ( hash_value & ( M - 1 )) - ( hash_value & M ) if hash_value == - 1 : hash_value = - 2 return hash_value Boolean Type - bool ¶ Booleans represent truth values. The bool type has exactly two constant instances: True and False . The built-in function bool() converts any value to a boolean, if the value can be interpreted as a truth value (see section Truth Value Testing above). For logical operations, use the boolean operators and , or and not . When applying the bitwise operators & , | , ^ to two booleans, they return a bool equivalent to the logical operations “and”, “or”, “xor”. However, the logical operators and , or and != should be preferred over & , | and ^ . Deprecated since version 3.12: The use of the bitwise inversion operator ~ is deprecated and will raise an error in Python 3.16. bool is a subclass of int (see Numeric Types — int, float, complex ). In many numeric contexts, False and True behave like the integers 0 and 1, respectively. However, relying on this is discouraged; explicitly convert using int() instead. Iterator Types ¶ Python supports a concept of iteration over containers. This is implemented using two distinct methods; these are used to allow user-defined classes to support iteration. Sequences, described below in more detail, always support the iteration methods. One method needs to be defined for container objects to provide iterable support: container. __iter__ ( ) ¶ Return an iterator object. The object is required to support the iterator protocol described below. If a container supports different types of iteration, additional methods can be provided to specifically request iterators for those iteration types. (An example of an object supporting multiple forms of iteration would be a tree structure which supports both breadth-first and depth-first traversal.) This method corresponds to the tp_iter slot of the type structure for Python objects in the Python/C API. The iterator objects themselves are required to support the following two methods, which together form the iterator protocol : iterator. __iter__ ( ) ¶ Return the iterator object itself. This is required to allow both containers and iterators to be used with the for and in statements. This method corresponds to the tp_iter slot of the type structure for Python objects in the Python/C API. iterator. __next__ ( ) ¶ Return the next item from the iterator . If there are no further items, raise the StopIteration exception. This method corresponds to the tp_iternext slot of the type structure for Python objects in the Python/C API. Python defines several iterator objects to support iteration over general and specific sequence types, dictionaries, and other more specialized forms. The specific types are not important beyond their implementation of the iterator protocol. Once an iterator’s __next__() method raises StopIteration , it must continue to do so on subsequent calls. Implementations that do not obey this property are deemed broken. Generator Types ¶ Python’s generator s provide a convenient way to implement the iterator protocol. If a container object’s __iter__() method is implemented as a generator, it will automatically return an iterator object (technically, a generator object) supplying the __iter__() and __next__() methods. More information about generators can be found in the documentation for the yield expression . Sequence Types — list , tuple , range ¶ There are three basic sequence types: lists, tuples, and range objects. Additional sequence types tailored for processing of binary data and text strings are described in dedicated sections. Common Sequence Operations ¶ The operations in the following table are supported by most sequence types, both mutable and immutable. The collections.abc.Sequence ABC is provided to make it easier to correctly implement these operations on custom sequence types. This table lists the sequence operations sorted in ascending priority. In the table, s and t are sequences of the same type, n , i , j and k are integers and x is an arbitrary object that meets any type and value restrictions imposed by s . The in and not in operations have the same priorities as the comparison operations. The + (concatenation) and * (repetition) operations have the same priority as the corresponding numeric operations. [ 3 ] Operation Result Notes x in s True if an item of s is equal to x , else False (1) x not in s False if an item of s is equal to x , else True (1) s + t the concatenation of s and t (6)(7) s * n or n * s equivalent to adding s to itself n times (2)(7) s[i] i th item of s , origin 0 (3)(8) s[i:j] slice of s from i to j (3)(4) s[i:j:k] slice of s from i to j with step k (3)(5) len(s) length of s min(s) smallest item of s max(s) largest item of s Sequences of the same type also support comparisons. In particular, tuples and lists are compared lexicographically by comparing corresponding elements. This means that to compare equal, every element must compare equal and the two sequences must be of the same type and have the same length. (For full details see Comparisons in the language reference.) Forward and reversed iterators over mutable sequences access values using an index. That index will continue to march forward (or backward) even if the underlying sequence is mutated. The iterator terminates only when an IndexError or a StopIteration is encountered (or when the index drops below zero). Notes: While the in and not in operations are used only for simple containment testing in the general case, some specialised sequences (such as str , bytes and bytearray ) also use them for subsequence testing: >>> "gg" in "eggs" True Values of n less than 0 are treated as 0 (which yields an empty sequence of the same type as s ). Note that items in the sequence s are not copied; they are referenced multiple times. This often haunts new Python programmers; consider: >>> lists = [[]] * 3 >>> lists [[], [], []] >>> lists [ 0 ] . append ( 3 ) >>> lists [[3], [3], [3]] What has happened is that [[]] is a one-element list containing an empty list, so all three elements of [[]] * 3 are references to this single empty list. Modifying any of the elements of lists modifies this single list. You can create a list of different lists this way: >>> lists = [[] for i in range ( 3 )] >>> lists [ 0 ] . append ( 3 ) >>> lists [ 1 ] . append ( 5 ) >>> lists [ 2 ] . append ( 7 ) >>> lists [[3], [5], [7]] Further explanation is available in the FAQ entry How do I create a multidimensional list? . If i or j is negative, the index is relative to the end of sequence s : len(s) + i or len(s) + j is substituted. But note that -0 is still 0 . The slice of s from i to j is defined as the sequence of items with index k such that i <= k < j . If i is omitted or None , use 0 . If j is omitted or None , use len(s) . If i or j is less than -len(s) , use 0 . If i or j is greater than len(s) , use len(s) . If i is greater than or equal to j , the slice is empty. The slice of s from i to j with step k is defined as the sequence of items with index x = i + n*k such that 0 <= n < (j-i)/k . In other words, the indices are i , i+k , i+2*k , i+3*k and so on, stopping when j is reached (but never including j ). When k is positive, i and j are reduced to len(s) if they are greater. When k is negative, i and j are reduced to len(s) - 1 if they are greater. If i or j are omitted or None , they become “end” values (which end depends on the sign of k ). Note, k cannot be zero. If k is None , it is treated like 1 . Concatenating immutable sequences always results in a new object. This means that building up a sequence by repeated concatenation will have a quadratic runtime cost in the total sequence length. To get a linear runtime cost, you must switch to one of the alternatives below: if concatenating str objects, you can build a list and use str.join() at the end or else write to an io.StringIO instance and retrieve its value when complete if concatenating bytes objects, you can similarly use bytes.join() or io.BytesIO , or you can do in-place concatenation with a bytearray object. bytearray objects are mutable and have an efficient overallocation mechanism if concatenating tuple objects, extend a list instead for other types, investigate the relevant class documentation Some sequence types (such as range ) only support item sequences that follow specific patterns, and hence don’t support sequence concatenation or repetition. An IndexError is raised if i is outside the sequence range. Sequence Methods Sequence types also support the following methods: sequence. count ( value , / ) ¶ Return the total number of occurrences of value in sequence . sequence. index ( value[, start[, stop] ) ¶ Return the index of the first occurrence of value in sequence . Raises ValueError if value is not found in sequence . The start or stop arguments allow for efficient searching of subsections of the sequence, beginning at start and ending at stop . This is roughly equivalent to start + sequence[start:stop].index(value) , only without copying any data. Caution Not all sequence types support passing the start and stop arguments. Immutable Sequence Types ¶ The only operation that immutable sequence types generally implement that is not also implemented by mutable sequence types is support for the hash() built-in. This support allows immutable sequences, such as tuple instances, to be used as dict keys and stored in set and frozenset instances. Attempting to hash an immutable sequence that contains unhashable values will result in TypeError . Mutable Sequence Types ¶ The operations in the following table are defined on mutable sequence types. The collections.abc.MutableSequence ABC is provided to make it easier to correctly implement these operations on custom sequence types. In the table s is an instance of a mutable sequence type, t is any iterable object and x is an arbitrary object that meets any type and value restrictions imposed by s (for example, bytearray only accepts integers that meet the value restriction 0 <= x <= 255 ). Operation Result Notes s[i] = x item i of s is replaced by x del s[i] removes item i of s s[i:j] = t slice of s from i to j is replaced by the contents of the iterable t del s[i:j] removes the elements of s[i:j] from the list (same as s[i:j] = [] ) s[i:j:k] = t the elements of s[i:j:k] are replaced by those of t (1) del s[i:j:k] removes the elements of s[i:j:k] from the list s += t extends s with the contents of t (for the most part the same as s[len(s):len(s)] = t ) s *= n updates s with its contents repeated n times (2) Notes: If k is not equal to 1 , t must have the same length as the slice it is replacing. The value n is an integer, or an object implementing __index__() . Zero and negative values of n clear the sequence. Items in the sequence are not copied; they are referenced multiple times, as explained for s * n under Common Sequence Operations . Mutable Sequence Methods Mutable sequence types also support the following methods: sequence. append ( value , / ) ¶ Append value to the end of the sequence This is equivalent to writing seq[len(seq):len(seq)] = [value] . sequence. clear ( ) ¶ Added in version 3.3. Remove all items from sequence . This is equivalent to writing del sequence[:] . sequence. copy ( ) ¶ Added in version 3.3. Create a shallow copy of sequence . This is equivalent to writing sequence[:] . Hint The copy() method is not part of the MutableSequence ABC , but most concrete mutable sequence types provide it. sequence. extend ( iterable , / ) ¶ Extend sequence with the contents of iterable . For the most part, this is the same as writing seq[len(seq):len(seq)] = iterable . sequence. insert ( index , value , / ) ¶ Insert value into sequence at the given index . This is equivalent to writing sequence[index:index] = [value] . sequence. pop ( index = -1 , / ) ¶ Retrieve the item at index and also removes it from sequence . By default, the last item in sequence is removed and returned. sequence. remove ( value , / ) ¶ Remove the first item from sequence where sequence[i] == value . Raises ValueError if value is not found in sequence . sequence. reverse ( ) ¶ Reverse the items of sequence in place. This method maintains economy of space when reversing a large sequence. To remind users that it operates by side-effect, it returns None . Lists ¶ Lists are mutable sequences, typically used to store collections of homogeneous items (where the precise degree of similarity will vary by application). class list ( iterable = () , / ) ¶ Lists may be constructed in several ways: Using a pair of square brackets to denote the empty list: [] Using square brackets, separating items with commas: [a] , [a, b, c] Using a list comprehension: [x for x in iterable] Using the type constructor: list() or list(iterable) The constructor builds a list whose items are the same and in the same order as iterable ’s items. iterable may be either a sequence, a container that supports iteration, or an iterator object. If iterable is already a list, a copy is made and returned, similar to iterable[:] . For example, list('abc') returns ['a', 'b', 'c'] and list( (1, 2, 3) ) returns [1, 2, 3] . If no argument is given, the constructor creates a new empty list, [] . Many other operations also produce lists, including the sorted() built-in. Lists implement all of the common and mutable sequence operations. Lists also provide the following additional method: sort ( * , key = None , reverse = False ) ¶ This method sorts the list in place, using only < comparisons between items. Exceptions are not suppressed - if any comparison operations fail, the entire sort operation will fail (and the list will likely be left in a partially modified state). sort() accepts two arguments that can only be passed by keyword ( keyword-only arguments ): key specifies a function of one argument that is used to extract a comparison key from each list element (for example, key=str.lower ). The key corresponding to each item in the list is calculated once and then used for the entire sorting process. The default value of None means that list items are sorted directly without calculating a separate key value. The functools.cmp_to_key() utility is available to convert a 2.x style cmp function to a key function. reverse is a boolean value. If set to True , then the list elements are sorted as if each comparison were reversed. This method modifies the sequence in place for economy of space when sorting a large sequence. To remind users that it operates by side effect, it does not return the sorted sequence (use sorted() to explicitly request a new sorted list instance). The sort() method is guaranteed to be stable. A sort is stable if it guarantees not to change the relative order of elements that compare equal — this is helpful for sorting in multiple passes (for example, sort by department, then by salary grade). For sorting examples and a brief sorting tutorial, see Sorting Techniques . CPython implementation detail: While a list is being sorted, the effect of attempting to mutate, or even inspect, the list is undefined. The C implementation of Python makes the list appear empty for the duration, and raises ValueError if it can detect that the list has been mutated during a sort. Thread safety Reading a single element from a list is atomic : lst [ i ] # list.__getitem__ The following methods traverse the list and use atomic reads of each item to perform their function. That means that they may return results affected by concurrent modifications: item in lst lst . index ( item ) lst . count ( item ) All of the above methods/operations are also lock-free. They do not block concurrent modifications. Other operations that hold a lock will not block these from observing intermediate states. All other operations from here on block using the per-object lock. Writing a single item via lst[i] = x is safe to call from multiple threads and will not corrupt the list. The following operations return new objects and appear atomic to other threads: lst1 + lst2 # concatenates two lists into a new list x * lst # repeats lst x times into a new list lst . copy () # returns a shallow copy of the list Methods that only operate on a single elements with no shifting required are atomic : lst . append ( x ) # append to the end of the list, no shifting required lst . pop () # pop element from the end of the list, no shifting required The clear() method is also atomic . Other threads cannot observe elements being removed. The sort() method is not atomic . Other threads cannot observe intermediate states during sorting, but the list appears empty for the duration of the sort. The following operations may allow lock-free operations to observe intermediate states since they modify multiple elements in place: lst . insert ( idx , item ) # shifts elements lst . pop ( idx ) # idx not at the end of the list, shifts elements lst *= x # copies elements in place The remove() method may allow concurrent modifications since element comparison may execute arbitrary Python code (via __eq__() ). extend() is safe to call from multiple threads. However, its guarantees depend on the iterable passed to it. If it is a list , a tuple , a set , a frozenset , a dict or a dictionary view object (but not their subclasses), the extend operation is safe from concurrent modifications to the iterable. Otherwise, an iterator is created which can be concurrently modified by another thread. The same applies to inplace concatenation of a list with other iterables when using lst += iterable . Similarly, assigning to a list slice with lst[i:j] = iterable is safe to call from multiple threads, but iterable is only locked when it is also a list (but not its subclasses). Operations that involve multiple accesses, as well as iteration, are never atomic. For example: # NOT atomic: read-modify-write lst [ i ] = lst [ i ] + 1 # NOT atomic: check-then-act if lst : item = lst . pop () # NOT thread-safe: iteration while modifying for item in lst : process ( item ) # another thread may modify lst Consider external synchronization when sharing list instances across threads. See Python support for free threading for more information. Tuples ¶ Tuples are immutable sequences, typically used to store collections of heterogeneous data (such as the 2-tuples produced by the enumerate() built-in). Tuples are also used for cases where an immutable sequence of homogeneous data is needed (such as allowing storage in a set or dict instance). class tuple ( iterable = () , / ) ¶ Tuples may be constructed in a number of ways: Using a pair of parentheses to denote the empty tuple: () Using a trailing comma for a singleton tuple: a, or (a,) Separating items with commas: a, b, c or (a, b, c) Using the tuple() built-in: tuple() or tuple(iterable) The constructor builds a tuple whose items are the same and in the same order as iterable ’s items. iterable may be either a sequence, a container that supports iteration, or an iterator object. If iterable is already a tuple, it is returned unchanged. For example, tuple('abc') returns ('a', 'b', 'c') and tuple( [1, 2, 3] ) returns (1, 2, 3) . If no argument is given, the constructor creates a new empty tuple, () . Note that it is actually the comma which makes a tuple, not the parentheses. The parentheses are optional, except in the empty tuple case, or when they are needed to avoid syntactic ambiguity. For example, f(a, b, c) is a function call with three arguments, while f((a, b, c)) is a function call with a 3-tuple as the sole argument. Tuples implement all of the common sequence operations. For heterogeneous collections of data where access by name is clearer than access by index, collections.namedtuple() may be a more appropriate choice than a simple tuple object. Ranges ¶ The range type represents an immutable sequence of numbers and is commonly used for looping a specific number of times in for loops. class range ( stop , / ) ¶ class range ( start , stop , step = 1 , / ) The arguments to the range constructor must be integers (either built-in int or any object that implements the __index__() special method). If the step argument is omitted, it defaults to 1 . If the start argument is omitted, it defaults to 0 . If step is zero, ValueError is raised. For a positive step , the contents of a range r are determined by the formula r[i] = start + step*i where i >= 0 and r[i] < stop . For a negative step , the contents of the range are still determined by the formula r[i] = start + step*i , but the constraints are i >= 0 and r[i] > stop . A range object will be empty if r[0] does not meet the value constraint. Ranges do support negative indices, but these are interpreted as indexing from the end of the sequence determined by the positive indices. Ranges containing absolute values larger than sys.maxsize are permitted but some features (such as len() ) may raise OverflowError . Range examples: >>> list ( range ( 10 )) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> list ( range ( 1 , 11 )) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] >>> list ( range ( 0 , 30 , 5 )) [0, 5, 10, 15, 20, 25] >>> list ( range ( 0 , 10 , 3 )) [0, 3, 6, 9] >>> list ( range ( 0 , - 10 , - 1 )) [0, -1, -2, -3, -4, -5, -6, -7, -8, -9] >>> list ( range ( 0 )) [] >>> list ( range ( 1 , 0 )) [] Ranges implement all of the common sequence operations except concatenation and repetition (due to the fact that range objects can only represent sequences that follow a strict pattern and repetition and concatenation will usually violate that pattern). start ¶ The value of the start parameter (or 0 if the parameter was not supplied) stop ¶ The value of the stop parameter step ¶ The value of the step parameter (or 1 if the parameter was not supplied) The advantage of the range type over a regular list or tuple is that a range object will always take the same (small) amount of memory, no matter the size of the range it represents (as it only stores the start , stop and step values, calculating individual items and subranges as needed). Range objects implement the collections.abc.Sequence ABC, and provide features such as containment tests, element index lookup, slicing and support for negative indices (see Sequence Types — list, tuple, range ): >>> r = range ( 0 , 20 , 2 ) >>> r range(0, 20, 2) >>> 11 in r False >>> 10 in r True >>> r . index ( 10 ) 5 >>> r [ 5 ] 10 >>> r [: 5 ] range(0, 10, 2) >>> r [ - 1 ] 18 Testing range objects for equality with == and != compares them as sequences. That is, two range objects are considered equal if they represent the same sequence of values. (Note that two range objects that compare equal might have different start , stop and step attributes, for example range(0) == range(2, 1, 3) or range(0, 3, 2) == range(0, 4, 2) .) Changed in version 3.2: Implement the Sequence ABC. Support slicing and negative indices. Test int objects for membership in constant time instead of iterating through all items. Changed in version 3.3: Define ‘==’ and ‘!=’ to compare range objects based on the sequence of values they define (instead of comparing based on object identity). Added the start , stop and step attributes. See also The linspace recipe shows how to implement a lazy version of range suitable for floating-point applications. Text and Binary Sequence Type Methods Summary ¶ The following table summarizes the text and binary sequence types methods by category. Category str methods bytes and bytearray methods Formatting str.format() str.format_map() f-strings printf-style String Formatting printf-style Bytes Formatting Searching and Replacing str.find() str.rfind() bytes.find() bytes.rfind() str.index() str.rindex() bytes.index() bytes.rindex() str.startswith() bytes.startswith() str.endswith() bytes.endswith() str.count() bytes.count() str.replace() bytes.replace() Splitting and Joining str.split() str.rsplit() bytes.split() bytes.rsplit() str.splitlines() bytes.splitlines() str.partition() bytes.partition() str.rpartition() bytes.rpartition() str.join() bytes.join() String Classification str.isalpha() bytes.isalpha() str.isdecimal() str.isdigit() bytes.isdigit() str.isnumeric() str.isalnum() bytes.isalnum() str.isidentifier() str.islower() bytes.islower() str.isupper() bytes.isupper() str.istitle() bytes.istitle() str.isspace() bytes.isspace() str.isprintable() Case Manipulation str.lower() bytes.lower() str.upper() bytes.upper() str.casefold() str.capitalize() bytes.capitalize() str.title() bytes.title() str.swapcase() bytes.swapcase() Padding and Stripping str.ljust() str.rjust() bytes.ljust() bytes.rjust() str.center() bytes.center() str.expandtabs() bytes.expandtabs() str.strip() bytes.strip() str.lstrip() str.rstrip() bytes.lstrip() bytes.rstrip() Translation and Encoding str.translate() bytes.translate() str.maketrans() bytes.maketrans() str.encode() bytes.decode() Text Sequence Type — str ¶ Textual data in Python is handled with str objects, or strings . Strings are immutable sequences of Unicode code points. String literals are written in a variety of ways: Single quotes: 'allows embedded "double" quotes' Double quotes: "allows embedded 'single' quotes" Triple quoted: '''Three single quotes''' , """Three double quotes""" Triple quoted strings may span multiple lines - all associated whitespace will be included in the string literal. String literals that are part of a single expression and have only whitespace between them will be implicitly converted to a single string literal. That is, ("spam " "eggs") == "spam eggs" . See String and Bytes literals for more about the various forms of string literal | 2026-01-13T08:48:44 |
https://highlight.io/privacy | Highlight: Privacy Policy Star us on GitHub Star Migrate your Highlight account to LaunchDarkly by February 28, 2026. Learn more on our blog. Product Integrations Pricing Resources Docs Sign in Sign up Privacy Policy Effective date: 11/05/2020 1. Introduction Welcome to Highlight Inc. Highlight Inc. (“us”, “we”, or “our”) operates https://highlight.io (hereinafter referred to as “Service”). Our Privacy Policy governs your visit to https://highlight.io, and explains how we collect, safeguard and disclose information that results from your use of our Service. We use your data to provide and improve Service. By using Service, you agree to the collection and use of information in accordance with this policy. Unless otherwise defined in this Privacy Policy, the terms used in this Privacy Policy have the same meanings as in our Terms and Conditions. Our Terms and Conditions (“Terms”) govern all use of our Service and together with the Privacy Policy constitutes your agreement with us (“agreement”). 2. Definitions SERVICE means the https://highlight.io website operated by Highlight Inc. PERSONAL DATA means data about a living individual who can be identified from those data (or from those and other information either in our possession or likely to come into our possession). USAGE DATA is data collected automatically either generated by the use of Service or from Service infrastructure itself (for example, the duration of a page visit). COOKIES are small files stored on your device (computer or mobile device). DATA CONTROLLER means a natural or legal person who (either alone or jointly or in common with other persons) determines the purposes for which and the manner in which any personal data are, or are to be, processed. For the purpose of this Privacy Policy, we are a Data Controller of your data. DATA PROCESSORS (OR SERVICE PROVIDERS) means any natural or legal person who processes the data on behalf of the Data Controller. We may use the services of various Service Providers in order to process your data more effectively. DATA SUBJECT is any living individual who is the subject of Personal Data. THE USER is the individual using our Service. The User corresponds to the Data Subject, who is the subject of Personal Data. 3. Information Collection and Use We collect several different types of information for various purposes to provide and improve our Service to you. 4. Types of Data Collected Personal Data While using our Service, we may ask you to provide us with certain personally identifiable information that can be used to contact or identify you (“Personal Data”). Personally identifiable information may include, but is not limited to: Email address First name and last name Phone number IP Address, Address, State, Province, ZIP/Postal code, City Cookies and Usage Data We may use your Personal Data to contact you with newsletters, marketing or promotional materials and other information that may be of interest to you. You may opt out of receiving any, or all, of these communications from us by emailing at jay@highlight.io. Usage Data We may also collect information that your browser sends whenever you visit our Service or when you access Service by or through a mobile device (“Usage Data”). This Usage Data may include information such as your computer's Internet Protocol address (e.g. IP address), browser type, browser version, the pages of our Service that you visit, the time and date of your visit, the time spent on those pages, unique device identifiers and other diagnostic data. When you access Service with a mobile device, this Usage Data may include information such as the type of mobile device you use, your mobile device unique ID, the IP address of your mobile device, your mobile operating system, the type of mobile Internet browser you use, unique device identifiers and other diagnostic data. Tracking Cookies Data We use cookies and similar tracking technologies to track the activity on our Service and we hold certain information. Cookies are files with a small amount of data which may include an anonymous unique identifier. Cookies are sent to your browser from a website and stored on your device. Other tracking technologies are also used such as beacons, tags and scripts to collect and track information and to improve and analyze our Service. You can instruct your browser to refuse all cookies or to indicate when a cookie is being sent. However, if you do not accept cookies, you may not be able to use some portions of our Service. Examples of Cookies we use: Session Cookies: We use Session Cookies to operate our Service. Preference Cookies: We use Preference Cookies to remember your preferences and various settings. Security Cookies: We use Security Cookies for security purposes. Advertising Cookies: Advertising Cookies are used to serve you with advertisements that may be relevant to you and your interests. 5. Use of Data Highlight Inc. uses the collected data for various purposes: to provide and maintain our Service; to notify you about changes to our Service; to allow you to participate in interactive features of our Service when you choose to do so; to provide customer support; to gather analysis or valuable information so that we can improve our Service; to monitor the usage of our Service; to detect, prevent and address technical issues; to fulfill any other purpose for which you provide it; to carry out our obligations and enforce our rights arising from any contracts entered into between you and us, including for billing and collection; to provide you with notices about your account and/or subscription, including expiration and renewal notices, email-instructions, etc.; to provide you with news, special offers and general information about other goods, services and events which we offer that are similar to those that you have already purchased or enquired about unless you have opted not to receive such information; in any other way we may describe when you provide the information; for any other purpose with your consent. 6. Retention of Data We will retain your Personal Data only for as long as is necessary for the purposes set out in this Privacy Policy. We will retain and use your Personal Data to the extent necessary to comply with our legal obligations (for example, if we are required to retain your data to comply with applicable laws), resolve disputes, and enforce our legal agreements and policies. We will also retain Usage Data for internal analysis purposes. Usage Data is generally retained for a shorter period, except when this data is used to strengthen the security or to improve the functionality of our Service, or we are legally obligated to retain this data for longer time periods. 7. Transfer of Data Your information, including Personal Data, may be transferred to – and maintained on – computers located outside of your state, province, country or other governmental jurisdiction where the data protection laws may differ from those of your jurisdiction. If you are located outside United States and choose to provide information to us, please note that we transfer the data, including Personal Data, to United States and process it there. Your consent to this Privacy Policy followed by your submission of such information represents your agreement to that transfer. Highlight Inc. will take all the steps reasonably necessary to ensure that your data is treated securely and in accordance with this Privacy Policy and no transfer of your Personal Data will take place to an organisation or a country unless there are adequate controls in place including the security of your data and other personal information. 8. Disclosure of Data We may disclose personal information that we collect, or you provide: Disclosure for Law Enforcement. Under certain circumstances, we may be required to disclose your Personal Data if required to do so by law or in response to valid requests by public authorities. Business Transaction. If we or our subsidiaries are involved in a merger, acquisition or asset sale, your Personal Data may be transferred. Other cases. We may disclose your information also: to our subsidiaries and affiliates; with your consent in any other cases; 9. Security of Data The security of your data is important to us but remember that no method of transmission over the Internet or method of electronic storage is 100% secure. While we strive to use commercially acceptable means to protect your Personal Data, we cannot guarantee its absolute security. 10. Your Data Protection Rights Under General Data Protection Regulation (GDPR) If you are a resident of the European Union (EU) and European Economic Area (EEA), you have certain data protection rights, covered by GDPR. – See more at https://eur-lex.europa.eu/eli/reg/2016/679/oj We aim to take reasonable steps to allow you to correct, amend, delete, or limit the use of your Personal Data. If you wish to be informed what Personal Data we hold about you and if you want it to be removed from our systems, please email us at jay@highlight.io. In certain circumstances, you have the following data protection rights: the right to access, update or to delete the information we have on you; the right of rectification. You have the right to have your information rectified if that information is inaccurate or incomplete; the right to object. You have the right to object to our processing of your Personal Data; the right of restriction. You have the right to request that we restrict the processing of your personal information; the right to data portability. You have the right to be provided with a copy of your Personal Data in a structured, machine-readable and commonly used format; the right to withdraw consent. You also have the right to withdraw your consent at any time where we rely on your consent to process your personal information; Please note that we may ask you to verify your identity before responding to such requests. Please note, we may not able to provide Service without some necessary data. You have the right to complain to a Data Protection Authority about our collection and use of your Personal Data. For more information, please contact your local data protection authority in the European Economic Area (EEA). 11. Your Data Protection Rights under the California Privacy Protection Act (CalOPPA) CalOPPA is the first state law in the nation to require commercial websites and online services to post a privacy policy. The law’s reach stretches well beyond California to require a person or company in the United States (and conceivable the world) that operates websites collecting personally identifiable information from California consumers to post a conspicuous privacy policy on its website stating exactly the information being collected and those individuals with whom it is being shared, and to comply with this policy. – See more at: https://consumercal.org/about-cfc/cfc-education-foundation/california-online-privacy-protection-act-caloppa-3/ According to CalOPPA we agree to the following: users can visit our site anonymously; our Privacy Policy link includes the word “Privacy”, and can easily be found on the page specified above on the home page of our website; users will be notified of any privacy policy changes on our Privacy Policy Page; users are able to change their personal information by emailing us at jay@highlight.io. Our Policy on “Do Not Track” Signals: We honor Do Not Track signals and do not track, plant cookies, or use advertising when a Do Not Track browser mechanism is in place. Do Not Track is a preference you can set in your web browser to inform websites that you do not want to be tracked. You can enable or disable Do Not Track by visiting the Preferences or Settings page of your web browser. 12. Your Data Protection Rights under the California Consumer Privacy Act (CCPA) If you are a California resident, you are entitled to learn what data we collect about you, ask to delete your data and not to sell (share) it. To exercise your data protection rights, you can make certain requests and ask us: What personal information we have about you. If you make this request, we will return to you: The categories of personal information we have collected about you. The categories of sources from which we collect your personal information. The business or commercial purpose for collecting or selling your personal information. The categories of third parties with whom we share personal information. The specific pieces of personal information we have collected about you. A list of categories of personal information that we have sold, along with the category of any other company we sold it to. If we have not sold your personal information, we will inform you of that fact. A list of categories of personal information that we have disclosed for a business purpose, along with the category of any other company we shared it with. Please note, you are entitled to ask us to provide you with this information up to two times in a rolling twelve-month period. When you make this request, the information provided may be limited to the personal information we collected about you in the previous 12 months. To delete your personal information. If you make this request, we will delete the personal information we hold about you as of the date of your request from our records and direct any service providers to do the same. In some cases, deletion may be accomplished through de-identification of the information. If you choose to delete your personal information, you may not be able to use certain functions that require your personal information to operate. To stop selling your personal information. We don't sell or rent your personal information to any third parties for any purpose. You are the only owner of your Personal Data and can request disclosure or deletion at any time. Please note, if you ask us to delete or stop selling your data, it may impact your experience with us, and you may not be able to participate in certain programs or membership services which require the usage of your personal information to function. But in no circumstances, we will discriminate against you for exercising your rights. To exercise your California data protection rights described above, please send your request(s) by one of the following means: By email: jay@highlight.io Your data protection rights, described above, are covered by the CCPA, short for the California Consumer Privacy Act. To find out more, visit the official California Legislative Information website. The CCPA took effect on 01/01/2020. 13. Service Providers We may employ third party companies and individuals to facilitate our Service (“Service Providers”), provide Service on our behalf, perform Service-related services or assist us in analysing how our Service is used. These third parties have access to your Personal Data only to perform these tasks on our behalf and are obligated not to disclose or use it for any other purpose. 14. CI/CD tools We may use third-party Service Providers to automate the development process of our Service. GitHub GitHub is provided by GitHub, Inc. GitHub is a development platform to host and review code, manage projects, and build software. For more information on what data GitHub collects for what purpose and how the protection of the data is ensured, please visit GitHub Privacy Policy page: https://help.github.com/en/articles/github-privacy-statement. 15. Payments We may provide paid products and/or services within Service. In that case, we use third-party services for payment processing (e.g. payment processors). We will not store or collect your payment card details. That information is provided directly to our third-party payment processors whose use of your personal information is governed by their Privacy Policy. These payment processors adhere to the standards set by PCI-DSS as managed by the PCI Security Standards Council, which is a joint effort of brands like Visa, Mastercard, American Express and Discover. PCI-DSS requirements help ensure the secure handling of payment information. The payment processors we work with are: Stripe: Their Privacy Policy can be viewed at: https://stripe.com/us/privacy 16. Links to Other Sites Our Service may contain links to other sites that are not operated by us. If you click a third party link, you will be directed to that third party's site. We strongly advise you to review the Privacy Policy of every site you visit. We have no control over and assume no responsibility for the content, privacy policies or practices of any third party sites or services. 17. Children's Privacy Our Services are not intended for use by children under the age of 18 (“Child” or “Children”). We do not knowingly collect personally identifiable information from Children under 18. If you become aware that a Child has provided us with Personal Data, please contact us. If we become aware that we have collected Personal Data from Children without verification of parental consent, we take steps to remove that information from our servers. 18. Changes to This Privacy Policy We may update our Privacy Policy from time to time. We will notify you of any changes by posting the new Privacy Policy on this page. We will let you know via email and/or a prominent notice on our Service, prior to the change becoming effective and update “effective date” at the top of this Privacy Policy. You are advised to review this Privacy Policy periodically for any changes. Changes to this Privacy Policy are effective when they are posted on this page. 19. Contact Us If you have any questions about this Privacy Policy, please contact us: By email: jay@highlight.io. Try Highlight Today Get the visibility you need Get started for free Product Pricing Sign up Features Privacy & Security Customers Session Replay Error Monitoring Logging Competitors LogRocket Hotjar Fullstory Smartlook Inspectlet Datadog Sentry Site24x7 Sprig Mouseflow Pendo Heap LogicMonitor Last9 Axiom Better Stack HyperDX Dash0 Developers Changelog Documentation Ambassadors Frameworks React Next.js Angular Gatsby.js Svelte.js Vue.js Express Golang Next.js Node.js Rails Hono Contact & Legal Terms of Service Privacy Policy Careers sales@highlight.io security@highlight.io [object Object] | 2026-01-13T08:48:44 |
https://porkbun.com/about/porkbun-vs-cloudflare | porkbun.com | Porkbun vs Cloudflare: Choosing the Right Registrar Toggle navigation porkbun $0.00 (0) products Domains Transfers Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting All Web Hosting Options Easy WordPress Link In Bio Articulation Sitebuilder Cloud WordPress Shared cPanel Hosting Static Hosting Website Builder Easy PHP Email Hosting All Email Hosting Options Proton Mail Porkbun Email Free Email Forwarding Marketing Tools Textla - SMS Marketing Free WHOIS Privacy Free SSL Certificates Free URL Forwarding transfer Free WordPress SALE! .COM SALE! About --> About Who We Are Why Choose Porkbun Porkbun vs Cloudflare FAQs Resources Knowledge Base Porkbun Blog Service Status Help $0.00 (0) sign in Porkbun vs Cloudflare: Choosing the Right Registrar Choices... Choosing a domain registrar isn't just about grabbing a good deal, it's about finding the right combination of price, features, reliability, and support. On paper, comparing Porkbun vs. Cloudflare shows a lot of overlapping similarities, but when you dig into the details, some differences stand out to show why folks are choosing the Bun. Whether it's your first domain name or you've got hundreds, Porkbun gives you the best of both worlds: a registrar with 365 live, human support and DNS powered by Cloudflare, which, unlike Cloudflare, still allows you to point your nameservers elsewhere. Check out why people are switching to Porkbun as the alternative to Cloudflare and other big-name registrars. At-Cost Domain Pricing at Porkbun and Cloudflare When it comes to domain pricing at Porkbun vs Cloudflare, we'll give credit where it's due. Cloudflare sells domains at cost with no markup, which is pretty awesome. But here's the thing: we do that too! Porkbun sells most of our domains at cost, including .com domains. The difference? We make the overall experience way easier and more user-friendly. Our versions of "at cost" domains also differ slightly because Cloudflare, a multibillion dollar public company, does not consider credit card fees a "cost". For a smaller, independent company like Porkbun, credit card fees are not something we can simply take a loss on. Our prices tend to differ by pennies on the dollar, though we often beat them on promotional pricing since they don't work with wholesale domain registries to offer sales. While Cloudflare keeps things minimal and expects you to figure out the rest, Porkbun gives you transparent pricing PLUS a ton of free domain features and personalized support 365 days a year. You get great wholesale pricing, but with an experience that actually makes sense for real people. No hunting around for additional service or piecing together different platforms. You get straightforward domain registration that's easy to understand. Friendly, Human Support You Can Actually Reach One of the biggest gaps in the Porkbun vs Cloudflare comparison is in customer support. If you just buy domains at Cloudflare, you will receive NO personalized support. You can search for answers in their community forums, but you do not get any live human support. If you want chat support at Cloudflare you will need a Business service plan currently valued at $200 a month. Phone support is limited even for their more expensive Enterprise plans, and the cost of these plans aren't even published on their website. Porkbun takes a different approach even if you haven't purchased a single domain name from us yet. When you need assistance here, you're getting: Personalized support from real humans, 365 days a year 24/7 email support, with live phone & chat available daily from 9am-5pm PT. Cloudflare's focus is largely on self-service and enterprise-level clients. If you're a solo creator, small business, or just need help with basic setup, you're mostly on your own or forced to upgrade for priority assistance. You shouldn't need a premium subscription just to get a question answered. At Porkbun, help is here when you need it. Web Hosting, Email, & DNS Management Options Pricing and management features are another factor for comparing Cloudflare vs Porkbun. The most important difference is that domain registration at Cloudflare requires that your nameservers stay pointed at Cloudflare, limiting your ability to manage your own DNS. We don't do that at Porkbun and we, and many experts, would caution you against limiting yourself in this way. Sure, Cloudflare domain registration comes with no markup on wholesale pricing, which sounds great until you realize it's a barebones experience. Need email hosting? A website builder? Want a Cloud WordPress hosting option to launch your site with ease? You'll have to look elsewhere. Unlike Cloudflare, which only provides domain registration and DNS (and expects you to bring your own hosting/email stack), Porkbun offers a full range of web services like: DNS management powered by Cloudflare for maximum uptime Hosting options like Cloud WordPress, cPanel hosting, and more Affordable email hosting, including a Proton Mail option for added security Articulation website builder to create your site without needing any tech experience You might've noticed we said our DNS management is backed by Cloudflare. That's true! Porkbun DNS is powered by Cloudflare infrastructure but without the hands-off experience or limited registrar tools. It's the best of both worlds, all in one place at Porkbun. Feature-Packed Domains Without the Upsell So the pricing structure is similar at Porkbun vs Cloudflare, but what about those free domain features we mentioned? At Porkbun, you'll get everything you need with your domain from day one. We offer lots of free domain management features like: WHOIS privacy SSL certificates DNS management powered by Cloudflare URL forwarding Email forwarding Web and email hosting trials User-friendly domain management dashboard There's no jumping between tools or platforms, and no guesswork. Just everything you need to build and manage your online presence in one spot. So... Cloudflare vs Porkbun? If you're a developer who loves building custom stacks and doesn't mind a do-it-yourself experience, Cloudflare might be just fine for you. But if you want a registrar that's approachable, affordable, and built for real people, not just tech pros or enterprises, Porkbun is the best domain registrar. We've even been named the #1 domain registrar by USA Today and Forbes Advisor to prove it! Now that you've compared Porkbun vs Cloudflare, are you ready to make the switch? Get started with your next domain name here at the Bun. Get Your Domain Name You're In Good Hooves We are the highest-rated domain name registrar on Trustpilot, as reviewed by real customers. Trustpilot × Modal Title Close Close × Modal Title Close porkbun Porkbun is an amazingly awesome ICANN accredited domain name registrar based out of the Pacific Northwest. We're different, we're easy, and we're affordable. Use us, you won't be sorry. If you don't use us we'll be sad, but we'll still love you. Get Pork-Puns In Your Inbox Stay in the loop on all things Porkbun by signing up for our newsletter! 21370 SW Langer Farms Parkway, Suite 142-429 Sherwood, OR 97140, US If you're looking for support, you might be able to answer your own question using our Knowledge Base . Support Hours Impacted From January 3rd to January 11th we will be holding our annual company summit which will impact live and after hours support. Our goal is to provide you with an excellent domain registration experience and support and we all appreciate your patience as the whole company works together to make Porkbun even better. Thank you. Reach our USA-Based phone support team: 1.855.PORKBUN (1.855.767.5286) 9AM - 5PM Pacific Time Other Hours: Your mileage may vary, but give it a whirl support@porkbun.com 24 / 7 Email Support Chat Support Hours Vary Your browser does not support the audio element. This plays a little Porkbun jingle. Stay up to date with Porkbun. Sign up for our cool newsletter and we'll keep you up to date with sweet deals, amazing info, and maybe even the occasional limerick or sonnet. Sign Up Products Domain Names Greatest Deals Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting Link In Bio Articulation Sitebuilder Cloud WordPress cPanel Hosting Static Hosting Easy PHP Website Builder Email Hosting WHOIS Privacy DNS Management SSL Certificates Email Forwarding URL Forwarding Quick Connect Domain Transfer Affiliate Program Handshake Names Ethereum Name Service International Domain Names API Access Support Contact Us Knowledge Base Payment Options Report Abuse Tools Domain Search Domain Suggestion Generator RDAP (WHOIS) Password Generator Service Status Don't like our name? The Buniverse Your IP Address Online DNS Lookup Our Company About Us Our Official Blog Careers Branding Guidelines Policies and Legal Privacy Policy Data Disclosure Policy Bug Bounty Program Porkbun Merchandise Awesomeness Copyright © Porkbun LLC. All rights reserved. Porkbun is a Top Level Design Company Made in the USA 🇺🇸 This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. WARNING: This site has been known to cause a mind blowing experience. We recommend you prepare yourself mentally and if possible be sitting down. Side effects may include saving money, letting out a chuckle, and sporadic oinking. 1 × Modal Title Cancel Continue | 2026-01-13T08:48:44 |
https://highlight.io/error-monitoring | highlight.io: The open source monitoring platform. Star us on GitHub Star Migrate your Highlight account to LaunchDarkly by February 28, 2026. Learn more on our blog. Product Integrations Pricing Resources Docs Sign in Sign up Explore highlight.io Error monitoring for today’s developer. Error and exception monitoring built for modern web apps. Get started in seconds. Get started Live demo Request a Demo Call Uncover the issues user's face. Reproduce hard-to-crack bugs with error monitoring across your stack. Instant Stacktrace Enhancements. Enhanced stacktraces from your client and server-side errors, with optional uploading in CI. Read the Docs User context from the get-go. Understand the actual users affected by a given error. Keep your customers happy. Read the Docs From a “click” to a server-side error. Visualize a complete, cohesive view of your entire stack. All the way from a user clicking a button to a server-side error. Get started for free Support for all the modern frameworks. Whether it’s React, Angular, or even vanilla JS, we got you covered. Get started with just a few lines of code. View all frameworks import { H } from '@highlight-run/node' H.init({projectID: '<YOUR_PROJECT_ID>'}) const onError = (request, error) => { const parsed = H.parseHeaders(request.headers) H.consumeError(error, parsed.secureSessionId, parsed.requestId) } A few lines of code. That’s it. Turn on Session Replay in seconds and instantly get the visibility you need. Framework Docs import { H } from '@highlight-run/node' H.init({projectID: '<YOUR_PROJECT_ID>'}) const onError = (request, error) => { const parsed = H.parseHeaders(request.headers) H.consumeError(error, parsed.secureSessionId, parsed.requestId) } Above Example in Node.js Other Frameworks → Master OpenTelemetry with our Free Comprehensive Course From fundamentals to advanced implementations, learn how OpenTelemetry can transform your engineering team's observability practices. Ideal for engineering leaders and developers building production-ready monitoring solutions. Start Learning Our customers Highlight powers forward-thinking companies. More about our customers → Don't take our word. Read our customer review section → Highlight helps us catch bugs that would otherwise go undetected and makes it easy to replicate and debug them. Max Musing , Founder & CEO Highlight weaves together the incredible, varied, and complex interactions of our users into something understandable and actionable. Kai Hess , Founding Product Designer I love Highlight because not only does it help me debug more quickly, but it gives me insight into how customers are actually using our product. Meryl Dakin , Founding Software Engineer Highlight has helped us win over several customers by making it possible for us to provide hands-on support, based on a detailed understanding of what each user was doing. Neil Raina , CTO Highlight helps us catch bugs that would otherwise go undetected and makes it easy to replicate and debug them. Max Musing , Founder & CEO Highlight weaves together the incredible, varied, and complex interactions of our users into something understandable and actionable. Kai Hess , Founding Product Designer I love Highlight because not only does it help me debug more quickly, but it gives me insight into how customers are actually using our product. Meryl Dakin , Founding Software Engineer Highlight has helped us win over several customers by making it possible for us to provide hands-on support, based on a detailed understanding of what each user was doing. Neil Raina , CTO Try Highlight Today Get the visibility you need Get started for free Product Pricing Sign up Features Privacy & Security Customers Session Replay Error Monitoring Logging Competitors LogRocket Hotjar Fullstory Smartlook Inspectlet Datadog Sentry Site24x7 Sprig Mouseflow Pendo Heap LogicMonitor Last9 Axiom Better Stack HyperDX Dash0 Developers Changelog Documentation Ambassadors Frameworks React Next.js Angular Gatsby.js Svelte.js Vue.js Express Golang Next.js Node.js Rails Hono Contact & Legal Terms of Service Privacy Policy Careers sales@highlight.io security@highlight.io [object Object] | 2026-01-13T08:48:44 |
https://highlight.io/dashboards | highlight.io: The open source monitoring platform. Star us on GitHub Star Migrate your Highlight account to LaunchDarkly by February 28, 2026. Learn more on our blog. Product Integrations Pricing Resources Docs Sign in Sign up Explore highlight.io Dashboards & APM for modern web apps Visualize and analyze your observability data on a single pane. Get started Live demo Request a Demo Call Analyze metrics across your entire stack. A suite of tools for visualizing and manipulating data on your web application. From downtime to regressions. Understand the real reason why your web app has slow downs, increased error rates, and more. Read the Docs Understand user engagement across your application Visualize the reason why users stay and leave. Read the Docs Insane Performance. Powered by ClickHouse. Perform fast queries across all of your resources. Powered by ClickHouse, an industry leading time-series database. Read the Docs Get alerted across each resource Create alerts to make sure the right teams know when something goes wrong. Read the Docs Support for all the modern frameworks. Whether it's React, Angular, or even vanilla JS, we got you covered. View all frameworks Master OpenTelemetry with our Free Comprehensive Course From fundamentals to advanced implementations, learn how OpenTelemetry can transform your engineering team's observability practices. Ideal for engineering leaders and developers building production-ready monitoring solutions. Start Learning Our customers Highlight powers forward-thinking companies. More about our customers → Don't take our word. Read our customer review section → Highlight helps us catch bugs that would otherwise go undetected and makes it easy to replicate and debug them. Max Musing , Founder & CEO Highlight weaves together the incredible, varied, and complex interactions of our users into something understandable and actionable. Kai Hess , Founding Product Designer I love Highlight because not only does it help me debug more quickly, but it gives me insight into how customers are actually using our product. Meryl Dakin , Founding Software Engineer Highlight has helped us win over several customers by making it possible for us to provide hands-on support, based on a detailed understanding of what each user was doing. Neil Raina , CTO Highlight helps us catch bugs that would otherwise go undetected and makes it easy to replicate and debug them. Max Musing , Founder & CEO Highlight weaves together the incredible, varied, and complex interactions of our users into something understandable and actionable. Kai Hess , Founding Product Designer I love Highlight because not only does it help me debug more quickly, but it gives me insight into how customers are actually using our product. Meryl Dakin , Founding Software Engineer Highlight has helped us win over several customers by making it possible for us to provide hands-on support, based on a detailed understanding of what each user was doing. Neil Raina , CTO Try Highlight Today Get the visibility you need Get started for free Product Pricing Sign up Features Privacy & Security Customers Session Replay Error Monitoring Logging Competitors LogRocket Hotjar Fullstory Smartlook Inspectlet Datadog Sentry Site24x7 Sprig Mouseflow Pendo Heap LogicMonitor Last9 Axiom Better Stack HyperDX Dash0 Developers Changelog Documentation Ambassadors Frameworks React Next.js Angular Gatsby.js Svelte.js Vue.js Express Golang Next.js Node.js Rails Hono Contact & Legal Terms of Service Privacy Policy Careers sales@highlight.io security@highlight.io [object Object] | 2026-01-13T08:48:44 |
https://parenting.forem.com/t/familylife | Familylife - Parenting Forem Feed Follow new Subforems to improve your feed DEV Community Follow A space to discuss and keep up software development and manage your software career Future Follow News and discussion of science and technology such as AI, VR, cryptocurrency, quantum computing, and more. Open Forem Follow A general discussion space for the Forem community. If it doesn't have a home elsewhere, it belongs here Gamers Forem Follow An inclusive community for gaming enthusiasts Music Forem Follow From composing and gigging to gear, hot music takes, and everything in between. Vibe Coding Forem Follow Discussing AI software development, and showing off what we're building. Popcorn Movies and TV Follow Movie and TV enthusiasm, criticism and everything in-between. DUMB DEV Community Follow Memes and software development shitposting Design Community Follow Web design, graphic design and everything in-between Security Forem Follow Your central hub for all things security. From ethical hacking and CTFs to GRC and career development, for beginners and pros alike Golf Forem Follow A community of golfers and golfing enthusiasts Crypto Forem Follow A collaborative community for all things Crypto—from Bitcoin to protocol development and DeFi to NFTs and market analysis. Parenting Follow A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Forem Core Follow Discussing the core forem open source software project — features, bugs, performance, self-hosting. Maker Forem Follow A community for makers, hobbyists, and professionals to discuss Arduino, Raspberry Pi, 3D printing, and much more. HMPL.js Forem Follow For developers using HMPL.js to build fast, lightweight web apps. A space to share projects, ask questions, and discuss server-driven templating Dropdown menu Dropdown menu Skip to content Navigation menu Search Powered by Algolia Search Log in Create account Parenting Close # familylife Follow Hide Discussions about the dynamics of the family unit. Create Post Posts Left menu 👋 Sign in for the ability to sort posts by relevant , latest , or top . Right menu Creating a Safe, Supportive Home Environment for Individuals with IDD Community Living & Care Insights Community Living & Care Insights Community Living & Care Insights Follow Dec 30 '25 Creating a Safe, Supportive Home Environment for Individuals with IDD # development # familylife # mentalhealth Comments Add Comment 6 min read loading... 💎 DEV Diamond Sponsors Thank you to our Diamond Sponsors for supporting the DEV Community Google AI is the official AI Model and Platform Partner of DEV Neon is the official database partner of DEV Algolia is the official search partner of DEV Parenting — A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Home About Contact Code of Conduct Privacy Policy Terms of Use Built on Forem — the open source software that powers DEV and other inclusive communities. Made with love and Ruby on Rails . Parenting © 2016 - 2026. Navigating the chaos and joy of parenting. Log in Create account | 2026-01-13T08:48:44 |
https://docs.devcycle.com/platform/feature-flags/status-and-lifecycle#live | Status and Lifecycle | DevCycle Docs Skip to main content Home SDKs APIs Management API Bucketing API Integrations CLI / MCP Best Practices Community Blog Discord Search Sign Up Home Getting Started Essentials DevCycle Overview Key Features System Architecture Feature Hierarchy Feature Types Platform Feature Flags Features Variables and Variations Targeting Status and Lifecycle Stale Feature Notifications Experimentation Account Management Security and Guardrails Testing and QA Extras Examples Platform Feature Flags Status and Lifecycle On this page Feature Status and Lifecycle Management In DevCycle, Features have Statuses that indicate their current position in the feature lifecycle. Statuses provide a clear, at-a-glance understanding of where a Feature is in its development, release, and cleanup process. Each Status belongs to a Status Category , which defines how the Feature behaves, what actions are allowed, and how it is displayed across the dashboard. Statuses Every Feature in DevCycle always has one Status , which determines its lifecycle stage. By default, DevCycle provides a set of predefined Statuses aligned to core lifecycle categories. The default Statuses are: Development Live Completed Archived In addition to the default Statuses, teams can define custom Statuses within their Project settings. This allows teams to better align Feature lifecycle tracking with their internal development and release processes while preserving DevCycle's lifecycle guarantees. Each custom Status inherits the behavior of their Category. Status changes are not automatic and are always managed explicitly by the user. Status Categories Statuses are grouped into Categories , which define shared lifecycle behavior. Development This Category represents Features that are actively being built, tested, or prepared for release. By default, new Features are created with the Development Status. While a Feature is in Development, all Targeting rules and Variations remain editable. This stage is typically used while work is ongoing and before a Feature is considered ready for a broader release. Below are some examples of different Statuses that would make sense in the Development Category: In Development Pending Design QA Internal Testing Live The Live Category represents Features that are actively running in production or being exposed to users. While a Feature is Live, all Targeting rules and Variations remain editable. Below are some examples of different Statuses that would make sense in the Live Category: Beta Ramping In Production Live Experiment Completed The Completed Category represents Features that have reached the end of active development and rollout. A Feature may be considered Completed once it has been tested, approved, and is fully released, or when no further targeting changes are expected. When a Feature is moved into a Status within the Completed Category, it enters a semi-read-only state : A single final (release) Variation must be selected All Environments will serve this Variation to all users Targeting rules are replaced with an "All users" rule New targeting rules and Variations cannot be added Variable values may still be edited Environments can still be toggled on or off When using the CLI to generate TypeScript types, Variables belonging to a Feature in the Completed Category will be marked as deprecated . Below are some examples of different Statuses that would make sense in the Completed Category: Ready for Cleanup All Users Enabled Stable Release Cleanup Checklist Upon entering a Completed Status, a cleanup checklist is shown for each Variable associated with the Feature. This checklist helps teams determine when it is safe to remove Variables from their codebase or archive them. If a Variable is still referenced in code or evaluated in production, removing it may result in default values being served. If Code References are enabled, additional context will be provided to assist with cleanup. Archived The Archived Category represents the terminal lifecycle state for Features. This Category and Status cannot be edited or changed. A Feature should be archived once it has been fully cleaned up and its Variables have been removed from the codebase. When a Feature is Archived: It becomes fully read-only It is hidden from standard dashboard views Audit Logs remain accessible for historical reference Metrics & Reach data will not be visible on the dashboard for Archived features Archiving Features helps keep both your dashboard and codebase clean while preserving valuable lifecycle history. Note: Feature deletion still exists, but should only be used for mistakes. Deleting a Feature permanently removes it and its Audit Log. Archived Features retain historical data that may be used for future reporting and analysis. Changing Status Moving a Feature to Completed When a Feature is moved into the Completed Category: A final Variation must be selected All Environments serve that Variation to all users Existing Environment statuses are preserved Targeting rules are replaced with a single "All users" rule Additional Variations and targeting rules are locked Reverting to Development or Live Features in the Completed Category can be reverted back to an earlier Status. When reverting: Previous Variations become available again Changes made to Variable values while Completed are retained Prior targeting rules are not restored and must be reconfigured Viewing Features by Status (Kanban View) On the Feature list page, users can switch between a List view and a Kanban-style view that displays Features grouped by their current Status, allowing teams to quickly visualize progress across the Feature lifecycle. In this view: Each column represents a Feature Status Each column header includes a total count of Features in each Status Features appear as cards within the column matching their current Status, and can be sorted differently by selected criteria Columns are ordered based on the Status order defined in Project Settings Status colors are reflected in the column headers for quick visual scanning This view is intended for high-level lifecycle tracking and workflow management. Selecting a Feature card opens the Feature detail view for configuration, targeting, and Variable management. Managing Statuses Statuses are managed at the Project level and apply to all Features within that Project. Each Project starts with a default set of Statuses aligned to DevCycle's lifecycle categories. Teams may customize these Statuses to better reflect their internal workflows. Project Settings Statuses can be viewed and managed from the Project Settings page under the Feature Statuses section. From this page, users can: View all Statuses grouped by Category Create new custom Statuses within supported Categories Edit existing Status names (Note: each Status must have a unique key) Reorder Statuses within a Category Assign colors to Statuses for quick visual identification Add a description to provide context behind what a Status represents Select the default Status applied when a new Feature is created Changes made in Project Settings take effect immediately and apply across the Project. Status Categories and Rules Statuses must belong to one of DevCycle's predefined Categories. The following rules apply: New Categories cannot be created Each Category must contain at least one Status The last remaining Status in a Category cannot be deleted Status labels and ordering within a Category can be modified Permissions for Status Changes Permission Rules When permissions are enabled: Statuses in the Development and Live Categories can be applied by any user with access to the Project Statuses in the Completed and Archived Categories can only be applied by users with the Publisher permission Only Publishers can create, and modify Feature Statuses in the Project Settings Edit this page Last updated on Jan 9, 2026 Previous EdgeDB (Stored Custom Properties) Next Stale Feature Notifications Statuses Status Categories Development Live Completed Archived Changing Status Moving a Feature to Completed Reverting to Development or Live Viewing Features by Status (Kanban View) Managing Statuses Project Settings Permissions for Status Changes DevCycle Dashboard Blog Privacy Policy Twitter Discord GitHub Copyright © 2026 DevCycle. All rights reserved. | 2026-01-13T08:48:44 |
https://docs.devcycle.com/platform/feature-flags/status-and-lifecycle#statuses | Status and Lifecycle | DevCycle Docs Skip to main content Home SDKs APIs Management API Bucketing API Integrations CLI / MCP Best Practices Community Blog Discord Search Sign Up Home Getting Started Essentials DevCycle Overview Key Features System Architecture Feature Hierarchy Feature Types Platform Feature Flags Features Variables and Variations Targeting Status and Lifecycle Stale Feature Notifications Experimentation Account Management Security and Guardrails Testing and QA Extras Examples Platform Feature Flags Status and Lifecycle On this page Feature Status and Lifecycle Management In DevCycle, Features have Statuses that indicate their current position in the feature lifecycle. Statuses provide a clear, at-a-glance understanding of where a Feature is in its development, release, and cleanup process. Each Status belongs to a Status Category , which defines how the Feature behaves, what actions are allowed, and how it is displayed across the dashboard. Statuses Every Feature in DevCycle always has one Status , which determines its lifecycle stage. By default, DevCycle provides a set of predefined Statuses aligned to core lifecycle categories. The default Statuses are: Development Live Completed Archived In addition to the default Statuses, teams can define custom Statuses within their Project settings. This allows teams to better align Feature lifecycle tracking with their internal development and release processes while preserving DevCycle's lifecycle guarantees. Each custom Status inherits the behavior of their Category. Status changes are not automatic and are always managed explicitly by the user. Status Categories Statuses are grouped into Categories , which define shared lifecycle behavior. Development This Category represents Features that are actively being built, tested, or prepared for release. By default, new Features are created with the Development Status. While a Feature is in Development, all Targeting rules and Variations remain editable. This stage is typically used while work is ongoing and before a Feature is considered ready for a broader release. Below are some examples of different Statuses that would make sense in the Development Category: In Development Pending Design QA Internal Testing Live The Live Category represents Features that are actively running in production or being exposed to users. While a Feature is Live, all Targeting rules and Variations remain editable. Below are some examples of different Statuses that would make sense in the Live Category: Beta Ramping In Production Live Experiment Completed The Completed Category represents Features that have reached the end of active development and rollout. A Feature may be considered Completed once it has been tested, approved, and is fully released, or when no further targeting changes are expected. When a Feature is moved into a Status within the Completed Category, it enters a semi-read-only state : A single final (release) Variation must be selected All Environments will serve this Variation to all users Targeting rules are replaced with an "All users" rule New targeting rules and Variations cannot be added Variable values may still be edited Environments can still be toggled on or off When using the CLI to generate TypeScript types, Variables belonging to a Feature in the Completed Category will be marked as deprecated . Below are some examples of different Statuses that would make sense in the Completed Category: Ready for Cleanup All Users Enabled Stable Release Cleanup Checklist Upon entering a Completed Status, a cleanup checklist is shown for each Variable associated with the Feature. This checklist helps teams determine when it is safe to remove Variables from their codebase or archive them. If a Variable is still referenced in code or evaluated in production, removing it may result in default values being served. If Code References are enabled, additional context will be provided to assist with cleanup. Archived The Archived Category represents the terminal lifecycle state for Features. This Category and Status cannot be edited or changed. A Feature should be archived once it has been fully cleaned up and its Variables have been removed from the codebase. When a Feature is Archived: It becomes fully read-only It is hidden from standard dashboard views Audit Logs remain accessible for historical reference Metrics & Reach data will not be visible on the dashboard for Archived features Archiving Features helps keep both your dashboard and codebase clean while preserving valuable lifecycle history. Note: Feature deletion still exists, but should only be used for mistakes. Deleting a Feature permanently removes it and its Audit Log. Archived Features retain historical data that may be used for future reporting and analysis. Changing Status Moving a Feature to Completed When a Feature is moved into the Completed Category: A final Variation must be selected All Environments serve that Variation to all users Existing Environment statuses are preserved Targeting rules are replaced with a single "All users" rule Additional Variations and targeting rules are locked Reverting to Development or Live Features in the Completed Category can be reverted back to an earlier Status. When reverting: Previous Variations become available again Changes made to Variable values while Completed are retained Prior targeting rules are not restored and must be reconfigured Viewing Features by Status (Kanban View) On the Feature list page, users can switch between a List view and a Kanban-style view that displays Features grouped by their current Status, allowing teams to quickly visualize progress across the Feature lifecycle. In this view: Each column represents a Feature Status Each column header includes a total count of Features in each Status Features appear as cards within the column matching their current Status, and can be sorted differently by selected criteria Columns are ordered based on the Status order defined in Project Settings Status colors are reflected in the column headers for quick visual scanning This view is intended for high-level lifecycle tracking and workflow management. Selecting a Feature card opens the Feature detail view for configuration, targeting, and Variable management. Managing Statuses Statuses are managed at the Project level and apply to all Features within that Project. Each Project starts with a default set of Statuses aligned to DevCycle's lifecycle categories. Teams may customize these Statuses to better reflect their internal workflows. Project Settings Statuses can be viewed and managed from the Project Settings page under the Feature Statuses section. From this page, users can: View all Statuses grouped by Category Create new custom Statuses within supported Categories Edit existing Status names (Note: each Status must have a unique key) Reorder Statuses within a Category Assign colors to Statuses for quick visual identification Add a description to provide context behind what a Status represents Select the default Status applied when a new Feature is created Changes made in Project Settings take effect immediately and apply across the Project. Status Categories and Rules Statuses must belong to one of DevCycle's predefined Categories. The following rules apply: New Categories cannot be created Each Category must contain at least one Status The last remaining Status in a Category cannot be deleted Status labels and ordering within a Category can be modified Permissions for Status Changes Permission Rules When permissions are enabled: Statuses in the Development and Live Categories can be applied by any user with access to the Project Statuses in the Completed and Archived Categories can only be applied by users with the Publisher permission Only Publishers can create, and modify Feature Statuses in the Project Settings Edit this page Last updated on Jan 9, 2026 Previous EdgeDB (Stored Custom Properties) Next Stale Feature Notifications Statuses Status Categories Development Live Completed Archived Changing Status Moving a Feature to Completed Reverting to Development or Live Viewing Features by Status (Kanban View) Managing Statuses Project Settings Permissions for Status Changes DevCycle Dashboard Blog Privacy Policy Twitter Discord GitHub Copyright © 2026 DevCycle. All rights reserved. | 2026-01-13T08:48:44 |
https://x.com/hd_nvim/status/1735182378036027650 | JavaScript is not available. We’ve detected that JavaScript is disabled in this browser. Please enable JavaScript or switch to a supported browser to continue using x.com. You can see a list of supported browsers in our Help Center. Help Center Terms of Service Privacy Policy Cookie Policy Imprint Ads info © 2026 X Corp. Something went wrong, but don’t fret — let’s give it another shot. Try again Some privacy related extensions may cause issues on x.com. Please disable them and try again. | 2026-01-13T08:48:44 |
https://aws.amazon.com/blogs/developer/tag/windows/ | Windows | AWS Developer Tools Blog Skip to Main Content Filter: All English Contact us AWS Marketplace Support My account Search Filter: All Sign in to console Create account AWS Blogs Home Blogs Editions AWS Developer Tools Blog Tag: Windows AWS SDK for .NET v3.5 Preview by Aaron Costley on 06 FEB 2020 in .NET , AWS .NET Development , AWS SDK for .NET , Developer Tools Permalink Share Today, we have published a preview release of version 3.5 of the AWS SDK for .NET. This primary objective of this version is to transition support for all non-Framework versions of the SDK to .NET Standard 2.0. If you are currently using a .NET Framework or .NET Core target, no changes are required. We are […] Amazon EC2 ImageUtilities and Get-EC2ImageByName Updates by Steve Roberts on 18 DEC 2014 in .NET , PowerShell Permalink Share Versions 2.3.14 of the AWS SDK for .NET and AWS Tools for Windows PowerShell, released today (December 18, 2014), contain updates to the utilities and the Get-EC2ImageByName cmdlet used to query common Microsoft Windows 64-bit Amazon Machine Images using version-independent names. Briefly, we renamed some of the keys used to identify Microsoft Windows Server 2008 […] {"data":{"items":[{"fields":{"footer":"{\n \"createAccountButtonLabel\": \"Create an AWS account\",\n \"createAccountButtonURL\": \"https://portal.aws.amazon.com/gp/aws/developer/registration/index.html?nc1=f_ct&src=footer_signup\",\n \"backToTopText\": \"Back to top\",\n \"eoeText\": \"Amazon is an Equal Opportunity Employer: Minority / Women / Disability / Veteran / Gender Identity / Sexual Orientation / Age.\",\n \"copyrightText\": \"© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.\",\n \"items\": [\n {\n \"name\": \"Learn\",\n \"linkURL\": \"\",\n \"items\": [\n {\n \"heading\": \"What Is AWS?\",\n \"linkURL\": \"/what-is-aws/?nc1=f_cc\"\n },\n {\n \"heading\": \"What Is Cloud Computing?\",\n \"linkURL\": \"/what-is-cloud-computing/?nc1=f_cc\"\n },\n {\n \"heading\": \"What Is Agentic AI?\",\n \"linkURL\": \"/what-is/agentic-ai/?nc1=f_cc\"\n },\n {\n \"heading\": \"Cloud Computing Concepts Hub\",\n \"linkURL\": \"/what-is/?nc1=f_cc\"\n },\n {\n \"heading\": \"AWS Cloud Security\",\n \"linkURL\": \"/security/?nc1=f_cc\"\n },\n {\n \"heading\": \"What's New\",\n \"linkURL\": \"/new/?nc1=f_cc\"\n },\n {\n \"heading\": \"Blogs\",\n \"linkURL\": \"/blogs/?nc1=f_cc\"\n },\n {\n \"heading\": \"Press Releases\",\n \"linkURL\": \"https://press.aboutamazon.com/press-releases/aws\"\n }\n ]\n },\n {\n \"name\": \"Resources\",\n \"linkURL\": \"\",\n \"items\": [\n {\n \"heading\": \"Getting Started\",\n \"linkURL\": \"/getting-started/?nc1=f_cc\"\n },\n {\n \"heading\": \"Training\",\n \"linkURL\": \"/training/?nc1=f_cc\"\n },\n {\n \"heading\": \"AWS Trust Center\",\n \"linkURL\": \"/trust-center/?nc1=f_cc\"\n },\n {\n \"heading\": \"AWS Solutions Library\",\n \"linkURL\": \"/solutions/?nc1=f_cc\"\n },\n {\n \"heading\": \"Architecture Center\",\n \"linkURL\": \"/architecture/?nc1=f_cc\"\n },\n {\n \"heading\": \"Product and Technical FAQs\",\n \"linkURL\": \"/faqs/?nc1=f_dr\"\n },\n {\n \"heading\": \"Analyst Reports\",\n \"linkURL\": \"/resources/analyst-reports/?nc1=f_cc\"\n },\n {\n \"heading\": \"AWS Partners\",\n \"linkURL\": \"/partners/work-with-partners/?nc1=f_dr\"\n }\n ]\n },\n {\n \"name\": \"Developers\",\n \"linkURL\": \"\",\n \"items\": [\n {\n \"heading\": \"Builder Center\",\n \"linkURL\": \"/developer/?nc1=f_dr\"\n },\n {\n \"heading\": \"SDKs & Tools\",\n \"linkURL\": \"/developer/tools/?nc1=f_dr\"\n },\n {\n \"heading\": \".NET on AWS\",\n \"linkURL\": \"/developer/language/net/?nc1=f_dr\"\n },\n {\n \"heading\": \"Python on AWS\",\n \"linkURL\": \"/developer/language/python/?nc1=f_dr\"\n },\n {\n \"heading\": \"Java on AWS\",\n \"linkURL\": \"/developer/language/java/?nc1=f_dr\"\n },\n {\n \"heading\": \"PHP on AWS\",\n \"linkURL\": \"/developer/language/php/?nc1=f_cc\"\n },\n {\n \"heading\": \"JavaScript on AWS\",\n \"linkURL\": \"/developer/language/javascript/?nc1=f_dr\"\n }\n ]\n },\n {\n \"name\": \"Help\",\n \"linkURL\": \"\",\n \"items\": [\n {\n \"heading\": \"Contact Us\",\n \"linkURL\": \"/contact-us/?nc1=f_m\"\n },\n {\n \"heading\": \"File a Support Ticket\",\n \"linkURL\": \"https://console.aws.amazon.com/support/home/?nc1=f_dr\"\n },\n {\n \"heading\": \"AWS re:Post\",\n \"linkURL\": \"https://repost.aws/?nc1=f_dr\"\n },\n {\n \"heading\": \"Knowledge Center\",\n \"linkURL\": \"https://repost.aws/knowledge-center/?nc1=f_dr\"\n },\n {\n \"heading\": \"AWS Support Overview\",\n \"linkURL\": \"/premiumsupport/?nc1=f_dr\"\n },\n {\n \"heading\": \"Get Expert Help\",\n \"linkURL\": \"https://iq.aws.amazon.com/?utm=mkt.foot/?nc1=f_m\"\n },\n {\n \"heading\": \"AWS Accessibility\",\n \"linkURL\": \"/accessibility/?nc1=f_cc\"\n },\n {\n \"heading\": \"Legal\",\n \"linkURL\": \"/legal/?nc1=f_cc\"\n }\n ]\n }\n ],\n \"disclosureItems\": [\n {\n \"heading\": \"Privacy\",\n \"linkURL\": \"/privacy/?nc1=f_pr\"\n },\n {\n \"heading\": \"Site terms\",\n \"linkURL\": \"/terms/?nc1=f_pr\"\n }\n ],\n \"socialItems\": [\n {\n \"socialIconType\": \"x\",\n \"linkURL\": \"https://twitter.com/awscloud\"\n },\n {\n \"socialIconType\": \"facebook\",\n \"linkURL\": \"https://www.facebook.com/amazonwebservices\"\n },\n {\n \"socialIconType\": \"linkedin\",\n \"linkURL\": \"https://www.linkedin.com/company/amazon-web-services/\"\n },\n {\n \"socialIconType\": \"instagram\",\n \"linkURL\": \"https://www.instagram.com/amazonwebservices/\"\n },\n {\n \"socialIconType\": \"twitch\",\n \"linkURL\": \"https://www.twitch.tv/aws\"\n },\n {\n \"socialIconType\": \"youtube\",\n \"linkURL\": \"https://www.youtube.com/user/AmazonWebServices/Cloud/\"\n },\n {\n \"socialIconType\": \"podcasts\",\n \"linkURL\": \"/podcasts/?nc1=f_cc\"\n },\n {\n \"socialIconType\": \"email | 2026-01-13T08:48:44 |
https://docs.devcycle.com/platform/feature-flags/status-and-lifecycle#status-categories-and-rules | Status and Lifecycle | DevCycle Docs Skip to main content Home SDKs APIs Management API Bucketing API Integrations CLI / MCP Best Practices Community Blog Discord Search Sign Up Home Getting Started Essentials DevCycle Overview Key Features System Architecture Feature Hierarchy Feature Types Platform Feature Flags Features Variables and Variations Targeting Status and Lifecycle Stale Feature Notifications Experimentation Account Management Security and Guardrails Testing and QA Extras Examples Platform Feature Flags Status and Lifecycle On this page Feature Status and Lifecycle Management In DevCycle, Features have Statuses that indicate their current position in the feature lifecycle. Statuses provide a clear, at-a-glance understanding of where a Feature is in its development, release, and cleanup process. Each Status belongs to a Status Category , which defines how the Feature behaves, what actions are allowed, and how it is displayed across the dashboard. Statuses Every Feature in DevCycle always has one Status , which determines its lifecycle stage. By default, DevCycle provides a set of predefined Statuses aligned to core lifecycle categories. The default Statuses are: Development Live Completed Archived In addition to the default Statuses, teams can define custom Statuses within their Project settings. This allows teams to better align Feature lifecycle tracking with their internal development and release processes while preserving DevCycle's lifecycle guarantees. Each custom Status inherits the behavior of their Category. Status changes are not automatic and are always managed explicitly by the user. Status Categories Statuses are grouped into Categories , which define shared lifecycle behavior. Development This Category represents Features that are actively being built, tested, or prepared for release. By default, new Features are created with the Development Status. While a Feature is in Development, all Targeting rules and Variations remain editable. This stage is typically used while work is ongoing and before a Feature is considered ready for a broader release. Below are some examples of different Statuses that would make sense in the Development Category: In Development Pending Design QA Internal Testing Live The Live Category represents Features that are actively running in production or being exposed to users. While a Feature is Live, all Targeting rules and Variations remain editable. Below are some examples of different Statuses that would make sense in the Live Category: Beta Ramping In Production Live Experiment Completed The Completed Category represents Features that have reached the end of active development and rollout. A Feature may be considered Completed once it has been tested, approved, and is fully released, or when no further targeting changes are expected. When a Feature is moved into a Status within the Completed Category, it enters a semi-read-only state : A single final (release) Variation must be selected All Environments will serve this Variation to all users Targeting rules are replaced with an "All users" rule New targeting rules and Variations cannot be added Variable values may still be edited Environments can still be toggled on or off When using the CLI to generate TypeScript types, Variables belonging to a Feature in the Completed Category will be marked as deprecated . Below are some examples of different Statuses that would make sense in the Completed Category: Ready for Cleanup All Users Enabled Stable Release Cleanup Checklist Upon entering a Completed Status, a cleanup checklist is shown for each Variable associated with the Feature. This checklist helps teams determine when it is safe to remove Variables from their codebase or archive them. If a Variable is still referenced in code or evaluated in production, removing it may result in default values being served. If Code References are enabled, additional context will be provided to assist with cleanup. Archived The Archived Category represents the terminal lifecycle state for Features. This Category and Status cannot be edited or changed. A Feature should be archived once it has been fully cleaned up and its Variables have been removed from the codebase. When a Feature is Archived: It becomes fully read-only It is hidden from standard dashboard views Audit Logs remain accessible for historical reference Metrics & Reach data will not be visible on the dashboard for Archived features Archiving Features helps keep both your dashboard and codebase clean while preserving valuable lifecycle history. Note: Feature deletion still exists, but should only be used for mistakes. Deleting a Feature permanently removes it and its Audit Log. Archived Features retain historical data that may be used for future reporting and analysis. Changing Status Moving a Feature to Completed When a Feature is moved into the Completed Category: A final Variation must be selected All Environments serve that Variation to all users Existing Environment statuses are preserved Targeting rules are replaced with a single "All users" rule Additional Variations and targeting rules are locked Reverting to Development or Live Features in the Completed Category can be reverted back to an earlier Status. When reverting: Previous Variations become available again Changes made to Variable values while Completed are retained Prior targeting rules are not restored and must be reconfigured Viewing Features by Status (Kanban View) On the Feature list page, users can switch between a List view and a Kanban-style view that displays Features grouped by their current Status, allowing teams to quickly visualize progress across the Feature lifecycle. In this view: Each column represents a Feature Status Each column header includes a total count of Features in each Status Features appear as cards within the column matching their current Status, and can be sorted differently by selected criteria Columns are ordered based on the Status order defined in Project Settings Status colors are reflected in the column headers for quick visual scanning This view is intended for high-level lifecycle tracking and workflow management. Selecting a Feature card opens the Feature detail view for configuration, targeting, and Variable management. Managing Statuses Statuses are managed at the Project level and apply to all Features within that Project. Each Project starts with a default set of Statuses aligned to DevCycle's lifecycle categories. Teams may customize these Statuses to better reflect their internal workflows. Project Settings Statuses can be viewed and managed from the Project Settings page under the Feature Statuses section. From this page, users can: View all Statuses grouped by Category Create new custom Statuses within supported Categories Edit existing Status names (Note: each Status must have a unique key) Reorder Statuses within a Category Assign colors to Statuses for quick visual identification Add a description to provide context behind what a Status represents Select the default Status applied when a new Feature is created Changes made in Project Settings take effect immediately and apply across the Project. Status Categories and Rules Statuses must belong to one of DevCycle's predefined Categories. The following rules apply: New Categories cannot be created Each Category must contain at least one Status The last remaining Status in a Category cannot be deleted Status labels and ordering within a Category can be modified Permissions for Status Changes Permission Rules When permissions are enabled: Statuses in the Development and Live Categories can be applied by any user with access to the Project Statuses in the Completed and Archived Categories can only be applied by users with the Publisher permission Only Publishers can create, and modify Feature Statuses in the Project Settings Edit this page Last updated on Jan 9, 2026 Previous EdgeDB (Stored Custom Properties) Next Stale Feature Notifications Statuses Status Categories Development Live Completed Archived Changing Status Moving a Feature to Completed Reverting to Development or Live Viewing Features by Status (Kanban View) Managing Statuses Project Settings Permissions for Status Changes DevCycle Dashboard Blog Privacy Policy Twitter Discord GitHub Copyright © 2026 DevCycle. All rights reserved. | 2026-01-13T08:48:44 |
https://parenting.forem.com/t/mentalhealth#main-content | Mental Health - Parenting Forem Feed Follow new Subforems to improve your feed DEV Community Follow A space to discuss and keep up software development and manage your software career Future Follow News and discussion of science and technology such as AI, VR, cryptocurrency, quantum computing, and more. Open Forem Follow A general discussion space for the Forem community. If it doesn't have a home elsewhere, it belongs here Gamers Forem Follow An inclusive community for gaming enthusiasts Music Forem Follow From composing and gigging to gear, hot music takes, and everything in between. Vibe Coding Forem Follow Discussing AI software development, and showing off what we're building. Popcorn Movies and TV Follow Movie and TV enthusiasm, criticism and everything in-between. DUMB DEV Community Follow Memes and software development shitposting Design Community Follow Web design, graphic design and everything in-between Security Forem Follow Your central hub for all things security. From ethical hacking and CTFs to GRC and career development, for beginners and pros alike Golf Forem Follow A community of golfers and golfing enthusiasts Crypto Forem Follow A collaborative community for all things Crypto—from Bitcoin to protocol development and DeFi to NFTs and market analysis. Parenting Follow A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Forem Core Follow Discussing the core forem open source software project — features, bugs, performance, self-hosting. Maker Forem Follow A community for makers, hobbyists, and professionals to discuss Arduino, Raspberry Pi, 3D printing, and much more. HMPL.js Forem Follow For developers using HMPL.js to build fast, lightweight web apps. A space to share projects, ask questions, and discuss server-driven templating Dropdown menu Dropdown menu Skip to content Navigation menu Search Powered by Algolia Search Log in Create account Parenting Close Mental Health Follow Hide Mental health matters! Break the stigma. We can empower ourselves and each other to invest in our mental health. We can give support and care to ourselves and each other while we struggle. Let's talk about making our mental health priority. Create Post about #mentalhealth Posts should be related to mental health. This is a pretty wide category but some things that are included are: Managing mental health as a developer Living with mental illness and how it affects your work Ways to cope with mental health issues Avoiding burn out Tools, apps, and methods that help you with your mental health ...and more “Your mental health is a priority. Your happiness is an essential. Your self-care is a necessity.” Struggling? Help is out there. Click here to find a list of global mental health resources and hotlines. Older #mentalhealth posts 1 2 3 4 5 6 7 8 9 Posts Left menu 👋 Sign in for the ability to sort posts by relevant , latest , or top . Right menu Creating a Safe, Supportive Home Environment for Individuals with IDD Community Living & Care Insights Community Living & Care Insights Community Living & Care Insights Follow Dec 30 '25 Creating a Safe, Supportive Home Environment for Individuals with IDD # development # familylife # mentalhealth Comments Add Comment 6 min read The Sturdy Pillar Doesn’t Need Reinforcement Juno Threadborne Juno Threadborne Juno Threadborne Follow Nov 21 '25 The Sturdy Pillar Doesn’t Need Reinforcement # mentalhealth # singleparenting 6 reactions Comments 2 comments 4 min read I built something for busy parents who want to run Martin Cartledge Martin Cartledge Martin Cartledge Follow Nov 12 '25 I built something for busy parents who want to run # mentalhealth # balance 10 reactions Comments 2 comments 1 min read Navigating Modern Parenthood: Insights from This Week's Conversations Om Shree Om Shree Om Shree Follow Oct 19 '25 Navigating Modern Parenthood: Insights from This Week's Conversations # discuss # learning # development # mentalhealth 23 reactions Comments 5 comments 5 min read loading... trending guides/resources The Sturdy Pillar Doesn’t Need Reinforcement I built something for busy parents who want to run 💎 DEV Diamond Sponsors Thank you to our Diamond Sponsors for supporting the DEV Community Google AI is the official AI Model and Platform Partner of DEV Neon is the official database partner of DEV Algolia is the official search partner of DEV Parenting — A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Home About Contact Code of Conduct Privacy Policy Terms of Use Built on Forem — the open source software that powers DEV and other inclusive communities. Made with love and Ruby on Rails . Parenting © 2016 - 2026. Navigating the chaos and joy of parenting. Log in Create account | 2026-01-13T08:48:44 |
https://docs.python.org/3/tutorial/controlflow.html#more-control-flow-tools | 4. More Control Flow Tools — Python 3.14.2 documentation Theme Auto Light Dark Table of Contents 4. More Control Flow Tools 4.1. if Statements 4.2. for Statements 4.3. The range() Function 4.4. break and continue Statements 4.5. else Clauses on Loops 4.6. pass Statements 4.7. match Statements 4.8. Defining Functions 4.9. More on Defining Functions 4.9.1. Default Argument Values 4.9.2. Keyword Arguments 4.9.3. Special parameters 4.9.3.1. Positional-or-Keyword Arguments 4.9.3.2. Positional-Only Parameters 4.9.3.3. Keyword-Only Arguments 4.9.3.4. Function Examples 4.9.3.5. Recap 4.9.4. Arbitrary Argument Lists 4.9.5. Unpacking Argument Lists 4.9.6. Lambda Expressions 4.9.7. Documentation Strings 4.9.8. Function Annotations 4.10. Intermezzo: Coding Style Previous topic 3. An Informal Introduction to Python Next topic 5. Data Structures This page Report a bug Show source Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 4. More Control Flow Tools | Theme Auto Light Dark | 4. More Control Flow Tools ¶ As well as the while statement just introduced, Python uses a few more that we will encounter in this chapter. 4.1. if Statements ¶ Perhaps the most well-known statement type is the if statement. For example: >>> x = int ( input ( "Please enter an integer: " )) Please enter an integer: 42 >>> if x < 0 : ... x = 0 ... print ( 'Negative changed to zero' ) ... elif x == 0 : ... print ( 'Zero' ) ... elif x == 1 : ... print ( 'Single' ) ... else : ... print ( 'More' ) ... More There can be zero or more elif parts, and the else part is optional. The keyword ‘ elif ’ is short for ‘else if’, and is useful to avoid excessive indentation. An if … elif … elif … sequence is a substitute for the switch or case statements found in other languages. If you’re comparing the same value to several constants, or checking for specific types or attributes, you may also find the match statement useful. For more details see match Statements . 4.2. for Statements ¶ The for statement in Python differs a bit from what you may be used to in C or Pascal. Rather than always iterating over an arithmetic progression of numbers (like in Pascal), or giving the user the ability to define both the iteration step and halting condition (as C), Python’s for statement iterates over the items of any sequence (a list or a string), in the order that they appear in the sequence. For example (no pun intended): >>> # Measure some strings: >>> words = [ 'cat' , 'window' , 'defenestrate' ] >>> for w in words : ... print ( w , len ( w )) ... cat 3 window 6 defenestrate 12 Code that modifies a collection while iterating over that same collection can be tricky to get right. Instead, it is usually more straight-forward to loop over a copy of the collection or to create a new collection: # Create a sample collection users = { 'Hans' : 'active' , 'Éléonore' : 'inactive' , '景太郎' : 'active' } # Strategy: Iterate over a copy for user , status in users . copy () . items (): if status == 'inactive' : del users [ user ] # Strategy: Create a new collection active_users = {} for user , status in users . items (): if status == 'active' : active_users [ user ] = status 4.3. The range() Function ¶ If you do need to iterate over a sequence of numbers, the built-in function range() comes in handy. It generates arithmetic progressions: >>> for i in range ( 5 ): ... print ( i ) ... 0 1 2 3 4 The given end point is never part of the generated sequence; range(10) generates 10 values, the legal indices for items of a sequence of length 10. It is possible to let the range start at another number, or to specify a different increment (even negative; sometimes this is called the ‘step’): >>> list ( range ( 5 , 10 )) [5, 6, 7, 8, 9] >>> list ( range ( 0 , 10 , 3 )) [0, 3, 6, 9] >>> list ( range ( - 10 , - 100 , - 30 )) [-10, -40, -70] To iterate over the indices of a sequence, you can combine range() and len() as follows: >>> a = [ 'Mary' , 'had' , 'a' , 'little' , 'lamb' ] >>> for i in range ( len ( a )): ... print ( i , a [ i ]) ... 0 Mary 1 had 2 a 3 little 4 lamb In most such cases, however, it is convenient to use the enumerate() function, see Looping Techniques . A strange thing happens if you just print a range: >>> range ( 10 ) range(0, 10) In many ways the object returned by range() behaves as if it is a list, but in fact it isn’t. It is an object which returns the successive items of the desired sequence when you iterate over it, but it doesn’t really make the list, thus saving space. We say such an object is iterable , that is, suitable as a target for functions and constructs that expect something from which they can obtain successive items until the supply is exhausted. We have seen that the for statement is such a construct, while an example of a function that takes an iterable is sum() : >>> sum ( range ( 4 )) # 0 + 1 + 2 + 3 6 Later we will see more functions that return iterables and take iterables as arguments. In chapter Data Structures , we will discuss in more detail about list() . 4.4. break and continue Statements ¶ The break statement breaks out of the innermost enclosing for or while loop: >>> for n in range ( 2 , 10 ): ... for x in range ( 2 , n ): ... if n % x == 0 : ... print ( f " { n } equals { x } * { n // x } " ) ... break ... 4 equals 2 * 2 6 equals 2 * 3 8 equals 2 * 4 9 equals 3 * 3 The continue statement continues with the next iteration of the loop: >>> for num in range ( 2 , 10 ): ... if num % 2 == 0 : ... print ( f "Found an even number { num } " ) ... continue ... print ( f "Found an odd number { num } " ) ... Found an even number 2 Found an odd number 3 Found an even number 4 Found an odd number 5 Found an even number 6 Found an odd number 7 Found an even number 8 Found an odd number 9 4.5. else Clauses on Loops ¶ In a for or while loop the break statement may be paired with an else clause. If the loop finishes without executing the break , the else clause executes. In a for loop, the else clause is executed after the loop finishes its final iteration, that is, if no break occurred. In a while loop, it’s executed after the loop’s condition becomes false. In either kind of loop, the else clause is not executed if the loop was terminated by a break . Of course, other ways of ending the loop early, such as a return or a raised exception, will also skip execution of the else clause. This is exemplified in the following for loop, which searches for prime numbers: >>> for n in range ( 2 , 10 ): ... for x in range ( 2 , n ): ... if n % x == 0 : ... print ( n , 'equals' , x , '*' , n // x ) ... break ... else : ... # loop fell through without finding a factor ... print ( n , 'is a prime number' ) ... 2 is a prime number 3 is a prime number 4 equals 2 * 2 5 is a prime number 6 equals 2 * 3 7 is a prime number 8 equals 2 * 4 9 equals 3 * 3 (Yes, this is the correct code. Look closely: the else clause belongs to the for loop, not the if statement.) One way to think of the else clause is to imagine it paired with the if inside the loop. As the loop executes, it will run a sequence like if/if/if/else. The if is inside the loop, encountered a number of times. If the condition is ever true, a break will happen. If the condition is never true, the else clause outside the loop will execute. When used with a loop, the else clause has more in common with the else clause of a try statement than it does with that of if statements: a try statement’s else clause runs when no exception occurs, and a loop’s else clause runs when no break occurs. For more on the try statement and exceptions, see Handling Exceptions . 4.6. pass Statements ¶ The pass statement does nothing. It can be used when a statement is required syntactically but the program requires no action. For example: >>> while True : ... pass # Busy-wait for keyboard interrupt (Ctrl+C) ... This is commonly used for creating minimal classes: >>> class MyEmptyClass : ... pass ... Another place pass can be used is as a place-holder for a function or conditional body when you are working on new code, allowing you to keep thinking at a more abstract level. The pass is silently ignored: >>> def initlog ( * args ): ... pass # Remember to implement this! ... For this last case, many people use the ellipsis literal ... instead of pass . This use has no special meaning to Python, and is not part of the language definition (you could use any constant expression here), but ... is used conventionally as a placeholder body as well. See The Ellipsis Object . 4.7. match Statements ¶ A match statement takes an expression and compares its value to successive patterns given as one or more case blocks. This is superficially similar to a switch statement in C, Java or JavaScript (and many other languages), but it’s more similar to pattern matching in languages like Rust or Haskell. Only the first pattern that matches gets executed and it can also extract components (sequence elements or object attributes) from the value into variables. If no case matches, none of the branches is executed. The simplest form compares a subject value against one or more literals: def http_error ( status ): match status : case 400 : return "Bad request" case 404 : return "Not found" case 418 : return "I'm a teapot" case _ : return "Something's wrong with the internet" Note the last block: the “variable name” _ acts as a wildcard and never fails to match. You can combine several literals in a single pattern using | (“or”): case 401 | 403 | 404 : return "Not allowed" Patterns can look like unpacking assignments, and can be used to bind variables: # point is an (x, y) tuple match point : case ( 0 , 0 ): print ( "Origin" ) case ( 0 , y ): print ( f "Y= { y } " ) case ( x , 0 ): print ( f "X= { x } " ) case ( x , y ): print ( f "X= { x } , Y= { y } " ) case _ : raise ValueError ( "Not a point" ) Study that one carefully! The first pattern has two literals, and can be thought of as an extension of the literal pattern shown above. But the next two patterns combine a literal and a variable, and the variable binds a value from the subject ( point ). The fourth pattern captures two values, which makes it conceptually similar to the unpacking assignment (x, y) = point . If you are using classes to structure your data you can use the class name followed by an argument list resembling a constructor, but with the ability to capture attributes into variables: class Point : def __init__ ( self , x , y ): self . x = x self . y = y def where_is ( point ): match point : case Point ( x = 0 , y = 0 ): print ( "Origin" ) case Point ( x = 0 , y = y ): print ( f "Y= { y } " ) case Point ( x = x , y = 0 ): print ( f "X= { x } " ) case Point (): print ( "Somewhere else" ) case _ : print ( "Not a point" ) You can use positional parameters with some builtin classes that provide an ordering for their attributes (e.g. dataclasses). You can also define a specific position for attributes in patterns by setting the __match_args__ special attribute in your classes. If it’s set to (“x”, “y”), the following patterns are all equivalent (and all bind the y attribute to the var variable): Point ( 1 , var ) Point ( 1 , y = var ) Point ( x = 1 , y = var ) Point ( y = var , x = 1 ) A recommended way to read patterns is to look at them as an extended form of what you would put on the left of an assignment, to understand which variables would be set to what. Only the standalone names (like var above) are assigned to by a match statement. Dotted names (like foo.bar ), attribute names (the x= and y= above) or class names (recognized by the “(…)” next to them like Point above) are never assigned to. Patterns can be arbitrarily nested. For example, if we have a short list of Points, with __match_args__ added, we could match it like this: class Point : __match_args__ = ( 'x' , 'y' ) def __init__ ( self , x , y ): self . x = x self . y = y match points : case []: print ( "No points" ) case [ Point ( 0 , 0 )]: print ( "The origin" ) case [ Point ( x , y )]: print ( f "Single point { x } , { y } " ) case [ Point ( 0 , y1 ), Point ( 0 , y2 )]: print ( f "Two on the Y axis at { y1 } , { y2 } " ) case _ : print ( "Something else" ) We can add an if clause to a pattern, known as a “guard”. If the guard is false, match goes on to try the next case block. Note that value capture happens before the guard is evaluated: match point : case Point ( x , y ) if x == y : print ( f "Y=X at { x } " ) case Point ( x , y ): print ( f "Not on the diagonal" ) Several other key features of this statement: Like unpacking assignments, tuple and list patterns have exactly the same meaning and actually match arbitrary sequences. An important exception is that they don’t match iterators or strings. Sequence patterns support extended unpacking: [x, y, *rest] and (x, y, *rest) work similar to unpacking assignments. The name after * may also be _ , so (x, y, *_) matches a sequence of at least two items without binding the remaining items. Mapping patterns: {"bandwidth": b, "latency": l} captures the "bandwidth" and "latency" values from a dictionary. Unlike sequence patterns, extra keys are ignored. An unpacking like **rest is also supported. (But **_ would be redundant, so it is not allowed.) Subpatterns may be captured using the as keyword: case ( Point ( x1 , y1 ), Point ( x2 , y2 ) as p2 ): ... will capture the second element of the input as p2 (as long as the input is a sequence of two points) Most literals are compared by equality, however the singletons True , False and None are compared by identity. Patterns may use named constants. These must be dotted names to prevent them from being interpreted as capture variable: from enum import Enum class Color ( Enum ): RED = 'red' GREEN = 'green' BLUE = 'blue' color = Color ( input ( "Enter your choice of 'red', 'blue' or 'green': " )) match color : case Color . RED : print ( "I see red!" ) case Color . GREEN : print ( "Grass is green" ) case Color . BLUE : print ( "I'm feeling the blues :(" ) For a more detailed explanation and additional examples, you can look into PEP 636 which is written in a tutorial format. 4.8. Defining Functions ¶ We can create a function that writes the Fibonacci series to an arbitrary boundary: >>> def fib ( n ): # write Fibonacci series less than n ... """Print a Fibonacci series less than n.""" ... a , b = 0 , 1 ... while a < n : ... print ( a , end = ' ' ) ... a , b = b , a + b ... print () ... >>> # Now call the function we just defined: >>> fib ( 2000 ) 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 The keyword def introduces a function definition . It must be followed by the function name and the parenthesized list of formal parameters. The statements that form the body of the function start at the next line, and must be indented. The first statement of the function body can optionally be a string literal; this string literal is the function’s documentation string, or docstring . (More about docstrings can be found in the section Documentation Strings .) There are tools which use docstrings to automatically produce online or printed documentation, or to let the user interactively browse through code; it’s good practice to include docstrings in code that you write, so make a habit of it. The execution of a function introduces a new symbol table used for the local variables of the function. More precisely, all variable assignments in a function store the value in the local symbol table; whereas variable references first look in the local symbol table, then in the local symbol tables of enclosing functions, then in the global symbol table, and finally in the table of built-in names. Thus, global variables and variables of enclosing functions cannot be directly assigned a value within a function (unless, for global variables, named in a global statement, or, for variables of enclosing functions, named in a nonlocal statement), although they may be referenced. The actual parameters (arguments) to a function call are introduced in the local symbol table of the called function when it is called; thus, arguments are passed using call by value (where the value is always an object reference , not the value of the object). [ 1 ] When a function calls another function, or calls itself recursively, a new local symbol table is created for that call. A function definition associates the function name with the function object in the current symbol table. The interpreter recognizes the object pointed to by that name as a user-defined function. Other names can also point to that same function object and can also be used to access the function: >>> fib <function fib at 10042ed0> >>> f = fib >>> f ( 100 ) 0 1 1 2 3 5 8 13 21 34 55 89 Coming from other languages, you might object that fib is not a function but a procedure since it doesn’t return a value. In fact, even functions without a return statement do return a value, albeit a rather boring one. This value is called None (it’s a built-in name). Writing the value None is normally suppressed by the interpreter if it would be the only value written. You can see it if you really want to using print() : >>> fib ( 0 ) >>> print ( fib ( 0 )) None It is simple to write a function that returns a list of the numbers of the Fibonacci series, instead of printing it: >>> def fib2 ( n ): # return Fibonacci series up to n ... """Return a list containing the Fibonacci series up to n.""" ... result = [] ... a , b = 0 , 1 ... while a < n : ... result . append ( a ) # see below ... a , b = b , a + b ... return result ... >>> f100 = fib2 ( 100 ) # call it >>> f100 # write the result [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] 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 . The statement result.append(a) calls a method of the list object result . A method is a function that ‘belongs’ to an object and is named obj.methodname , where obj is some object (this may be an expression), and methodname is the name of a method that is defined by the object’s type. Different types define different methods. Methods of different types may have the same name without causing ambiguity. (It is possible to define your own object types and methods, using classes , see Classes ) The method append() shown in the example is defined for list objects; it adds a new element at the end of the list. In this example it is equivalent to result = result + [a] , but more efficient. 4.9. More on Defining Functions ¶ It is also possible to define functions with a variable number of arguments. There are three forms, which can be combined. 4.9.1. Default Argument Values ¶ The most useful form is to specify a default value for one or more arguments. This creates a function that can be called with fewer arguments than it is defined to allow. For example: def ask_ok ( prompt , retries = 4 , reminder = 'Please try again!' ): while True : reply = input ( prompt ) if reply in { 'y' , 'ye' , 'yes' }: return True if reply in { 'n' , 'no' , 'nop' , 'nope' }: return False retries = retries - 1 if retries < 0 : raise ValueError ( 'invalid user response' ) print ( reminder ) This function can be called in several ways: giving only the mandatory argument: ask_ok('Do you really want to quit?') giving one of the optional arguments: ask_ok('OK to overwrite the file?', 2) or even giving all arguments: ask_ok('OK to overwrite the file?', 2, 'Come on, only yes or no!') This example also introduces the in keyword. This tests whether or not a sequence contains a certain value. The default values are evaluated at the point of function definition in the defining scope, so that i = 5 def f ( arg = i ): print ( arg ) i = 6 f () will print 5 . Important warning: The default value is evaluated only once. This makes a difference when the default is a mutable object such as a list, dictionary, or instances of most classes. For example, the following function accumulates the arguments passed to it on subsequent calls: def f ( a , L = []): L . append ( a ) return L print ( f ( 1 )) print ( f ( 2 )) print ( f ( 3 )) This will print [ 1 ] [ 1 , 2 ] [ 1 , 2 , 3 ] If you don’t want the default to be shared between subsequent calls, you can write the function like this instead: def f ( a , L = None ): if L is None : L = [] L . append ( a ) return L 4.9.2. Keyword Arguments ¶ Functions can also be called using keyword arguments of the form kwarg=value . For instance, the following function: def parrot ( voltage , state = 'a stiff' , action = 'voom' , type = 'Norwegian Blue' ): print ( "-- This parrot wouldn't" , action , end = ' ' ) print ( "if you put" , voltage , "volts through it." ) print ( "-- Lovely plumage, the" , type ) print ( "-- It's" , state , "!" ) accepts one required argument ( voltage ) and three optional arguments ( state , action , and type ). This function can be called in any of the following ways: parrot ( 1000 ) # 1 positional argument parrot ( voltage = 1000 ) # 1 keyword argument parrot ( voltage = 1000000 , action = 'VOOOOOM' ) # 2 keyword arguments parrot ( action = 'VOOOOOM' , voltage = 1000000 ) # 2 keyword arguments parrot ( 'a million' , 'bereft of life' , 'jump' ) # 3 positional arguments parrot ( 'a thousand' , state = 'pushing up the daisies' ) # 1 positional, 1 keyword but all the following calls would be invalid: parrot () # required argument missing parrot ( voltage = 5.0 , 'dead' ) # non-keyword argument after a keyword argument parrot ( 110 , voltage = 220 ) # duplicate value for the same argument parrot ( actor = 'John Cleese' ) # unknown keyword argument In a function call, keyword arguments must follow positional arguments. All the keyword arguments passed must match one of the arguments accepted by the function (e.g. actor is not a valid argument for the parrot function), and their order is not important. This also includes non-optional arguments (e.g. parrot(voltage=1000) is valid too). No argument may receive a value more than once. Here’s an example that fails due to this restriction: >>> def function ( a ): ... pass ... >>> function ( 0 , a = 0 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : function() got multiple values for argument 'a' When a final formal parameter of the form **name is present, it receives a dictionary (see Mapping Types — dict ) containing all keyword arguments except for those corresponding to a formal parameter. This may be combined with a formal parameter of the form *name (described in the next subsection) which receives a tuple containing the positional arguments beyond the formal parameter list. ( *name must occur before **name .) For example, if we define a function like this: def cheeseshop ( kind , * arguments , ** keywords ): print ( "-- Do you have any" , kind , "?" ) print ( "-- I'm sorry, we're all out of" , kind ) for arg in arguments : print ( arg ) print ( "-" * 40 ) for kw in keywords : print ( kw , ":" , keywords [ kw ]) It could be called like this: cheeseshop ( "Limburger" , "It's very runny, sir." , "It's really very, VERY runny, sir." , shopkeeper = "Michael Palin" , client = "John Cleese" , sketch = "Cheese Shop Sketch" ) and of course it would print: -- Do you have any Limburger ? -- I'm sorry, we're all out of Limburger It's very runny, sir. It's really very, VERY runny, sir. ---------------------------------------- shopkeeper : Michael Palin client : John Cleese sketch : Cheese Shop Sketch Note that the order in which the keyword arguments are printed is guaranteed to match the order in which they were provided in the function call. 4.9.3. Special parameters ¶ By default, arguments may be passed to a Python function either by position or explicitly by keyword. For readability and performance, it makes sense to restrict the way arguments can be passed so that a developer need only look at the function definition to determine if items are passed by position, by position or keyword, or by keyword. A function definition may look like: def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2): ----------- ---------- ---------- | | | | Positional or keyword | | - Keyword only -- Positional only where / and * are optional. If used, these symbols indicate the kind of parameter by how the arguments may be passed to the function: positional-only, positional-or-keyword, and keyword-only. Keyword parameters are also referred to as named parameters. 4.9.3.1. Positional-or-Keyword Arguments ¶ If / and * are not present in the function definition, arguments may be passed to a function by position or by keyword. 4.9.3.2. Positional-Only Parameters ¶ Looking at this in a bit more detail, it is possible to mark certain parameters as positional-only . If positional-only , the parameters’ order matters, and the parameters cannot be passed by keyword. Positional-only parameters are placed before a / (forward-slash). The / is used to logically separate the positional-only parameters from the rest of the parameters. If there is no / in the function definition, there are no positional-only parameters. Parameters following the / may be positional-or-keyword or keyword-only . 4.9.3.3. Keyword-Only Arguments ¶ To mark parameters as keyword-only , indicating the parameters must be passed by keyword argument, place an * in the arguments list just before the first keyword-only parameter. 4.9.3.4. Function Examples ¶ Consider the following example function definitions paying close attention to the markers / and * : >>> def standard_arg ( arg ): ... print ( arg ) ... >>> def pos_only_arg ( arg , / ): ... print ( arg ) ... >>> def kwd_only_arg ( * , arg ): ... print ( arg ) ... >>> def combined_example ( pos_only , / , standard , * , kwd_only ): ... print ( pos_only , standard , kwd_only ) The first function definition, standard_arg , the most familiar form, places no restrictions on the calling convention and arguments may be passed by position or keyword: >>> standard_arg ( 2 ) 2 >>> standard_arg ( arg = 2 ) 2 The second function pos_only_arg is restricted to only use positional parameters as there is a / in the function definition: >>> pos_only_arg ( 1 ) 1 >>> pos_only_arg ( arg = 1 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : pos_only_arg() got some positional-only arguments passed as keyword arguments: 'arg' The third function kwd_only_arg only allows keyword arguments as indicated by a * in the function definition: >>> kwd_only_arg ( 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : kwd_only_arg() takes 0 positional arguments but 1 was given >>> kwd_only_arg ( arg = 3 ) 3 And the last uses all three calling conventions in the same function definition: >>> combined_example ( 1 , 2 , 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : combined_example() takes 2 positional arguments but 3 were given >>> combined_example ( 1 , 2 , kwd_only = 3 ) 1 2 3 >>> combined_example ( 1 , standard = 2 , kwd_only = 3 ) 1 2 3 >>> combined_example ( pos_only = 1 , standard = 2 , kwd_only = 3 ) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : combined_example() got some positional-only arguments passed as keyword arguments: 'pos_only' Finally, consider this function definition which has a potential collision between the positional argument name and **kwds which has name as a key: def foo ( name , ** kwds ): return 'name' in kwds There is no possible call that will make it return True as the keyword 'name' will always bind to the first parameter. For example: >>> foo ( 1 , ** { 'name' : 2 }) Traceback (most recent call last): File "<stdin>" , line 1 , in <module> TypeError : foo() got multiple values for argument 'name' >>> But using / (positional only arguments), it is possible since it allows name as a positional argument and 'name' as a key in the keyword arguments: >>> def foo ( name , / , ** kwds ): ... return 'name' in kwds ... >>> foo ( 1 , ** { 'name' : 2 }) True In other words, the names of positional-only parameters can be used in **kwds without ambiguity. 4.9.3.5. Recap ¶ The use case will determine which parameters to use in the function definition: def f ( pos1 , pos2 , / , pos_or_kwd , * , kwd1 , kwd2 ): As guidance: Use positional-only if you want the name of the parameters to not be available to the user. This is useful when parameter names have no real meaning, if you want to enforce the order of the arguments when the function is called or if you need to take some positional parameters and arbitrary keywords. Use keyword-only when names have meaning and the function definition is more understandable by being explicit with names or you want to prevent users relying on the position of the argument being passed. For an API, use positional-only to prevent breaking API changes if the parameter’s name is modified in the future. 4.9.4. Arbitrary Argument Lists ¶ Finally, the least frequently used option is to specify that a function can be called with an arbitrary number of arguments. These arguments will be wrapped up in a tuple (see Tuples and Sequences ). Before the variable number of arguments, zero or more normal arguments may occur. def write_multiple_items ( file , separator , * args ): file . write ( separator . join ( args )) Normally, these variadic arguments will be last in the list of formal parameters, because they scoop up all remaining input arguments that are passed to the function. Any formal parameters which occur after the *args parameter are ‘keyword-only’ arguments, meaning that they can only be used as keywords rather than positional arguments. >>> def concat ( * args , sep = "/" ): ... return sep . join ( args ) ... >>> concat ( "earth" , "mars" , "venus" ) 'earth/mars/venus' >>> concat ( "earth" , "mars" , "venus" , sep = "." ) 'earth.mars.venus' 4.9.5. Unpacking Argument Lists ¶ The reverse situation occurs when the arguments are already in a list or tuple but need to be unpacked for a function call requiring separate positional arguments. For instance, the built-in range() function expects separate start and stop arguments. If they are not available separately, write the function call with the * -operator to unpack the arguments out of a list or tuple: >>> list ( range ( 3 , 6 )) # normal call with separate arguments [3, 4, 5] >>> args = [ 3 , 6 ] >>> list ( range ( * args )) # call with arguments unpacked from a list [3, 4, 5] In the same fashion, dictionaries can deliver keyword arguments with the ** -operator: >>> def parrot ( voltage , state = 'a stiff' , action = 'voom' ): ... print ( "-- This parrot wouldn't" , action , end = ' ' ) ... print ( "if you put" , voltage , "volts through it." , end = ' ' ) ... print ( "E's" , state , "!" ) ... >>> d = { "voltage" : "four million" , "state" : "bleedin' demised" , "action" : "VOOM" } >>> parrot ( ** d ) -- This parrot wouldn't VOOM if you put four million volts through it. E's bleedin' demised ! 4.9.6. Lambda Expressions ¶ Small anonymous functions can be created with the lambda keyword. This function returns the sum of its two arguments: lambda a, b: a+b . Lambda functions can be used wherever function objects are required. They are syntactically restricted to a single expression. Semantically, they are just syntactic sugar for a normal function definition. Like nested function definitions, lambda functions can reference variables from the containing scope: >>> def make_incrementor ( n ): ... return lambda x : x + n ... >>> f = make_incrementor ( 42 ) >>> f ( 0 ) 42 >>> f ( 1 ) 43 The above example uses a lambda expression to return a function. Another use is to pass a small function as an argument. For instance, list.sort() takes a sorting key function key which can be a lambda function: >>> pairs = [( 1 , 'one' ), ( 2 , 'two' ), ( 3 , 'three' ), ( 4 , 'four' )] >>> pairs . sort ( key = lambda pair : pair [ 1 ]) >>> pairs [(4, 'four'), (1, 'one'), (3, 'three'), (2, 'two')] 4.9.7. Documentation Strings ¶ Here are some conventions about the content and formatting of documentation strings. The first line should always be a short, concise summary of the object’s purpose. For brevity, it should not explicitly state the object’s name or type, since these are available by other means (except if the name happens to be a verb describing a function’s operation). This line should begin with a capital letter and end with a period. If there are more lines in the documentation string, the second line should be blank, visually separating the summary from the rest of the description. The following lines should be one or more paragraphs describing the object’s calling conventions, its side effects, etc. The Python parser strips indentation from multi-line string literals when they serve as module, class, or function docstrings. Here is an example of a multi-line docstring: >>> def my_function (): ... """Do nothing, but document it. ... ... No, really, it doesn't do anything: ... ... >>> my_function() ... >>> ... """ ... pass ... >>> print ( my_function . __doc__ ) Do nothing, but document it. No, really, it doesn't do anything: >>> my_function() >>> 4.9.8. Function Annotations ¶ Function annotations are completely optional metadata information about the types used by user-defined functions (see PEP 3107 and PEP 484 for more information). Annotations are stored in the __annotations__ attribute of the function as a dictionary and have no effect on any other part of the function. Parameter annotations are defined by a colon after the parameter name, followed by an expression evaluating to the value of the annotation. Return annotations are defined by a literal -> , followed by an expression, between the parameter list and the colon denoting the end of the def statement. The following example has a required argument, an optional argument, and the return value annotated: >>> def f ( ham : str , eggs : str = 'eggs' ) -> str : ... print ( "Annotations:" , f . __annotations__ ) ... print ( "Arguments:" , ham , eggs ) ... return ham + ' and ' + eggs ... >>> f ( 'spam' ) Annotations: {'ham': <class 'str'>, 'return': <class 'str'>, 'eggs': <class 'str'>} Arguments: spam eggs 'spam and eggs' 4.10. Intermezzo: Coding Style ¶ Now that you are about to write longer, more complex pieces of Python, it is a good time to talk about coding style . Most languages can be written (or more concise, formatted ) in different styles; some are more readable than others. Making it easy for others to read your code is always a good idea, and adopting a nice coding style helps tremendously for that. For Python, PEP 8 has emerged as the style guide that most projects adhere to; it promotes a very readable and eye-pleasing coding style. Every Python developer should read it at some point; here are the most important points extracted for you: Use 4-space indentation, and no tabs. 4 spaces are a good compromise between small indentation (allows greater nesting depth) and large indentation (easier to read). Tabs introduce confusion, and are best left out. Wrap lines so that they don’t exceed 79 characters. This helps users with small displays and makes it possible to have several code files side-by-side on larger displays. Use blank lines to separate functions and classes, and larger blocks of code inside functions. When possible, put comments on a line of their own. Use docstrings. Use spaces around operators and after commas, but not directly inside bracketing constructs: a = f(1, 2) + g(3, 4) . Name your classes and functions consistently; the convention is to use UpperCamelCase for classes and lowercase_with_underscores for functions and methods. Always use self as the name for the first method argument (see A First Look at Classes for more on classes and methods). Don’t use fancy encodings if your code is meant to be used in international environments. Python’s default, UTF-8, or even plain ASCII work best in any case. Likewise, don’t use non-ASCII characters in identifiers if there is only the slightest chance people speaking a different language will read or maintain the code. Footnotes [ 1 ] Actually, call by object reference would be a better description, since if a mutable object is passed, the caller will see any changes the callee makes to it (items inserted into a list). Table of Contents 4. More Control Flow Tools 4.1. if Statements 4.2. for Statements 4.3. The range() Function 4.4. break and continue Statements 4.5. else Clauses on Loops 4.6. pass Statements 4.7. match Statements 4.8. Defining Functions 4.9. More on Defining Functions 4.9.1. Default Argument Values 4.9.2. Keyword Arguments 4.9.3. Special parameters 4.9.3.1. Positional-or-Keyword Arguments 4.9.3.2. Positional-Only Parameters 4.9.3.3. Keyword-Only Arguments 4.9.3.4. Function Examples 4.9.3.5. Recap 4.9.4. Arbitrary Argument Lists 4.9.5. Unpacking Argument Lists 4.9.6. Lambda Expressions 4.9.7. Documentation Strings 4.9.8. Function Annotations 4.10. Intermezzo: Coding Style Previous topic 3. An Informal Introduction to Python Next topic 5. Data Structures This page Report a bug Show source « Navigation index modules | next | previous | Python » 3.14.2 Documentation » The Python Tutorial » 4. More Control Flow Tools | Theme Auto Light Dark | © Copyright 2001 Python Software Foundation. This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. See History and License for more information. The Python Software Foundation is a non-profit corporation. Please donate. Last updated on Jan 13, 2026 (06:19 UTC). Found a bug ? Created using Sphinx 8.2.3. | 2026-01-13T08:48:44 |
https://dev.to/t/flutter#main-content | Flutter - DEV Community Forem Feed Follow new Subforems to improve your feed DEV Community Follow A space to discuss and keep up software development and manage your software career Future Follow News and discussion of science and technology such as AI, VR, cryptocurrency, quantum computing, and more. Open Forem Follow A general discussion space for the Forem community. If it doesn't have a home elsewhere, it belongs here Gamers Forem Follow An inclusive community for gaming enthusiasts Music Forem Follow From composing and gigging to gear, hot music takes, and everything in between. Vibe Coding Forem Follow Discussing AI software development, and showing off what we're building. Popcorn Movies and TV Follow Movie and TV enthusiasm, criticism and everything in-between. DUMB DEV Community Follow Memes and software development shitposting Design Community Follow Web design, graphic design and everything in-between Security Forem Follow Your central hub for all things security. From ethical hacking and CTFs to GRC and career development, for beginners and pros alike Golf Forem Follow A community of golfers and golfing enthusiasts Crypto Forem Follow A collaborative community for all things Crypto—from Bitcoin to protocol development and DeFi to NFTs and market analysis. Parenting Follow A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Forem Core Follow Discussing the core forem open source software project — features, bugs, performance, self-hosting. Maker Forem Follow A community for makers, hobbyists, and professionals to discuss Arduino, Raspberry Pi, 3D printing, and much more. HMPL.js Forem Follow For developers using HMPL.js to build fast, lightweight web apps. A space to share projects, ask questions, and discuss server-driven templating Dropdown menu Dropdown menu Skip to content Navigation menu Search Powered by Algolia Search Log in Create account DEV Community Close Flutter Follow Hide An open source framework by Google for building beautiful, natively compiled, multi-platform applications from a single codebase. Create Post about #flutter This tag is dedicated to posts related to Flutter, fell free! Older #flutter posts 1 2 3 4 5 6 7 8 9 … 75 … 191 Posts Left menu 👋 Sign in for the ability to sort posts by relevant , latest , or top . Right menu The Features I Killed to Ship The 80 Percent App in 4 Weeks Malawige Inusha Thathsara Gunasekara Malawige Inusha Thathsara Gunasekara Malawige Inusha Thathsara Gunasekara Follow Jan 12 The Features I Killed to Ship The 80 Percent App in 4 Weeks # flutter # softwareengineering # devops # learning Comments Add Comment 4 min read Clone MedTalk: HIPAA-Ready Video and Chat Consultations in Flutter Ekemini Samuel Ekemini Samuel Ekemini Samuel Follow Jan 12 Clone MedTalk: HIPAA-Ready Video and Chat Consultations in Flutter # flutter # tutorial # programming # coding 10 reactions Comments 1 comment 23 min read Flutter ECS: Mastering Async Operations and Complex Workflows Dr. E Dr. E Dr. E Follow Jan 11 Flutter ECS: Mastering Async Operations and Complex Workflows # flutter # dart # programming # opensource Comments Add Comment 2 min read Creating Spotlight Tutorials in Flutter: The Complete Guide to Selective Overlays Thanasis Traitsis Thanasis Traitsis Thanasis Traitsis Follow Jan 11 Creating Spotlight Tutorials in Flutter: The Complete Guide to Selective Overlays # flutter # dart # tutorial # coding Comments Add Comment 12 min read Release Week From Hell: Clean code + automation for shipping Flutter apps Anindya Obi Anindya Obi Anindya Obi Follow Jan 9 Release Week From Hell: Clean code + automation for shipping Flutter apps # flutter # dart # android # ios Comments Add Comment 3 min read Build a Robust Offline-First Flutter App with BLoC, Dio, and Sqflite ghamdan ghamdan ghamdan Follow Jan 10 Build a Robust Offline-First Flutter App with BLoC, Dio, and Sqflite # flutter # dart # mobile # tutorial Comments Add Comment 7 min read I Built a Privacy-First Note-Taking App with Flutter — Here's What I Learned PRANTA Dutta PRANTA Dutta PRANTA Dutta Follow Jan 9 I Built a Privacy-First Note-Taking App with Flutter — Here's What I Learned # flutter # dart # mobile # privacy Comments Add Comment 4 min read FlutterFlow's AI Future is DreamFlow. Its AI Present is This. Stuart Stuart Stuart Follow Jan 9 FlutterFlow's AI Future is DreamFlow. Its AI Present is This. # ai # flutter # dart # programming Comments Add Comment 3 min read How to Add Comments to a Flutter App Without a Backend Joris Obert Joris Obert Joris Obert Follow Jan 8 How to Add Comments to a Flutter App Without a Backend # flutter # dart # mobile # saas Comments Add Comment 3 min read AI-Native Apps: Vertex AI and Flutter Integration Nick Peterson Nick Peterson Nick Peterson Follow Jan 6 AI-Native Apps: Vertex AI and Flutter Integration # ai # flutter # backend # fullstack Comments Add Comment 6 min read Flutter package for advanced canvas editing opensource Vladislav Enev Vladislav Enev Vladislav Enev Follow Jan 10 Flutter package for advanced canvas editing opensource # programming # flutter # opensource # dart Comments Add Comment 1 min read Build a Flutter Live Streaming App Using ZEGOCLOUD (Like Chat & Video Call Apps) Hazem Hamdy Hazem Hamdy Hazem Hamdy Follow Jan 4 Build a Flutter Live Streaming App Using ZEGOCLOUD (Like Chat & Video Call Apps) # flutter # zegocloud # livestreaming # webdev Comments Add Comment 12 min read Solving the UI Customization Nightmare in Flutter Enterprise Apps Tejas Tejas Tejas Follow Jan 2 Solving the UI Customization Nightmare in Flutter Enterprise Apps # appdev # flutter # dart # architecture 8 reactions Comments Add Comment 3 min read 5 Flutter Architecture Mistakes That Only Appeared After Release Abdul Wahab Abdul Wahab Abdul Wahab Follow Jan 1 5 Flutter Architecture Mistakes That Only Appeared After Release # flutter # architecture # productivity # startup Comments Add Comment 3 min read building Drosk - your smart desktop file organizer exoad exoad exoad Follow Jan 6 building Drosk - your smart desktop file organizer # showdev # flutter # programming 1 reaction Comments Add Comment 1 min read How to Implement Onboarding Mascots in Flutter with Rive Praneeth Kawya Thathsara Praneeth Kawya Thathsara Praneeth Kawya Thathsara Follow Dec 31 '25 How to Implement Onboarding Mascots in Flutter with Rive # flutter # dart # rive # riveanimation Comments Add Comment 3 min read How Duolingo-Style Character Animations Are Built in Rive And How Product Teams Integrate Them into Mobile Apps Praneeth Kawya Thathsara Praneeth Kawya Thathsara Praneeth Kawya Thathsara Follow Dec 31 '25 How Duolingo-Style Character Animations Are Built in Rive And How Product Teams Integrate Them into Mobile Apps # duoling # riveanimation # flutter # mobileapp Comments Add Comment 3 min read I Built an AI Boardroom App in 8 Hours with Flutter & AI 🚀 (Open Source) Sayed Ali Alkamel Sayed Ali Alkamel Sayed Ali Alkamel Follow Jan 5 I Built an AI Boardroom App in 8 Hours with Flutter & AI 🚀 (Open Source) # flutter # dart # ai # mobile 5 reactions Comments Add Comment 4 min read Flutter Development Basics - Getting Started dss99911 dss99911 dss99911 Follow Dec 31 '25 Flutter Development Basics - Getting Started # mobile # common # flutter # dart Comments Add Comment 1 min read How Much Does Custom Mascot Animation Cost? Praneeth Kawya Thathsara Praneeth Kawya Thathsara Praneeth Kawya Thathsara Follow Dec 31 '25 How Much Does Custom Mascot Animation Cost? # riveanimation # mascotanimation # animation # flutter Comments Add Comment 4 min read Flutter SaaS Starter Kit — Launch a SaaS MVP in Days Mehmet Çelik Mehmet Çelik Mehmet Çelik Follow Dec 30 '25 Flutter SaaS Starter Kit — Launch a SaaS MVP in Days # saas # startup # tooling # flutter Comments Add Comment 1 min read Flutter vs React Native: Choosing the Right Cross-Platform Framework Emma Trump Emma Trump Emma Trump Follow Dec 29 '25 Flutter vs React Native: Choosing the Right Cross-Platform Framework # flutter # mobile # reactnative Comments Add Comment 3 min read My First Open Source Project: Bringing Flutter Layouts to React Nishan Bhuinya Nishan Bhuinya Nishan Bhuinya Follow Dec 28 '25 My First Open Source Project: Bringing Flutter Layouts to React # react # opensource # flutter # webdev 3 reactions Comments Add Comment 3 min read The Developer's Guide to Actually Private Apps: No Cloud, No Analytics, No Tracking Karol Burdziński Karol Burdziński Karol Burdziński Follow Dec 28 '25 The Developer's Guide to Actually Private Apps: No Cloud, No Analytics, No Tracking # security # privacy # mobile # flutter 1 reaction Comments Add Comment 19 min read 8 Places Where Flutter / React Native Save You Weeks Dev. Resources Dev. Resources Dev. Resources Follow Dec 27 '25 8 Places Where Flutter / React Native Save You Weeks # webdev # programming # flutter # reactnative 5 reactions Comments Add Comment 7 min read loading... trending guides/resources 7 Best Resources to Learn Flutter: My Way to Confident Developer How Impeller Is Transforming Flutter UI Rendering in 2026 AI Dev: Plan Mode vs. SDD — A Weekend Experiment Flutter Development Setup for WSL2 + Windows Android Studio (Complete Guide) 안드로이드 개발자가 빠르게 적용할 수 있는 Flutter 프로젝트 구성 Patrol: The Flutter Testing Framework That Changes Everything Transforming Figma Designs into Flutter Code Using AI ⚔️ “Flutter vs React Native 2025: Who Wins the Cross-Platform War?” 🚀 Best Free & Open Source Flutter Admin Dashboard Template for 2026 Backend-Driven Localization in Flutter: A Production-Ready Implementation Guide Make Games with Flutter in 2025: Flame Engine, Tools, and Free Assets Stop Losing Users to Silent Crashes: Introducing crash_reporter for Flutter 💻 Flutter V2Ray Client Desktop Plugin — V2Ray/Xray & Sing-Box VPN for Windows, macOS, Linux Don't Build Just Another Chatbot: Architecting a "Duolingo-Style" AI Companion with Rive Building a Secure Crypto Payment Gateway with Node.js and Flutter Flutter: Essential widgets Flutter vs React Native: Which Is Better for Cross-Platform App Development in 2026? Changing Screen Color on Tap — My Flutter Learning Journey Mobile App Trends 2025: The Complete Developer Guide to UI/UX, AI, and Beyond Not Just a WebView: Building a Native Engine on Flutter to Convert Sites to Apps with SDUI 💎 DEV Diamond Sponsors Thank you to our Diamond Sponsors for supporting the DEV Community Google AI is the official AI Model and Platform Partner of DEV Neon is the official database partner of DEV Algolia is the official search partner of DEV DEV Community — A space to discuss and keep up software development and manage your software career Home DEV++ Podcasts Videos DEV Education Tracks DEV Challenges DEV Help Advertise on DEV DEV Showcase About Contact Free Postgres Database Software comparisons Forem Shop Code of Conduct Privacy Policy Terms of Use Built on Forem — the open source software that powers DEV and other inclusive communities. Made with love and Ruby on Rails . DEV Community © 2016 - 2026. We're a place where coders share, stay up-to-date and grow their careers. Log in Create account | 2026-01-13T08:48:44 |
https://parenting.forem.com/t/dadlife | Dadlife - Parenting Forem Feed Follow new Subforems to improve your feed DEV Community Follow A space to discuss and keep up software development and manage your software career Future Follow News and discussion of science and technology such as AI, VR, cryptocurrency, quantum computing, and more. Open Forem Follow A general discussion space for the Forem community. If it doesn't have a home elsewhere, it belongs here Gamers Forem Follow An inclusive community for gaming enthusiasts Music Forem Follow From composing and gigging to gear, hot music takes, and everything in between. Vibe Coding Forem Follow Discussing AI software development, and showing off what we're building. Popcorn Movies and TV Follow Movie and TV enthusiasm, criticism and everything in-between. DUMB DEV Community Follow Memes and software development shitposting Design Community Follow Web design, graphic design and everything in-between Security Forem Follow Your central hub for all things security. From ethical hacking and CTFs to GRC and career development, for beginners and pros alike Golf Forem Follow A community of golfers and golfing enthusiasts Crypto Forem Follow A collaborative community for all things Crypto—from Bitcoin to protocol development and DeFi to NFTs and market analysis. Parenting Follow A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Forem Core Follow Discussing the core forem open source software project — features, bugs, performance, self-hosting. Maker Forem Follow A community for makers, hobbyists, and professionals to discuss Arduino, Raspberry Pi, 3D printing, and much more. HMPL.js Forem Follow For developers using HMPL.js to build fast, lightweight web apps. A space to share projects, ask questions, and discuss server-driven templating Dropdown menu Dropdown menu Skip to content Navigation menu Search Powered by Algolia Search Log in Create account Parenting Close # dadlife Follow Hide Sharing the unique experiences and challenges of being a father. Create Post Posts Left menu 👋 Sign in for the ability to sort posts by relevant , latest , or top . Right menu I built a free baby tracker that syncs across devices without requiring an account Siarhei Siarhei Siarhei Follow Dec 1 '25 I built a free baby tracker that syncs across devices without requiring an account # dadlife # newparents 2 reactions Comments 1 comment 3 min read loading... trending guides/resources I built a free baby tracker that syncs across devices without requiring an account 💎 DEV Diamond Sponsors Thank you to our Diamond Sponsors for supporting the DEV Community Google AI is the official AI Model and Platform Partner of DEV Neon is the official database partner of DEV Algolia is the official search partner of DEV Parenting — A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Home About Contact Code of Conduct Privacy Policy Terms of Use Built on Forem — the open source software that powers DEV and other inclusive communities. Made with love and Ruby on Rails . Parenting © 2016 - 2026. Navigating the chaos and joy of parenting. Log in Create account | 2026-01-13T08:48:44 |
https://highlight.io/for/next-backend | highlight.io: The open source monitoring platform. Star us on GitHub Star Product Integrations Pricing Resources Docs Sign in Sign up Your browser does not support the video tag. Your browser does not support the video tag. The Next.js monitoring toolkit you've been waiting for. What if monitoring your Next.js app was as easy as deploying it? With session replay and error monitoring, Highlight's got you covered. Get started Live demo Session Replay Investigate hard-to-crack bugs by playing through issues in a youtube-like UI. With access to requests, console logs and more! Error Monitoring Continuously monitor errors and exceptions in your Next.js application, all the way from your frontend to your backend. Performance Metrics Monitor and set alerts for important performance metrics in Next.js like Web Vitals, Request latency, and much more! Highlight for Next.js Get started in your Next.js app today. Get started for free Live demo Backend import { withHighlight } from '../highlight.config' const handler = async (req, res) => { res.status(200).json({ name: 'Jay' }) } export default withHighlight(handler) Reproduce issues with high-fidelity session replay. With our pixel-perfect replays of your Next.js app, you'll get to the bottom of issues in no time and better understand how your app is being used. Read our docs Get a ping when exceptions or errors are thrown. Our alerting infrastructure can take abnormal metrics or errors raised in your Next.js app and notify your engineering team over Slack, Discord, and more! Read our docs Monitor the metrics that keep your customers around. Highlight allows you to track performance, request timings, and several other metrics in your Next.js application. Read our docs Our customers Highlight powers forward-thinking companies. More about our customers → Don't take our word. What our customers have to say → Highlight helps us catch bugs that would otherwise go undetected and makes it easy to replicate and debug them. Max Musing , Founder & CEO Highlight weaves together the incredible, varied, and complex interactions of our users into something understandable and actionable. Kai Hess , Founding Product Designer I love Highlight because not only does it help me debug more quickly, but it gives me insight into how customers are actually using our product. Meryl Dakin , Founding Software Engineer Highlight has helped us win over several customers by making it possible for us to provide hands-on support, based on a detailed understanding of what each user was doing. Neil Raina , CTO Highlight helps us catch bugs that would otherwise go undetected and makes it easy to replicate and debug them. Max Musing , Founder & CEO Highlight weaves together the incredible, varied, and complex interactions of our users into something understandable and actionable. Kai Hess , Founding Product Designer I love Highlight because not only does it help me debug more quickly, but it gives me insight into how customers are actually using our product. Meryl Dakin , Founding Software Engineer Highlight has helped us win over several customers by making it possible for us to provide hands-on support, based on a detailed understanding of what each user was doing. Neil Raina , CTO Try Highlight Today Get the visibility you need Get started for free Product Pricing Sign up Features Privacy & Security Customers Session Replay Error Monitoring Logging Competitors LogRocket Hotjar Fullstory Smartlook Inspectlet Datadog Sentry Site24x7 Sprig Mouseflow Pendo Heap LogicMonitor Last9 Axiom Better Stack HyperDX Dash0 Developers Changelog Documentation Ambassadors Frameworks React Next.js Angular Gatsby.js Svelte.js Vue.js Express Golang Next.js Node.js Rails Hono Contact & Legal Terms of Service Privacy Policy Careers sales@highlight.io security@highlight.io [object Object] | 2026-01-13T08:48:44 |
https://porkbun.com/event/christmas-domain-name-sale | porkbun.com | Holiday .com domain sale! Toggle navigation porkbun $0.00 (0) products Domains Transfers Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting All Web Hosting Options Easy WordPress Link In Bio Articulation Sitebuilder Cloud WordPress Shared cPanel Hosting Static Hosting Website Builder Easy PHP Email Hosting All Email Hosting Options Proton Mail Porkbun Email Free Email Forwarding Marketing Tools Textla - SMS Marketing Free WHOIS Privacy Free SSL Certificates Free URL Forwarding transfer Free WordPress SALE! .COM SALE! About --> About Who We Are Why Choose Porkbun Porkbun vs Cloudflare FAQs Resources Knowledge Base Porkbun Blog Service Status Help $0.00 (0) sign in Holiday .com domain sale! bulk search Uh oh! Domain List TLD Selection Enter one domain per line in the box above. You can search for a maximum of 100 domains at a time. Enter a single SLD in the box above and select the TLDs to search below. You can select a maximum of 100 TLDs. abogado ac ac.nz academy accountant accountants actor adult ae.org ag agency ai airforce am apartments app archi army art as asia associates attorney auction audio auto autos baby band bar bargains basketball bayern beauty beer best bet bh bible bid bike bingo bio biz biz.pr black blackfriday blog blue boats bond boo boston bot boutique br.com broker build builders business buzz bz ca cab cafe cam camera camp capital car cards care careers cars casa cash casino catering cc center ceo cfd channel charity chat cheap christmas church city claims cleaning click clinic clothing cloud club club.tw cn.com co co.ag co.bz co.com co.gg co.in co.je co.lc co.nz co.uk coach codes coffee college com com.ag com.ai com.bz com.de com.lc com.mx com.ph com.pr com.sc com.se com.vc community company compare computer condos construction consulting contact contractors cooking cool country coupons courses credit creditcard cricket cruises cv cx cymru cyou dad dance date dating day de de.com deal dealer deals degree delivery democrat dental dentist desi design dev diamonds diet digital direct directory discount diy doctor dog domains download earth ebiz.tw eco education email energy engineer engineering enterprises equipment esq estate eu eu.com events exchange expert exposed express fail faith family fan fans farm fashion fast feedback finance financial firm.in fish fishing fit fitness flights florist flowers fly fm fo foo food football forex forsale forum foundation free fun fund furniture futbol fyi gallery game game.tw games garden gay gb.net geek.nz gen.in gen.nz gg gift gifts gives giving glass global gmbh gold golf gr.com graphics gratis green gripe group guide guitars guru hair haus health healthcare help hiphop hiv hockey holdings holiday homes horse hospital host hosting hot house how hu.net icu id immo immobilien in in.net inc ind.in industries info info.pr ing ink institute insure international investments io irish isla.pr it.com je jetzt jewelry jobs jp.net jpn.com juegos kaufen kids kim kitchen kiwi.nz kyoto l.lc la land lat law lawyer lc lease legal lgbt life lifestyle lighting limited limo link live living llc loan loans lol london lotto love ltd ltda luxe luxury maison makeup management maori.nz market marketing markets mba me me.uk med media melbourne meme memorial men menu mex.com miami mn mobi moda moe moi mom money monster mortgage motorcycles mov movie mu music mx my nagoya name name.pr navy net net.ag net.ai net.bz net.gg net.in net.je net.lc net.nz net.ph net.pr net.vc network new news nexus ngo ninja nl nom.ag now nrw nyc nz observer off.ai one ong onl online ooo org org.ag org.ai org.bz org.gg org.in org.je org.lc org.mx org.nz org.ph org.pr org.sc org.uk org.vc organic osaka p.lc page partners parts party pet ph phd photo photography photos pics pictures pink pizza place plumbing plus poker porn pr press pro pro.pr productions prof promo properties property protection pub pw qpon quest racing radio.am radio.fm realty recipes red rehab reise reisen rent rentals repair report republican rest restaurant review reviews rich rip rocks rodeo rsvp ru.com rugby run sa.com saarland sale salon sarl sbs sc school school.nz schule science se.net security select services sex sexy sh shiksha shoes shop shopping show singles site ski skin soccer social software solar solutions soy spa space spot srl storage store stream studio study style sucks supplies supply support surf surgery sydney systems taipei talk tattoo tax taxi team tech technology tel tennis theater theatre tickets tienda tips tires tm to today tokyo tools top tours town toys trade trading training travel tube tv tw uk uk.com uk.net university uno us us.com us.org vacations vana vc vegas ventures vet viajes video villas vin vip vision vodka vote voto voyage wales wang watch watches webcam website wedding wiki win wine work works world ws wtf xn--5tzm5g xn--6frz82g xn--czrs0t xn--fjq720a xn--q9jyb4c xn--unup4y xn--vhquv xxx xyz yachts yoga yokohama you za.com zip zone Add available domains to the cart. 100 max. AI Search | Auction Search | Marketplace Search Our .com domains are on sale once again, but supplies in Santa's bag are limited! Get the lowest price from Porkbun this season on .com domains. Sale on .com ends Dec 31, 2024, 11:59 PM UTC or when stock runs out, whichever comes first. Less than 80,500 units available as of Dec 6, 2024. .com $11.08 Daily Low Price And remember to sign up for our newsletter for the latest holiday sales from Porkbun! You're In Good Hooves We are the highest-rated domain name registrar on Trustpilot, as reviewed by real customers. Trustpilot × Modal Title Close Close × Modal Title Close porkbun Porkbun is an amazingly awesome ICANN accredited domain name registrar based out of the Pacific Northwest. We're different, we're easy, and we're affordable. Use us, you won't be sorry. If you don't use us we'll be sad, but we'll still love you. Get Pork-Puns In Your Inbox Stay in the loop on all things Porkbun by signing up for our newsletter! 21370 SW Langer Farms Parkway, Suite 142-429 Sherwood, OR 97140, US If you're looking for support, you might be able to answer your own question using our Knowledge Base . Support Hours Impacted From January 3rd to January 11th we will be holding our annual company summit which will impact live and after hours support. Our goal is to provide you with an excellent domain registration experience and support and we all appreciate your patience as the whole company works together to make Porkbun even better. Thank you. Reach our USA-Based phone support team: 1.855.PORKBUN (1.855.767.5286) 9AM - 5PM Pacific Time Other Hours: Your mileage may vary, but give it a whirl support@porkbun.com 24 / 7 Email Support Chat Support Hours Vary Your browser does not support the audio element. This plays a little Porkbun jingle. Stay up to date with Porkbun. Sign up for our cool newsletter and we'll keep you up to date with sweet deals, amazing info, and maybe even the occasional limerick or sonnet. Sign Up Products Domain Names Greatest Deals Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting Link In Bio Articulation Sitebuilder Cloud WordPress cPanel Hosting Static Hosting Easy PHP Website Builder Email Hosting WHOIS Privacy DNS Management SSL Certificates Email Forwarding URL Forwarding Quick Connect Domain Transfer Affiliate Program Handshake Names Ethereum Name Service International Domain Names API Access Support Contact Us Knowledge Base Payment Options Report Abuse Tools Domain Search Domain Suggestion Generator RDAP (WHOIS) Password Generator Service Status Don't like our name? The Buniverse Your IP Address Online DNS Lookup Our Company About Us Our Official Blog Careers Branding Guidelines Policies and Legal Privacy Policy Data Disclosure Policy Bug Bounty Program Porkbun Merchandise Awesomeness Copyright © Porkbun LLC. All rights reserved. Porkbun is a Top Level Design Company Made in the USA 🇺🇸 This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. WARNING: This site has been known to cause a mind blowing experience. We recommend you prepare yourself mentally and if possible be sitting down. Side effects may include saving money, letting out a chuckle, and sporadic oinking. 1 × Modal Title Cancel Continue | 2026-01-13T08:48:44 |
https://github.com/python-docs-translations/dashboard/ | GitHub - python-docs-translations/dashboard: Python documentation translation dashboard Skip to content Navigation Menu Toggle navigation Sign in Appearance settings Platform AI CODE CREATION GitHub Copilot Write better code with AI GitHub Spark Build and deploy intelligent apps GitHub Models Manage and compare prompts MCP Registry New Integrate external tools DEVELOPER WORKFLOWS Actions Automate any workflow Codespaces Instant dev environments Issues Plan and track work Code Review Manage code changes APPLICATION SECURITY GitHub Advanced Security Find and fix vulnerabilities Code security Secure your code as you build Secret protection Stop leaks before they start EXPLORE Why GitHub Documentation Blog Changelog Marketplace View all features Solutions BY COMPANY SIZE Enterprises Small and medium teams Startups Nonprofits BY USE CASE App Modernization DevSecOps DevOps CI/CD View all use cases BY INDUSTRY Healthcare Financial services Manufacturing Government View all industries View all solutions Resources EXPLORE BY TOPIC AI Software Development DevOps Security View all topics EXPLORE BY TYPE Customer stories Events & webinars Ebooks & reports Business insights GitHub Skills SUPPORT & SERVICES Documentation Customer support Community forum Trust center Partners Open Source COMMUNITY GitHub Sponsors Fund open source developers PROGRAMS Security Lab Maintainer Community Accelerator Archive Program REPOSITORIES Topics Trending Collections Enterprise ENTERPRISE SOLUTIONS Enterprise platform AI-powered developer platform AVAILABLE ADD-ONS GitHub Advanced Security Enterprise-grade security features Copilot for Business Enterprise-grade AI features Premium Support Enterprise-grade 24/7 support Pricing Search or jump to... Search code, repositories, users, issues, pull requests... --> Search Clear Search syntax tips Provide feedback --> We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly --> Name Query To see all available qualifiers, see our documentation . Cancel Create saved search Sign in Sign up Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} python-docs-translations / dashboard Public Notifications You must be signed in to change notification settings Fork 5 Star 8 Python documentation translation dashboard translations.python.org License CC0-1.0 license 8 stars 5 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings Code Issues 12 Pull requests 4 Actions Security Uh oh! There was an error while loading. Please reload this page . Insights Additional navigation options Code Issues Pull requests Actions Security Insights python-docs-translations/dashboard main Branches Tags Go to file Code Open more actions menu Folders and files Name Name Last commit message Last commit date Latest commit History 252 Commits .github .github src src templates templates tests tests .gitignore .gitignore .pre-commit-config.yaml .pre-commit-config.yaml LICENSE LICENSE README.md README.md build_warnings.py build_warnings.py completion.py completion.py contribute.py contribute.py generate.py generate.py generate_build_details.py generate_build_details.py repositories.py repositories.py requirements.txt requirements.txt ruff.toml ruff.toml sphinx_lint.py sphinx_lint.py translated_names.py translated_names.py View all files Repository files navigation README CC0-1.0 license This project generates a dashboard presenting the Python documentation translations projects available at translations.python.org . There are two entrypoints: generate.py : Generates dashboard HTML and JSON files. generate_build_details.py : Generates the build details HTML file and log files for each translation project. About Python documentation translation dashboard translations.python.org Topics translations python-documentation pep-545 Resources Readme License CC0-1.0 license Uh oh! There was an error while loading. Please reload this page . Activity Custom properties Stars 8 stars Watchers 5 watching Forks 5 forks Report repository Uh oh! There was an error while loading. Please reload this page . Contributors 12 Uh oh! There was an error while loading. Please reload this page . Languages Python 64.8% Jinja 24.9% CSS 10.3% Footer © 2026 GitHub, Inc. Footer navigation Terms Privacy Security Status Community Docs Contact Manage cookies Do not share my personal information You can’t perform that action at this time. | 2026-01-13T08:48:44 |
https://docs.devcycle.com/platform/feature-flags/status-and-lifecycle#archived | Status and Lifecycle | DevCycle Docs Skip to main content Home SDKs APIs Management API Bucketing API Integrations CLI / MCP Best Practices Community Blog Discord Search Sign Up Home Getting Started Essentials DevCycle Overview Key Features System Architecture Feature Hierarchy Feature Types Platform Feature Flags Features Variables and Variations Targeting Status and Lifecycle Stale Feature Notifications Experimentation Account Management Security and Guardrails Testing and QA Extras Examples Platform Feature Flags Status and Lifecycle On this page Feature Status and Lifecycle Management In DevCycle, Features have Statuses that indicate their current position in the feature lifecycle. Statuses provide a clear, at-a-glance understanding of where a Feature is in its development, release, and cleanup process. Each Status belongs to a Status Category , which defines how the Feature behaves, what actions are allowed, and how it is displayed across the dashboard. Statuses Every Feature in DevCycle always has one Status , which determines its lifecycle stage. By default, DevCycle provides a set of predefined Statuses aligned to core lifecycle categories. The default Statuses are: Development Live Completed Archived In addition to the default Statuses, teams can define custom Statuses within their Project settings. This allows teams to better align Feature lifecycle tracking with their internal development and release processes while preserving DevCycle's lifecycle guarantees. Each custom Status inherits the behavior of their Category. Status changes are not automatic and are always managed explicitly by the user. Status Categories Statuses are grouped into Categories , which define shared lifecycle behavior. Development This Category represents Features that are actively being built, tested, or prepared for release. By default, new Features are created with the Development Status. While a Feature is in Development, all Targeting rules and Variations remain editable. This stage is typically used while work is ongoing and before a Feature is considered ready for a broader release. Below are some examples of different Statuses that would make sense in the Development Category: In Development Pending Design QA Internal Testing Live The Live Category represents Features that are actively running in production or being exposed to users. While a Feature is Live, all Targeting rules and Variations remain editable. Below are some examples of different Statuses that would make sense in the Live Category: Beta Ramping In Production Live Experiment Completed The Completed Category represents Features that have reached the end of active development and rollout. A Feature may be considered Completed once it has been tested, approved, and is fully released, or when no further targeting changes are expected. When a Feature is moved into a Status within the Completed Category, it enters a semi-read-only state : A single final (release) Variation must be selected All Environments will serve this Variation to all users Targeting rules are replaced with an "All users" rule New targeting rules and Variations cannot be added Variable values may still be edited Environments can still be toggled on or off When using the CLI to generate TypeScript types, Variables belonging to a Feature in the Completed Category will be marked as deprecated . Below are some examples of different Statuses that would make sense in the Completed Category: Ready for Cleanup All Users Enabled Stable Release Cleanup Checklist Upon entering a Completed Status, a cleanup checklist is shown for each Variable associated with the Feature. This checklist helps teams determine when it is safe to remove Variables from their codebase or archive them. If a Variable is still referenced in code or evaluated in production, removing it may result in default values being served. If Code References are enabled, additional context will be provided to assist with cleanup. Archived The Archived Category represents the terminal lifecycle state for Features. This Category and Status cannot be edited or changed. A Feature should be archived once it has been fully cleaned up and its Variables have been removed from the codebase. When a Feature is Archived: It becomes fully read-only It is hidden from standard dashboard views Audit Logs remain accessible for historical reference Metrics & Reach data will not be visible on the dashboard for Archived features Archiving Features helps keep both your dashboard and codebase clean while preserving valuable lifecycle history. Note: Feature deletion still exists, but should only be used for mistakes. Deleting a Feature permanently removes it and its Audit Log. Archived Features retain historical data that may be used for future reporting and analysis. Changing Status Moving a Feature to Completed When a Feature is moved into the Completed Category: A final Variation must be selected All Environments serve that Variation to all users Existing Environment statuses are preserved Targeting rules are replaced with a single "All users" rule Additional Variations and targeting rules are locked Reverting to Development or Live Features in the Completed Category can be reverted back to an earlier Status. When reverting: Previous Variations become available again Changes made to Variable values while Completed are retained Prior targeting rules are not restored and must be reconfigured Viewing Features by Status (Kanban View) On the Feature list page, users can switch between a List view and a Kanban-style view that displays Features grouped by their current Status, allowing teams to quickly visualize progress across the Feature lifecycle. In this view: Each column represents a Feature Status Each column header includes a total count of Features in each Status Features appear as cards within the column matching their current Status, and can be sorted differently by selected criteria Columns are ordered based on the Status order defined in Project Settings Status colors are reflected in the column headers for quick visual scanning This view is intended for high-level lifecycle tracking and workflow management. Selecting a Feature card opens the Feature detail view for configuration, targeting, and Variable management. Managing Statuses Statuses are managed at the Project level and apply to all Features within that Project. Each Project starts with a default set of Statuses aligned to DevCycle's lifecycle categories. Teams may customize these Statuses to better reflect their internal workflows. Project Settings Statuses can be viewed and managed from the Project Settings page under the Feature Statuses section. From this page, users can: View all Statuses grouped by Category Create new custom Statuses within supported Categories Edit existing Status names (Note: each Status must have a unique key) Reorder Statuses within a Category Assign colors to Statuses for quick visual identification Add a description to provide context behind what a Status represents Select the default Status applied when a new Feature is created Changes made in Project Settings take effect immediately and apply across the Project. Status Categories and Rules Statuses must belong to one of DevCycle's predefined Categories. The following rules apply: New Categories cannot be created Each Category must contain at least one Status The last remaining Status in a Category cannot be deleted Status labels and ordering within a Category can be modified Permissions for Status Changes Permission Rules When permissions are enabled: Statuses in the Development and Live Categories can be applied by any user with access to the Project Statuses in the Completed and Archived Categories can only be applied by users with the Publisher permission Only Publishers can create, and modify Feature Statuses in the Project Settings Edit this page Last updated on Jan 9, 2026 Previous EdgeDB (Stored Custom Properties) Next Stale Feature Notifications Statuses Status Categories Development Live Completed Archived Changing Status Moving a Feature to Completed Reverting to Development or Live Viewing Features by Status (Kanban View) Managing Statuses Project Settings Permissions for Status Changes DevCycle Dashboard Blog Privacy Policy Twitter Discord GitHub Copyright © 2026 DevCycle. All rights reserved. | 2026-01-13T08:48:44 |
https://docs.devcycle.com/platform/feature-flags/status-and-lifecycle#project-settings | Status and Lifecycle | DevCycle Docs Skip to main content Home SDKs APIs Management API Bucketing API Integrations CLI / MCP Best Practices Community Blog Discord Search Sign Up Home Getting Started Essentials DevCycle Overview Key Features System Architecture Feature Hierarchy Feature Types Platform Feature Flags Features Variables and Variations Targeting Status and Lifecycle Stale Feature Notifications Experimentation Account Management Security and Guardrails Testing and QA Extras Examples Platform Feature Flags Status and Lifecycle On this page Feature Status and Lifecycle Management In DevCycle, Features have Statuses that indicate their current position in the feature lifecycle. Statuses provide a clear, at-a-glance understanding of where a Feature is in its development, release, and cleanup process. Each Status belongs to a Status Category , which defines how the Feature behaves, what actions are allowed, and how it is displayed across the dashboard. Statuses Every Feature in DevCycle always has one Status , which determines its lifecycle stage. By default, DevCycle provides a set of predefined Statuses aligned to core lifecycle categories. The default Statuses are: Development Live Completed Archived In addition to the default Statuses, teams can define custom Statuses within their Project settings. This allows teams to better align Feature lifecycle tracking with their internal development and release processes while preserving DevCycle's lifecycle guarantees. Each custom Status inherits the behavior of their Category. Status changes are not automatic and are always managed explicitly by the user. Status Categories Statuses are grouped into Categories , which define shared lifecycle behavior. Development This Category represents Features that are actively being built, tested, or prepared for release. By default, new Features are created with the Development Status. While a Feature is in Development, all Targeting rules and Variations remain editable. This stage is typically used while work is ongoing and before a Feature is considered ready for a broader release. Below are some examples of different Statuses that would make sense in the Development Category: In Development Pending Design QA Internal Testing Live The Live Category represents Features that are actively running in production or being exposed to users. While a Feature is Live, all Targeting rules and Variations remain editable. Below are some examples of different Statuses that would make sense in the Live Category: Beta Ramping In Production Live Experiment Completed The Completed Category represents Features that have reached the end of active development and rollout. A Feature may be considered Completed once it has been tested, approved, and is fully released, or when no further targeting changes are expected. When a Feature is moved into a Status within the Completed Category, it enters a semi-read-only state : A single final (release) Variation must be selected All Environments will serve this Variation to all users Targeting rules are replaced with an "All users" rule New targeting rules and Variations cannot be added Variable values may still be edited Environments can still be toggled on or off When using the CLI to generate TypeScript types, Variables belonging to a Feature in the Completed Category will be marked as deprecated . Below are some examples of different Statuses that would make sense in the Completed Category: Ready for Cleanup All Users Enabled Stable Release Cleanup Checklist Upon entering a Completed Status, a cleanup checklist is shown for each Variable associated with the Feature. This checklist helps teams determine when it is safe to remove Variables from their codebase or archive them. If a Variable is still referenced in code or evaluated in production, removing it may result in default values being served. If Code References are enabled, additional context will be provided to assist with cleanup. Archived The Archived Category represents the terminal lifecycle state for Features. This Category and Status cannot be edited or changed. A Feature should be archived once it has been fully cleaned up and its Variables have been removed from the codebase. When a Feature is Archived: It becomes fully read-only It is hidden from standard dashboard views Audit Logs remain accessible for historical reference Metrics & Reach data will not be visible on the dashboard for Archived features Archiving Features helps keep both your dashboard and codebase clean while preserving valuable lifecycle history. Note: Feature deletion still exists, but should only be used for mistakes. Deleting a Feature permanently removes it and its Audit Log. Archived Features retain historical data that may be used for future reporting and analysis. Changing Status Moving a Feature to Completed When a Feature is moved into the Completed Category: A final Variation must be selected All Environments serve that Variation to all users Existing Environment statuses are preserved Targeting rules are replaced with a single "All users" rule Additional Variations and targeting rules are locked Reverting to Development or Live Features in the Completed Category can be reverted back to an earlier Status. When reverting: Previous Variations become available again Changes made to Variable values while Completed are retained Prior targeting rules are not restored and must be reconfigured Viewing Features by Status (Kanban View) On the Feature list page, users can switch between a List view and a Kanban-style view that displays Features grouped by their current Status, allowing teams to quickly visualize progress across the Feature lifecycle. In this view: Each column represents a Feature Status Each column header includes a total count of Features in each Status Features appear as cards within the column matching their current Status, and can be sorted differently by selected criteria Columns are ordered based on the Status order defined in Project Settings Status colors are reflected in the column headers for quick visual scanning This view is intended for high-level lifecycle tracking and workflow management. Selecting a Feature card opens the Feature detail view for configuration, targeting, and Variable management. Managing Statuses Statuses are managed at the Project level and apply to all Features within that Project. Each Project starts with a default set of Statuses aligned to DevCycle's lifecycle categories. Teams may customize these Statuses to better reflect their internal workflows. Project Settings Statuses can be viewed and managed from the Project Settings page under the Feature Statuses section. From this page, users can: View all Statuses grouped by Category Create new custom Statuses within supported Categories Edit existing Status names (Note: each Status must have a unique key) Reorder Statuses within a Category Assign colors to Statuses for quick visual identification Add a description to provide context behind what a Status represents Select the default Status applied when a new Feature is created Changes made in Project Settings take effect immediately and apply across the Project. Status Categories and Rules Statuses must belong to one of DevCycle's predefined Categories. The following rules apply: New Categories cannot be created Each Category must contain at least one Status The last remaining Status in a Category cannot be deleted Status labels and ordering within a Category can be modified Permissions for Status Changes Permission Rules When permissions are enabled: Statuses in the Development and Live Categories can be applied by any user with access to the Project Statuses in the Completed and Archived Categories can only be applied by users with the Publisher permission Only Publishers can create, and modify Feature Statuses in the Project Settings Edit this page Last updated on Jan 9, 2026 Previous EdgeDB (Stored Custom Properties) Next Stale Feature Notifications Statuses Status Categories Development Live Completed Archived Changing Status Moving a Feature to Completed Reverting to Development or Live Viewing Features by Status (Kanban View) Managing Statuses Project Settings Permissions for Status Changes DevCycle Dashboard Blog Privacy Policy Twitter Discord GitHub Copyright © 2026 DevCycle. All rights reserved. | 2026-01-13T08:48:44 |
https://parenting.forem.com/keirasmith5/top-5-breast-pumps-for-2025-soft-practical-tested-by-real-moms-h32 | Top 5 Breast Pumps for 2025: Soft, Practical & Tested by Real Moms - Parenting Forem Feed Follow new Subforems to improve your feed DEV Community Follow A space to discuss and keep up software development and manage your software career Future Follow News and discussion of science and technology such as AI, VR, cryptocurrency, quantum computing, and more. Open Forem Follow A general discussion space for the Forem community. If it doesn't have a home elsewhere, it belongs here Gamers Forem Follow An inclusive community for gaming enthusiasts Music Forem Follow From composing and gigging to gear, hot music takes, and everything in between. Vibe Coding Forem Follow Discussing AI software development, and showing off what we're building. Popcorn Movies and TV Follow Movie and TV enthusiasm, criticism and everything in-between. DUMB DEV Community Follow Memes and software development shitposting Design Community Follow Web design, graphic design and everything in-between Security Forem Follow Your central hub for all things security. From ethical hacking and CTFs to GRC and career development, for beginners and pros alike Golf Forem Follow A community of golfers and golfing enthusiasts Crypto Forem Follow A collaborative community for all things Crypto—from Bitcoin to protocol development and DeFi to NFTs and market analysis. Parenting Follow A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Forem Core Follow Discussing the core forem open source software project — features, bugs, performance, self-hosting. Maker Forem Follow A community for makers, hobbyists, and professionals to discuss Arduino, Raspberry Pi, 3D printing, and much more. HMPL.js Forem Follow For developers using HMPL.js to build fast, lightweight web apps. A space to share projects, ask questions, and discuss server-driven templating Dropdown menu Dropdown menu Skip to content Navigation menu Search Powered by Algolia Search Log in Create account Parenting Close Add reaction Like Unicorn Exploding Head Raised Hands Fire Jump to Comments Save Boost More... Copy link Copy link Copied to Clipboard Share to X Share to LinkedIn Share to Facebook Share to Mastodon Share Post via... Report Abuse Keira Smith Posted on Dec 3, 2025 Top 5 Breast Pumps for 2025: Soft, Practical & Tested by Real Moms # babygear # newparents Breastfeeding is deeply personal and often beautifully imperfect. For many families, a breast pump is more than a gadget; it is how you feed your baby when you return to work, protect supply through a growth spurt or illness, or simply get some uninterrupted sleep. As a gentle‑parenting mom who has pumped through the night and in office wellness rooms, I wrote this guide to help you choose confidently. The picks and guidance combine what families tell me works in real life with respected testing and clinical sources, including Consumer Reports, Wirecutter, La Leche League International, Cleveland Clinic, the U.S. FDA, and hospital lactation programs. Where a claim comes from the manufacturer, I say so clearly. How We Chose The five pumps below were selected to cover the most common real‑world needs: initiating supply after birth or NICU discharge, daily work pumping, discreet travel, and occasional or backup use. I weighed comfort, efficiency, ease of cleaning, noise, power options, and cost pathways such as insurance coverage or short‑term rental. Evidence and expert guidance come from La Leche League International on pumping frequency and double pumping efficiency, Cleveland Clinic on pump types, storage, and hygiene, the U.S. FDA on safe use and assembly, and Consumer Reports and Wirecutter on how pumps perform for actual lactating testers, including noise checks and day‑to‑day usability. When a feature is highlighted only by a brand, I name it as a manufacturer claim. If something is an inference from my own and clients’ experiences, I note that too and offer a confidence level. Top Five at a Glance Pump Type Best For Power Double Pumping Noted Feedback Typical Path Medela Symphony Hospital‑grade rental Establishing or rebuilding supply, NICU separation, twins Plug‑in Yes Durable clinical workhorse; research‑based modes; heavy to transport; purchase price often over $2,000.00 so rental is common (Breastfeeding Center for Greater Washington; Medela) Hospital or local lactation center rental Spectra S1/S2 family Double electric personal use Daily work pumping with comfort and customization Rechargeable or plug‑in, model‑dependent Yes Night‑light on S1/S2/S3 helps overnight sessions; generally quiet and adjustable (Breastfeeding Center for Greater Washington; La Leche League International) Often covered by insurance as a primary pump Baby Buddha 2.0 Compact portable electric Small, powerful “go‑bag” pump for on‑the‑go parents Rechargeable Yes (with compatible kits) Wirecutter notes two months of testing by an exclusively pumping parent in 2024; appreciated as a portable “workhorse” option; details vary by setup (Wirecutter) Purchase as a portable complement to a main pump Elvie wearable In‑bra wearable electric Discreet, hands‑free pumping during travel or meetings Rechargeable, app‑connected Double if using two units Very convenient and quiet under clothing; app‑based volume tracking means you cannot watch bottles fill; wearables are generally less efficient for establishing supply (Breastfeeding Center for Greater Washington; Consumer Reports) Often an out‑of‑pocket upgrade; pair with a traditional pump Haakaa silicone Manual silicone collector Letdown catch, occasional pumping, oversupply management aid No power Single Recommended by IBCLCs as a helpful tool; very portable and easy to clean; typical sizes about 5.4 fl oz and 8.5 fl oz (Consumer Reports; Milkbar Breastpumps) Low‑cost add‑on or backup Mom’s note: In my own day‑to‑day, a portable double electric with a soft night‑light made 3:00 AM sessions calmer and simpler. That tiny quality‑of‑life detail matters more than you think at two weeks postpartum. The Reviews Medela Symphony: Best Hospital‑Grade Rental for Starting Strong If you are building supply in the early weeks, separated from your baby, supporting multiples, or recovering from complications, a hospital‑grade rental is often the most reliable path. The Symphony is a clinical mainstay precisely for these use cases. The Breastfeeding Center for Greater Washington rents Medela Symphony alongside other clinical pumps and notes families choose hospital‑grade models to establish supply in the early weeks, for dips in production, for NICU separations, twins, and during travel. The unit is designed for durability and heavy daily use, and it offers research‑based patterns such as Medela’s two‑phase expression that mimic stimulation and expression cycles found in early nursing. This pump is not meant to be tossed into a tote; it is heavy and plug‑in only, and purchase pricing is high, with typical published retail values above $2,000.00. That is why rental through a hospital or lactation center remains the more accessible route. From a comfort and production standpoint, the Symphony’s adjustability and stable suction can help reduce pain and optimize letdown, which matters because pain inhibits milk ejection. In practice, it shines as a short‑term accelerator: rent for a month or two until supply is stable, then transition to a lighter home pump for long‑term use. Confidence in this pick is high, based on clinical use cases and lactation program practices. Spectra S1/S2 Family: Best Everyday Double Electric for Work and Home For regular pumping three times a day and long stretches away from baby, Consumer Reports calls double electric or battery‑powered “workhorse” pumps the right match because they pump both breasts at once and allow you to customize cycle speed and vacuum. Spectra’s S1/S2 family fits this pattern well, with the Breastfeeding Center for Greater Washington pointing out thoughtful touches like a built‑in night‑light on S1, S2, and S3 that eases middle‑of‑the‑night sessions. La Leche League International explains that double pumping generally cuts session time in half, often to about 15 minutes, and elevates prolactin, which supports supply. Those are practical advantages when you are fitting pumping into an eight‑hour workday or a baby’s nap window. Parents typically describe Spectra’s rhythm as gentle but effective, with quiet operation that does not call attention to itself in an office setting. The S1’s rechargeable battery supports mobility around the house, while the S2 is plug‑in; both offer individual control over settings to dial in comfort. Downsides are what you would expect for any traditional setup: parts to clean and tubes to keep track of, and they are more visible than wearables in public. Overall confidence is high, supported by mainstream insurance coverage, lactation‑clinic familiarity, and evidence favoring double pumping for efficiency. Baby Buddha 2.0: Best Compact Portable “Workhorse” If you want strong suction and a tiny footprint, Baby Buddha has an enthusiastic following among parents who crave portability. Wirecutter updated its guide with a two‑month test of Baby Buddha 2.0 by an exclusively pumping parent, comparing it directly with the original model. That kind of hands‑on use gives useful feedback about day‑to‑day reliability, noise, and comfort. Wirecutter’s testing approach, which has included decibel checks with a CDC‑recommended app and timed sessions to judge how fully and quickly breasts empty, suggests a realistic quality bar for any portable. In the real world, a compact motor like this can live in your jacket pocket while you use compatible flanges or collection cups. It pairs well with a pumping bra to keep hands free. Parents should expect a learning curve dialing in settings and compatible kits, and like most minis, it may not feel as smooth as larger pumps on sensitive days. As a primary for exclusives, some still prefer a heavier double electric. As a secondary pump to preserve sanity and mobility, it can be a difference‑maker. Confidence level is moderate to high, anchored in hands‑on tester feedback and typical portable‑pump trade‑offs. Elvie Wearable: Best for Discreet, Hands‑Free Sessions Wearables sit entirely in the bra, run on batteries, and can make pumping during travel, commutes, meetings, or even daycare pickup possible without tubing or a visible motor. Consumer Reports is clear that wearables are convenient but “not going to be quite as efficient” for establishing or boosting supply; many parents use a traditional double electric to lock in supply, then use a wearable as a complementary pump. The Breastfeeding Center for Greater Washington also notes that app‑based wearables like Elvie rely on the app to monitor volume, so you cannot watch bottles fill in real time, which some parents dislike. On the other hand, the muffling effect of clothing and the absence of external tubes can reduce perceived noise and increase discretion. In practice, wearables are game‑changing for multitasking, but they ask more of you in setup and troubleshooting. The pieces must be aligned precisely to avoid leaks, your bra fit matters, and cleaning is different from standard flanges. Costs are typically higher, and insurance often treats wearables as upgrades. If your priority is freedom of movement and pumping where no one will notice, a wearable like Elvie earns its place, with the caveat that you should keep a traditional double electric as your supply backbone. Confidence level is high for convenience, with the efficiency caveat supported by Consumer Reports. Haakaa Silicone: Best Manual Option for Simplicity and Letdown Catch Manual pumps still matter. Cleveland Clinic describes manual pumps as low‑cost, portable tools that excel for occasional use, backup, or letdown capture. The manual silicone Haakaa in particular has won praise from IBCLCs cited by Consumer Reports because it passively collects milk through gentle suction while you nurse or pump on the other side. Milkbar Breastpumps notes that its Gen 3 system can collect into detachable bottles roughly 5.4 fl oz or 8.5 fl oz. There is almost nothing to assemble, no power to charge, and cleaning is fast. The trade‑offs are equally clear. This is not a high‑output, double‑sided solution; it is one breast at a time and depends on your letdown. If you experience oversupply, even a passive collector can encourage extra production; Consumer Reports warns that oversupply can contribute to forceful letdown and maternal mastitis, so moderation and comfort‑first settings matter. As a budget‑friendly add‑on, a silicone manual often pays for itself by saving milk that would otherwise be lost to a nursing pad. Confidence level is high as a supplement, moderate as a primary. Buying Guide: How to Match a Pump to Your Life The right pump is the one that fits your routine, goals, and comfort. Cleveland Clinic and La Leche League International both emphasize that there is no one‑size‑fits‑all choice, so start with your use pattern. If you will be away from your baby for eight or more hours most days, a double electric that lets you customize suction and cycle speed will save time, with double pumping often cutting sessions to about 15 minutes and supporting prolactin. If you need to establish supply in the first few days or are separated after birth, a hospital‑grade rental offers the strongest, most consistent stimulation patterns, and Medela’s initiation program on a hospital unit is designed for that window. If your priority is pumping discreetly while you move, wearables trade a bit of efficiency for significant freedom. For occasional pumping, a manual silicone collector or lever‑style manual pump is small, quiet, and inexpensive. Power and portability are next. Battery options, rechargeable cases, and car adapters can turn an everyday pump into a reliable travel companion. Noise matters if you pump in shared spaces, and both Consumer Reports and Wirecutter have measured or described motor volume as part of their hands‑on testing. For hygiene and cleaning, Sanrai and other medical suppliers advise favoring closed systems because they help keep milk out of tubing and the motor. Regardless of system type, the U.S. FDA recommends reading the full manual, assembling correctly, and contacting the manufacturer if you see persistent leaks. Cost and coverage deserve early attention. Consumer Reports and ByramBaby note that many insurance plans cover a pump, often with upgrade options for a small fee, though some plans have exceptions. Wearables are frequently classified as upgrades. Hospital‑grade units are generally rented rather than purchased. Wirecutter reminds parents to treat pumps as medical devices and to verify that any pump you buy is listed in the FDA’s device database, and to note that opened pumps are often not returnable for health reasons. Finally, plan for fit and comfort. The flange or breast shield must fit your nipple diameter, allow free movement without rubbing, and may need to change over time or differ between sides; both Cleveland Clinic and Ameda emphasize that proper fit improves comfort and milk flow. Start your session with a gentle stimulation rhythm, then switch to expression. The FDA advises starting at the lowest suction and speed, breaking the seal gently with a finger after pumping, and labeling milk with date and time before refrigeration or freezing. Care, Safety, and Troubleshooting A comfortable pumping routine protects supply and your well‑being. Consumer Reports highlights that most newborns nurse every two to four hours initially, and pumping beyond comfort can backfire. Keep sessions roughly 10 to 15 minutes, avoid pain, and if it is taking longer than 30 minutes to empty in the first twelve weeks, check flange fit, settings, and schedule, or consider underlying medical factors. Postpartum hemorrhage, retained placenta, thyroid disease, diabetes, polycystic ovarian syndrome, and insufficient glandular tissue can all affect supply; lactation professionals support technique but do not diagnose or prescribe, so concerns about low supply should go to your OB/GYN or primary care clinician. Supply is demand‑driven, and the feedback inhibitor of lactation reduces production when milk sits in the breast. Prolactin peaks at night, which is why a middle‑of‑the‑night pump helps parents who exclusively pump. If you are balancing older children, Consumer Reports shares a practical time‑saver: some parents pump both breasts into two bottles while feeding previously expressed milk to their baby, cutting a long feed‑and‑pump block roughly in half. For short‑term boosts, Mamava describes power pumping that mimics cluster feeding; expect a few days before you see a change, and try not to fixate on the bottle level in the moment. When pain or output throws you a curveball, simplify. Check assembly against the manual and adjust suction down to comfort. Warm compresses and gentle breast massage before a session can help trigger letdown, and a calm environment matters; the FDA even suggests that holding your baby or looking at a photo can help. For workplace logistics, La Leche League points to U.S. protections that require reasonable break time and a private non‑bathroom space for pumping under federal law; knowing your rights reduces stress and supports consistency. Storage and Cleaning Essentials Cleveland Clinic’s storage guidance is straightforward for U.S. families. Refrigerate expressed milk for up to four days and freeze for up to twelve months, with best quality if used within six months. Label each container with the date and time. The FDA recommends washing all milk‑contact parts after each use, sanitizing at least daily for very young, preterm, or immunocompromised infants, and letting parts air‑dry on a clean surface rather than using a dish towel. The FDA also emphasizes the importance of comfortable settings and correct assembly to prevent leaks and protect nipples. The NHS describes that, once capped securely, freshly expressed milk can be left at room temperature for four to six hours before refrigeration in typical conditions, which many U.S. parents find helpful for commutes or a short appointment; confirm with your pediatrician which room‑temperature window they prefer you follow. Pump Types at a Glance Type Typical Use Convenience and Cost Notes Manual (lever or silicone) Occasional sessions, letdown capture, travel backup Lightweight, very portable, quiet, and simple. Often about $20.00 to $50.00. Best for short or infrequent use (La Leche League International; Cleveland Clinic). Small electric (single or some double) One to two sessions daily Battery or AC, varying noise. Typically about $50.00 to $150.00. Useful as backups or for light routines (La Leche League International). Double electric personal use Three or more sessions daily, eight‑hour separations Time‑efficient and usually quiet. Often about $200.00 to $300.00, commonly covered by insurance as a primary pump (La Leche League International; Consumer Reports). In‑bra wearable Discreet pumping on the move Highly portable and quiet under clothing; often less efficient for establishing supply and treated as an insurance upgrade (Consumer Reports). Hospital‑grade multi‑user Establishing or rebuilding supply; separation after birth Strong, consistent suction and durability. Purchases can exceed $2,000.00, so rental via hospital or DME supplier is common (Breastfeeding Center for Greater Washington; Ameda). Practical Schedules and Strategies La Leche League International suggests that when you are apart from your baby, you aim to pump every two to three hours to match a typical nursing pattern. For an eight‑hour workday, that often looks like nursing before leaving, then pumping mid‑morning, at lunch, and mid‑afternoon, followed by nursing after work. Double pumping can cut total time roughly in half, and a hands‑free bra frees your hands for a snack or to answer email. If your baby reverse cycles, sleeping more during the day and nursing more overnight after you reunite, you may reduce daytime pumping as long as your overall 24‑hour output remains stable. Keep sessions comfortable; pain stalls letdown. If you are still in the first few weeks, many experts recommend introducing bottles once breastfeeding is established, typically around four to six weeks, unless medical needs dictate earlier pumping. Safety Notes on Sharing and Secondhand Cleveland Clinic and Ameda advise never to share single‑user pumps or buy them secondhand, because backflow and microscopic residue can contaminate internal parts in a way that is not fixable with surface cleaning. Multi‑user hospital‑grade pumps, by contrast, are designed for rental with a personal kit of milk‑contact parts. Wirecutter further advises verifying that any pump you buy is listed in the U.S. FDA’s device database and to expect most opened pumps to be nonreturnable due to health and safety policies. FAQ When should I start pumping and offering a bottle? If breastfeeding is going smoothly, many clinicians suggest waiting until breastfeeding is established, often around four to six weeks, before adding regular pumping and bottle feeding. That timing helps avoid early oversupply or nipple confusion and maintains the nursing rhythm. If your baby is in the NICU, has latch challenges, or you need to protect supply immediately after birth, a hospital‑grade rental in the first days is appropriate. Guidance here is consistent with Cleveland Clinic and major lactation organizations. How often should I pump when I am away from my baby? La Leche League International recommends every two to three hours to mimic a nursing routine. For a typical eight‑hour workday, that translates to three daytime sessions, plus nursing before and after work. Double pumping saves time, and consistency protects supply. If you are exclusively pumping, include a middle‑of‑the‑night session while prolactin peaks. Are wearables enough, or do I still need a traditional pump? Wearables like Elvie are a gift for discretion and mobility, but Consumer Reports notes that they tend to be less efficient for establishing and growing supply. Many parents use a double electric to set their baseline and keep a wearable for commutes, travel days, and meetings. That combination balances efficiency with freedom. What flange size do I need, and why does it matter? The flange should match your nipple diameter and allow the nipple to move freely without rubbing. A poor fit can hurt, reduce output, and contribute to clogged ducts. Cleveland Clinic and Ameda stress reassessing size over time and even using different sizes for each breast. Many pumps include multiple sizes, and a lactation consultant can help you measure and fit. Is secondhand safe if I clean it well? Single‑user pumps should not be shared or bought secondhand, even with careful cleaning, because internal parts can harbor residue. Hospital‑grade multi‑user units are designed for rental with a personal kit. Wirecutter also encourages checking the pump’s FDA listing, and be aware that opened pumps are rarely returnable. How long can I store expressed milk? Cleveland Clinic advises refrigerating expressed milk for up to four days and freezing it for up to twelve months, with best quality if used within six months. Label every container with date and time. The FDA recommends washing and sanitizing parts as directed and breaking the vacuum seal gently before removing flanges to protect nipples. The NHS notes that capped, freshly expressed milk can sit at room temperature for four to six hours before refrigeration; discuss with your pediatrician which room‑temperature window they prefer in your situation. Takeaway Choosing a breast pump is not about chasing hype; it is about matching a tool to your life. If you need to establish supply or navigate separation, a hospital‑grade rental like Medela Symphony offers clinical‑strength reliability. For daily work pumping, a quiet, adjustable double electric such as the Spectra S1/S2 family is a proven “workhorse.” When you need compact power in a tiny body, a portable like Baby Buddha 2.0 can be a sanity saver. If discretion is king, a wearable such as Elvie frees your hands and your schedule, while a simple Haakaa silicone manual catches every drop without fuss. Layer in sound habits—correct flange fit, comfortable settings, consistent timing, and safe storage—and you will protect your supply and your peace of mind. When in doubt, lean on an IBCLC or your clinician. This is a season, and with the right support, you can make it work for you and your baby. Acknowledgments and Notes on Evidence Clinical and technique guidance in this review is informed by La Leche League International, Cleveland Clinic, Ameda, the U.S. FDA, and the NHS. Real‑world product performance and noise considerations draw on Consumer Reports and Wirecutter testing with lactating parents, including a two‑month update on Baby Buddha 2.0. Insurance and buying considerations are summarized from Consumer Reports, ByramBaby, and Wirecutter. The Haakaa silicone pump’s popularity with IBCLCs is noted by Consumer Reports, and capacity examples are based on Milkbar Breastpumps. Manufacturer‑specific features such as Medela’s two‑phase expression and the Elvie app are described as the companies present them; eufy manufacturer claims include HeatFlow technology and a reported suction up to 300 mmHg and about 46 dB operation for certain models. Where I extend advice from personal experience as a mom, I say so, and my confidence is highest where multiple reputable sources and testers align. Top comments (1) Subscribe Personal Trusted User Create template Templates let you quickly answer FAQs or store snippets for re-use. Submit Preview Dismiss Some comments may only be visible to logged-in visitors. Sign in to view all comments. Code of Conduct • Report abuse Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink . Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse Keira Smith Follow Joined Dec 2, 2025 💎 DEV Diamond Sponsors Thank you to our Diamond Sponsors for supporting the DEV Community Google AI is the official AI Model and Platform Partner of DEV Neon is the official database partner of DEV Algolia is the official search partner of DEV Parenting — A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Home About Contact Code of Conduct Privacy Policy Terms of Use Built on Forem — the open source software that powers DEV and other inclusive communities. Made with love and Ruby on Rails . Parenting © 2016 - 2026. Navigating the chaos and joy of parenting. Log in Create account | 2026-01-13T08:48:44 |
https://parenting.forem.com/petrashka/i-built-a-free-baby-tracker-that-syncs-across-devices-without-requiring-an-account-35bp#comments | I built a free baby tracker that syncs across devices without requiring an account - Parenting Forem Feed Follow new Subforems to improve your feed DEV Community Follow A space to discuss and keep up software development and manage your software career Future Follow News and discussion of science and technology such as AI, VR, cryptocurrency, quantum computing, and more. Open Forem Follow A general discussion space for the Forem community. If it doesn't have a home elsewhere, it belongs here Gamers Forem Follow An inclusive community for gaming enthusiasts Music Forem Follow From composing and gigging to gear, hot music takes, and everything in between. Vibe Coding Forem Follow Discussing AI software development, and showing off what we're building. Popcorn Movies and TV Follow Movie and TV enthusiasm, criticism and everything in-between. DUMB DEV Community Follow Memes and software development shitposting Design Community Follow Web design, graphic design and everything in-between Security Forem Follow Your central hub for all things security. From ethical hacking and CTFs to GRC and career development, for beginners and pros alike Golf Forem Follow A community of golfers and golfing enthusiasts Crypto Forem Follow A collaborative community for all things Crypto—from Bitcoin to protocol development and DeFi to NFTs and market analysis. Parenting Follow A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Forem Core Follow Discussing the core forem open source software project — features, bugs, performance, self-hosting. Maker Forem Follow A community for makers, hobbyists, and professionals to discuss Arduino, Raspberry Pi, 3D printing, and much more. HMPL.js Forem Follow For developers using HMPL.js to build fast, lightweight web apps. A space to share projects, ask questions, and discuss server-driven templating Dropdown menu Dropdown menu Skip to content Navigation menu Search Powered by Algolia Search Log in Create account Parenting Close Add reaction Like Unicorn Exploding Head Raised Hands Fire Jump to Comments Save Boost More... Copy link Copy link Copied to Clipboard Share to X Share to LinkedIn Share to Facebook Share to Mastodon Share Post via... Report Abuse Siarhei Posted on Dec 1, 2025 I built a free baby tracker that syncs across devices without requiring an account # dadlife # newparents Hey everyone! I recently became a dad, and let me tell you - nobody warns you about the logistics nightmare that comes with a newborn. The Problem First few days home, we tried tracking everything on paper. Feeding times, which breast, how long, diaper changes, sleep... The notebook quickly became an unreadable mess. Then came the constant texts between me and my wife: "When did you last feed her?" "Which side?" "Did you change her?" "How long has she been sleeping?" We tried existing baby tracker apps. One wanted us to create accounts and verify emails - not happening at 3 AM with a screaming baby. Another had half the features locked behind a $10/month subscription. A third one had sync, but required both of us to sign up separately and then somehow "connect" our accounts through a confusing process. I just wanted something simple. Log stuff. Share with my wife. That's it. The Solution (That Grew Into Something More) So I built a quick app for myself. Just feedings at first - tap, log, done. Shared it with my wife through a simple sync key. Then we needed sleep tracking. Added that. Then diapers. Then weight for doctor visits. Then a timer because we kept forgetting when the feeding started. Then dark mode because I blinded myself one too many times at night. Two months later, that "quick app" became Zaspa - a full baby tracker that actually solves the problems we had. What Makes It Different No accounts, no passwords, no BS - You generate a random sync key, text it to your partner, they enter it, done. You're both tracking the same baby in real-time. No email verification, no "forgot password", no account management. Your data stays anonymous on our servers - we don't store baby names or any personal info. Actually works at 3 AM - Big buttons, one-handed operation, minimal steps to log anything. When you're half-asleep holding a baby, you don't want to navigate through menus. Fix mistakes easily - Forgot to log a feeding an hour ago? Just adjust the timestamp. Started the timer late? Edit the start time. Life with a newborn is messy, the app handles that. Key Features for Parents Feeding tracker - Breastfeeding with side switching, formula with amounts, solid foods when you get there. Built-in timer so you don't have to watch the clock. Sleep tracker - Log naps and night sleep. Timer for real-time tracking. Helps you spot patterns in your baby's schedule (if they have one). Diaper log - Quick taps for wet/dirty. Simple but important for making sure baby is eating enough. Growth tracking - Weight and height over time. Have real data ready when the pediatrician asks "how's the weight gain?" Activity log - Walks, baths, tummy time, medicine, pumping. Notes on everything. Excel export - Generate spreadsheets for doctor visits. No more "I think she ate around... maybe 6 times yesterday?" Multiple kids - Twins? Toddler and newborn? Separate profiles for each. Dark mode - Your eyes will thank you. 6 languages - English, Spanish, German, Ukrainian, Belarusian, Polish. Completely Free No ads. No premium tier. No subscriptions. I built this because my family needed it, and I figured other parents might too. Try It https://zaspa.online/ Works on iOS, Android. Your data is encrypted and private. You can disconnect sync anytime and keep everything local. Would love to hear from other parents - what's missing? What would make this actually useful for your situation? Thanks for checking it out! Top comments (1) Subscribe Personal Trusted User Create template Templates let you quickly answer FAQs or store snippets for re-use. Submit Preview Dismiss Some comments may only be visible to logged-in visitors. Sign in to view all comments. Code of Conduct • Report abuse Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink . Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse Siarhei Follow Joined Nov 19, 2023 💎 DEV Diamond Sponsors Thank you to our Diamond Sponsors for supporting the DEV Community Google AI is the official AI Model and Platform Partner of DEV Neon is the official database partner of DEV Algolia is the official search partner of DEV Parenting — A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Home About Contact Code of Conduct Privacy Policy Terms of Use Built on Forem — the open source software that powers DEV and other inclusive communities. Made with love and Ruby on Rails . Parenting © 2016 - 2026. Navigating the chaos and joy of parenting. Log in Create account | 2026-01-13T08:48:44 |
https://parenting.forem.com/keirasmith5 | Keira Smith - Parenting Forem Feed Follow new Subforems to improve your feed DEV Community Follow A space to discuss and keep up software development and manage your software career Future Follow News and discussion of science and technology such as AI, VR, cryptocurrency, quantum computing, and more. Open Forem Follow A general discussion space for the Forem community. If it doesn't have a home elsewhere, it belongs here Gamers Forem Follow An inclusive community for gaming enthusiasts Music Forem Follow From composing and gigging to gear, hot music takes, and everything in between. Vibe Coding Forem Follow Discussing AI software development, and showing off what we're building. Popcorn Movies and TV Follow Movie and TV enthusiasm, criticism and everything in-between. DUMB DEV Community Follow Memes and software development shitposting Design Community Follow Web design, graphic design and everything in-between Security Forem Follow Your central hub for all things security. From ethical hacking and CTFs to GRC and career development, for beginners and pros alike Golf Forem Follow A community of golfers and golfing enthusiasts Crypto Forem Follow A collaborative community for all things Crypto—from Bitcoin to protocol development and DeFi to NFTs and market analysis. Parenting Follow A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Forem Core Follow Discussing the core forem open source software project — features, bugs, performance, self-hosting. Maker Forem Follow A community for makers, hobbyists, and professionals to discuss Arduino, Raspberry Pi, 3D printing, and much more. HMPL.js Forem Follow For developers using HMPL.js to build fast, lightweight web apps. A space to share projects, ask questions, and discuss server-driven templating Dropdown menu Dropdown menu Skip to content Navigation menu Search Powered by Algolia Search Log in Create account Parenting Close Follow User actions Keira Smith 404 bio not found Joined Joined on Dec 2, 2025 More info about @keirasmith5 Badges Writing Debut Awarded for writing and sharing your first DEV post! Continue sharing your work to earn the 4 Week Writing Streak Badge. Got it Close Post 1 post published Comment 0 comments written Tag 0 tags followed Top 5 Breast Pumps for 2025: Soft, Practical & Tested by Real Moms Keira Smith Keira Smith Keira Smith Follow Dec 3 '25 Top 5 Breast Pumps for 2025: Soft, Practical & Tested by Real Moms # babygear # newparents Comments 1 comment 18 min read loading... 💎 DEV Diamond Sponsors Thank you to our Diamond Sponsors for supporting the DEV Community Google AI is the official AI Model and Platform Partner of DEV Neon is the official database partner of DEV Algolia is the official search partner of DEV Parenting — A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Home About Contact Code of Conduct Privacy Policy Terms of Use Built on Forem — the open source software that powers DEV and other inclusive communities. Made with love and Ruby on Rails . Parenting © 2016 - 2026. Navigating the chaos and joy of parenting. Log in Create account | 2026-01-13T08:48:44 |
https://docs.devcycle.com/platform/feature-flags/status-and-lifecycle#moving-a-feature-to-completed | Status and Lifecycle | DevCycle Docs Skip to main content Home SDKs APIs Management API Bucketing API Integrations CLI / MCP Best Practices Community Blog Discord Search Sign Up Home Getting Started Essentials DevCycle Overview Key Features System Architecture Feature Hierarchy Feature Types Platform Feature Flags Features Variables and Variations Targeting Status and Lifecycle Stale Feature Notifications Experimentation Account Management Security and Guardrails Testing and QA Extras Examples Platform Feature Flags Status and Lifecycle On this page Feature Status and Lifecycle Management In DevCycle, Features have Statuses that indicate their current position in the feature lifecycle. Statuses provide a clear, at-a-glance understanding of where a Feature is in its development, release, and cleanup process. Each Status belongs to a Status Category , which defines how the Feature behaves, what actions are allowed, and how it is displayed across the dashboard. Statuses Every Feature in DevCycle always has one Status , which determines its lifecycle stage. By default, DevCycle provides a set of predefined Statuses aligned to core lifecycle categories. The default Statuses are: Development Live Completed Archived In addition to the default Statuses, teams can define custom Statuses within their Project settings. This allows teams to better align Feature lifecycle tracking with their internal development and release processes while preserving DevCycle's lifecycle guarantees. Each custom Status inherits the behavior of their Category. Status changes are not automatic and are always managed explicitly by the user. Status Categories Statuses are grouped into Categories , which define shared lifecycle behavior. Development This Category represents Features that are actively being built, tested, or prepared for release. By default, new Features are created with the Development Status. While a Feature is in Development, all Targeting rules and Variations remain editable. This stage is typically used while work is ongoing and before a Feature is considered ready for a broader release. Below are some examples of different Statuses that would make sense in the Development Category: In Development Pending Design QA Internal Testing Live The Live Category represents Features that are actively running in production or being exposed to users. While a Feature is Live, all Targeting rules and Variations remain editable. Below are some examples of different Statuses that would make sense in the Live Category: Beta Ramping In Production Live Experiment Completed The Completed Category represents Features that have reached the end of active development and rollout. A Feature may be considered Completed once it has been tested, approved, and is fully released, or when no further targeting changes are expected. When a Feature is moved into a Status within the Completed Category, it enters a semi-read-only state : A single final (release) Variation must be selected All Environments will serve this Variation to all users Targeting rules are replaced with an "All users" rule New targeting rules and Variations cannot be added Variable values may still be edited Environments can still be toggled on or off When using the CLI to generate TypeScript types, Variables belonging to a Feature in the Completed Category will be marked as deprecated . Below are some examples of different Statuses that would make sense in the Completed Category: Ready for Cleanup All Users Enabled Stable Release Cleanup Checklist Upon entering a Completed Status, a cleanup checklist is shown for each Variable associated with the Feature. This checklist helps teams determine when it is safe to remove Variables from their codebase or archive them. If a Variable is still referenced in code or evaluated in production, removing it may result in default values being served. If Code References are enabled, additional context will be provided to assist with cleanup. Archived The Archived Category represents the terminal lifecycle state for Features. This Category and Status cannot be edited or changed. A Feature should be archived once it has been fully cleaned up and its Variables have been removed from the codebase. When a Feature is Archived: It becomes fully read-only It is hidden from standard dashboard views Audit Logs remain accessible for historical reference Metrics & Reach data will not be visible on the dashboard for Archived features Archiving Features helps keep both your dashboard and codebase clean while preserving valuable lifecycle history. Note: Feature deletion still exists, but should only be used for mistakes. Deleting a Feature permanently removes it and its Audit Log. Archived Features retain historical data that may be used for future reporting and analysis. Changing Status Moving a Feature to Completed When a Feature is moved into the Completed Category: A final Variation must be selected All Environments serve that Variation to all users Existing Environment statuses are preserved Targeting rules are replaced with a single "All users" rule Additional Variations and targeting rules are locked Reverting to Development or Live Features in the Completed Category can be reverted back to an earlier Status. When reverting: Previous Variations become available again Changes made to Variable values while Completed are retained Prior targeting rules are not restored and must be reconfigured Viewing Features by Status (Kanban View) On the Feature list page, users can switch between a List view and a Kanban-style view that displays Features grouped by their current Status, allowing teams to quickly visualize progress across the Feature lifecycle. In this view: Each column represents a Feature Status Each column header includes a total count of Features in each Status Features appear as cards within the column matching their current Status, and can be sorted differently by selected criteria Columns are ordered based on the Status order defined in Project Settings Status colors are reflected in the column headers for quick visual scanning This view is intended for high-level lifecycle tracking and workflow management. Selecting a Feature card opens the Feature detail view for configuration, targeting, and Variable management. Managing Statuses Statuses are managed at the Project level and apply to all Features within that Project. Each Project starts with a default set of Statuses aligned to DevCycle's lifecycle categories. Teams may customize these Statuses to better reflect their internal workflows. Project Settings Statuses can be viewed and managed from the Project Settings page under the Feature Statuses section. From this page, users can: View all Statuses grouped by Category Create new custom Statuses within supported Categories Edit existing Status names (Note: each Status must have a unique key) Reorder Statuses within a Category Assign colors to Statuses for quick visual identification Add a description to provide context behind what a Status represents Select the default Status applied when a new Feature is created Changes made in Project Settings take effect immediately and apply across the Project. Status Categories and Rules Statuses must belong to one of DevCycle's predefined Categories. The following rules apply: New Categories cannot be created Each Category must contain at least one Status The last remaining Status in a Category cannot be deleted Status labels and ordering within a Category can be modified Permissions for Status Changes Permission Rules When permissions are enabled: Statuses in the Development and Live Categories can be applied by any user with access to the Project Statuses in the Completed and Archived Categories can only be applied by users with the Publisher permission Only Publishers can create, and modify Feature Statuses in the Project Settings Edit this page Last updated on Jan 9, 2026 Previous EdgeDB (Stored Custom Properties) Next Stale Feature Notifications Statuses Status Categories Development Live Completed Archived Changing Status Moving a Feature to Completed Reverting to Development or Live Viewing Features by Status (Kanban View) Managing Statuses Project Settings Permissions for Status Changes DevCycle Dashboard Blog Privacy Policy Twitter Discord GitHub Copyright © 2026 DevCycle. All rights reserved. | 2026-01-13T08:48:44 |
https://porkbun.com/ | porkbun.com | An oddly satisfying experience. Toggle navigation porkbun $0.00 (0) products Domains Transfers Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting All Web Hosting Options Easy WordPress Link In Bio Articulation Sitebuilder Cloud WordPress Shared cPanel Hosting Static Hosting Website Builder Easy PHP Email Hosting All Email Hosting Options Proton Mail Porkbun Email Free Email Forwarding Marketing Tools Textla - SMS Marketing Free WHOIS Privacy Free SSL Certificates Free URL Forwarding transfer Free WordPress SALE! .COM SALE! About --> About Who We Are Why Choose Porkbun Porkbun vs Cloudflare FAQs Resources Knowledge Base Porkbun Blog Service Status Help $0.00 (0) sign in An oddly satisfying experience. 3+ million domains managed by 500K+ customers , who clearly have good taste. bulk search Uh oh! Domain List TLD Selection Enter one domain per line in the box above. You can search for a maximum of 100 domains at a time. Enter a single SLD in the box above and select the TLDs to search below. You can select a maximum of 100 TLDs. abogado ac ac.nz academy accountant accountants actor adult ae.org ag agency ai airforce am apartments app archi army art as asia associates attorney auction audio auto autos baby band bar bargains basketball bayern beauty beer best bet bh bible bid bike bingo bio biz biz.pr black blackfriday blog blue boats bond boo boston bot boutique br.com broker build builders business buzz bz ca cab cafe cam camera camp capital car cards care careers cars casa cash casino catering cc center ceo cfd channel charity chat cheap christmas church city claims cleaning click clinic clothing cloud club club.tw cn.com co co.ag co.bz co.com co.gg co.in co.je co.lc co.nz co.uk coach codes coffee college com com.ag com.ai com.bz com.de com.lc com.mx com.ph com.pr com.sc com.se com.vc community company compare computer condos construction consulting contact contractors cooking cool country coupons courses credit creditcard cricket cruises cv cx cymru cyou dad dance date dating day de de.com deal dealer deals degree delivery democrat dental dentist desi design dev diamonds diet digital direct directory discount diy doctor dog domains download earth ebiz.tw eco education email energy engineer engineering enterprises equipment esq estate eu eu.com events exchange expert exposed express fail faith family fan fans farm fashion fast feedback finance financial firm.in fish fishing fit fitness flights florist flowers fly fm fo foo food football forex forsale forum foundation free fun fund furniture futbol fyi gallery game game.tw games garden gay gb.net geek.nz gen.in gen.nz gg gift gifts gives giving glass global gmbh gold golf gr.com graphics gratis green gripe group guide guitars guru hair haus health healthcare help hiphop hiv hockey holdings holiday homes horse hospital host hosting hot house how hu.net icu id immo immobilien in in.net inc ind.in industries info info.pr ing ink institute insure international investments io irish isla.pr it.com je jetzt jewelry jobs jp.net jpn.com juegos kaufen kids kim kitchen kiwi.nz kyoto l.lc la land lat law lawyer lc lease legal lgbt life lifestyle lighting limited limo link live living llc loan loans lol london lotto love ltd ltda luxe luxury maison makeup management maori.nz market marketing markets mba me me.uk med media melbourne meme memorial men menu mex.com miami mn mobi moda moe moi mom money monster mortgage motorcycles mov movie mu music mx my nagoya name name.pr navy net net.ag net.ai net.bz net.gg net.in net.je net.lc net.nz net.ph net.pr net.vc network new news nexus ngo ninja nl nom.ag now nrw nyc nz observer off.ai one ong onl online ooo org org.ag org.ai org.bz org.gg org.in org.je org.lc org.mx org.nz org.ph org.pr org.sc org.uk org.vc organic osaka p.lc page partners parts party pet ph phd photo photography photos pics pictures pink pizza place plumbing plus poker porn pr press pro pro.pr productions prof promo properties property protection pub pw qpon quest racing radio.am radio.fm realty recipes red rehab reise reisen rent rentals repair report republican rest restaurant review reviews rich rip rocks rodeo rsvp ru.com rugby run sa.com saarland sale salon sarl sbs sc school school.nz schule science se.net security select services sex sexy sh shiksha shoes shop shopping show singles site ski skin soccer social software solar solutions soy spa space spot srl storage store stream studio study style sucks supplies supply support surf surgery sydney systems taipei talk tattoo tax taxi team tech technology tel tennis theater theatre tickets tienda tips tires tm to today tokyo tools top tours town toys trade trading training travel tube tv tw uk uk.com uk.net university uno us us.com us.org vacations vana vc vegas ventures vet viajes video villas vin vip vision vodka vote voto voyage wales wang watch watches webcam website wedding wiki win wine work works world ws wtf xn--5tzm5g xn--6frz82g xn--czrs0t xn--fjq720a xn--q9jyb4c xn--unup4y xn--vhquv xxx xyz yachts yoga yokohama you za.com zip zone Add available domains to the cart. 100 max. .COM from $11.08 .INC from $257.98 .XYZ from $2.04 .ONE from $2.57 Ranked #1 2023, 2024 & 2025 Ranked #1 2025 Trustpilot 4.8 stars 1,700+ reviews All-In-One Domain Management Tools Domains Named the #1 domain registrar by USA Today. We offer lower prices on domain registrations and renewals. Get Domain Web Hosting With Cloud WordPress, Articulation Sitebuilder, a link in bio tool, and multiple cPanel hosting options; our hosting plans have you covered. Learn More Email Hosting Look professional with email hosting. Only $2/month per inbox, billed annually. Compare to $8/month elsewhere. Learn More Transfer Paying too much? Transfer your domain to Porkbun and get the best multi-year value. Transfer Now Save Money With Free Domain Features These premium features come free with every Porkbun domain. Free WHOIS Privacy Keep your private contact information hidden from prying eyes with our WHOIS privacy service. Most registrars charge for this service; we believe your privacy shouldn't come at a price. Learn More Free SSL Certificates Security is important and that's why we offer Let's Encrypt SSL certificates at no charge for all supported domains. We'll even auto renew them for you! Learn More URL Forwarding Quickly and easily point your domain somewhere else with free URL Forwarding. Our URL Forwarder supports permanent, temporary, and masked forwards. Learn More Email Forwarding Give your online presence a more professional feel with up to 20 free email forwards. Learn More Cloudflare DNS Management With free DNS management powered by Cloudflare, you can rest easy knowing your site's DNS will be robust and available. Learn More You're In Good Hooves We are the highest-rated domain name registrar on Trustpilot, as reviewed by real customers. Trustpilot We Stand Behind You Phone Support Tired of talking to an automated system? At Porkbun, the first person you speak to is a knowledgeable domain expert on our support team. 1.855.PORKBUN (1.855.767.5286) 9AM - 5PM Pacific Time Other Hours: Your mileage may vary, but give it a whirl Call Us. Maybe? Knowledge Base Want to find the answers on your own? Check out our extensive knowledge base of how-to articles, instructions, guides, and tutorials. We walk you through how to perform essential tasks like transferring your domain or setting up a custom email address. Visit Knowledge Base Email and Chat Prefer to write out your questions? Get a handcrafted response from a real person. Contact Us × Modal Title Close Close × Modal Title Close porkbun Porkbun is an amazingly awesome ICANN accredited domain name registrar based out of the Pacific Northwest. We're different, we're easy, and we're affordable. Use us, you won't be sorry. If you don't use us we'll be sad, but we'll still love you. Get Pork-Puns In Your Inbox Stay in the loop on all things Porkbun by signing up for our newsletter! 21370 SW Langer Farms Parkway, Suite 142-429 Sherwood, OR 97140, US If you're looking for support, you might be able to answer your own question using our Knowledge Base . Support Hours Impacted From January 3rd to January 11th we will be holding our annual company summit which will impact live and after hours support. Our goal is to provide you with an excellent domain registration experience and support and we all appreciate your patience as the whole company works together to make Porkbun even better. Thank you. Reach our USA-Based phone support team: 1.855.PORKBUN (1.855.767.5286) 9AM - 5PM Pacific Time Other Hours: Your mileage may vary, but give it a whirl support@porkbun.com 24 / 7 Email Support Chat Support Hours Vary Your browser does not support the audio element. This plays a little Porkbun jingle. Stay up to date with Porkbun. Sign up for our cool newsletter and we'll keep you up to date with sweet deals, amazing info, and maybe even the occasional limerick or sonnet. Sign Up Products Domain Names Greatest Deals Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting Link In Bio Articulation Sitebuilder Cloud WordPress cPanel Hosting Static Hosting Easy PHP Website Builder Email Hosting WHOIS Privacy DNS Management SSL Certificates Email Forwarding URL Forwarding Quick Connect Domain Transfer Affiliate Program Handshake Names Ethereum Name Service International Domain Names API Access Support Contact Us Knowledge Base Payment Options Report Abuse Tools Domain Search Domain Suggestion Generator RDAP (WHOIS) Password Generator Service Status Don't like our name? The Buniverse Your IP Address Online DNS Lookup Our Company About Us Our Official Blog Careers Branding Guidelines Policies and Legal Privacy Policy Data Disclosure Policy Bug Bounty Program Porkbun Merchandise Awesomeness Copyright © Porkbun LLC. All rights reserved. Porkbun is a Top Level Design Company Made in the USA 🇺🇸 This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. WARNING: This site has been known to cause a mind blowing experience. We recommend you prepare yourself mentally and if possible be sitting down. Side effects may include saving money, letting out a chuckle, and sporadic oinking. 1 × Modal Title Cancel Continue | 2026-01-13T08:48:44 |
https://github.com/GoogleChromeLabs/squoosh | GitHub - GoogleChromeLabs/squoosh: Make images smaller using best-in-class codecs, right in the browser. Skip to content Navigation Menu Toggle navigation Sign in Appearance settings Platform AI CODE CREATION GitHub Copilot Write better code with AI GitHub Spark Build and deploy intelligent apps GitHub Models Manage and compare prompts MCP Registry New Integrate external tools DEVELOPER WORKFLOWS Actions Automate any workflow Codespaces Instant dev environments Issues Plan and track work Code Review Manage code changes APPLICATION SECURITY GitHub Advanced Security Find and fix vulnerabilities Code security Secure your code as you build Secret protection Stop leaks before they start EXPLORE Why GitHub Documentation Blog Changelog Marketplace View all features Solutions BY COMPANY SIZE Enterprises Small and medium teams Startups Nonprofits BY USE CASE App Modernization DevSecOps DevOps CI/CD View all use cases BY INDUSTRY Healthcare Financial services Manufacturing Government View all industries View all solutions Resources EXPLORE BY TOPIC AI Software Development DevOps Security View all topics EXPLORE BY TYPE Customer stories Events & webinars Ebooks & reports Business insights GitHub Skills SUPPORT & SERVICES Documentation Customer support Community forum Trust center Partners Open Source COMMUNITY GitHub Sponsors Fund open source developers PROGRAMS Security Lab Maintainer Community Accelerator Archive Program REPOSITORIES Topics Trending Collections Enterprise ENTERPRISE SOLUTIONS Enterprise platform AI-powered developer platform AVAILABLE ADD-ONS GitHub Advanced Security Enterprise-grade security features Copilot for Business Enterprise-grade AI features Premium Support Enterprise-grade 24/7 support Pricing Search or jump to... Search code, repositories, users, issues, pull requests... --> Search Clear Search syntax tips Provide feedback --> We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly --> Name Query To see all available qualifiers, see our documentation . Cancel Create saved search Sign in Sign up Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} GoogleChromeLabs / squoosh Public Notifications You must be signed in to change notification settings Fork 1.8k Star 24.6k Make images smaller using best-in-class codecs, right in the browser. squoosh.app License Apache-2.0 license 24.6k stars 1.8k forks Branches Tags Activity Star Notifications You must be signed in to change notification settings Code Issues 148 Pull requests 91 Actions Projects 0 Wiki Security Uh oh! There was an error while loading. Please reload this page . Insights Additional navigation options Code Issues Pull requests Actions Projects Wiki Security Insights GoogleChromeLabs/squoosh dev Branches Tags Go to file Code Open more actions menu Folders and files Name Name Last commit message Last commit date Latest commit History 1,472 Commits .github .github .husky .husky codecs codecs lib lib src src .clang-format .clang-format .editorconfig .editorconfig .gitattributes .gitattributes .gitignore .gitignore .nvmrc .nvmrc .prettierignore .prettierignore .prettierrc.json .prettierrc.json CONTRIBUTING.md CONTRIBUTING.md LICENSE LICENSE README.md README.md client-tsconfig.json client-tsconfig.json emscripten-types.d.ts emscripten-types.d.ts generic-tsconfig.json generic-tsconfig.json icon-large-maskable.png icon-large-maskable.png missing-types.d.ts missing-types.d.ts package-lock.json package-lock.json package.json package.json renovate.json renovate.json rollup.config.js rollup.config.js serve.json serve.json static-build-tsconfig.json static-build-tsconfig.json tsconfig.json tsconfig.json worker-tsconfig.json worker-tsconfig.json View all files Repository files navigation README Contributing Apache-2.0 license Squoosh ! Squoosh is an image compression web app that reduces image sizes through numerous formats. Privacy Squoosh does not send your image to a server. All image compression processes locally. However, Squoosh utilizes Google Analytics to collect the following: Basic visitor data . The before and after image size value. If Squoosh PWA, the type of Squoosh installation. If Squoosh PWA, the installation time and date. Developing To develop for Squoosh: Clone the repository To install node packages, run: npm install Then build the app by running: npm run build After building, start the development server by running: npm run dev Contributing Squoosh is an open-source project that appreciates all community involvement. To contribute to the project, follow the contribute guide . About Make images smaller using best-in-class codecs, right in the browser. squoosh.app Resources Readme License Apache-2.0 license Contributing Contributing Uh oh! There was an error while loading. Please reload this page . Activity Custom properties Stars 24.6k stars Watchers 241 watching Forks 1.8k forks Report repository Releases 27 tags Packages 0 No packages published Uh oh! There was an error while loading. Please reload this page . Contributors 67 Uh oh! There was an error while loading. Please reload this page . + 53 contributors Languages TypeScript 62.2% JavaScript 10.1% C++ 9.6% CSS 8.9% Makefile 4.0% Rust 3.2% Other 2.0% Footer © 2026 GitHub, Inc. Footer navigation Terms Privacy Security Status Community Docs Contact Manage cookies Do not share my personal information You can’t perform that action at this time. | 2026-01-13T08:48:44 |
https://docs.devcycle.com/platform/feature-flags/status-and-lifecycle#permission-rules | Status and Lifecycle | DevCycle Docs Skip to main content Home SDKs APIs Management API Bucketing API Integrations CLI / MCP Best Practices Community Blog Discord Search Sign Up Home Getting Started Essentials DevCycle Overview Key Features System Architecture Feature Hierarchy Feature Types Platform Feature Flags Features Variables and Variations Targeting Status and Lifecycle Stale Feature Notifications Experimentation Account Management Security and Guardrails Testing and QA Extras Examples Platform Feature Flags Status and Lifecycle On this page Feature Status and Lifecycle Management In DevCycle, Features have Statuses that indicate their current position in the feature lifecycle. Statuses provide a clear, at-a-glance understanding of where a Feature is in its development, release, and cleanup process. Each Status belongs to a Status Category , which defines how the Feature behaves, what actions are allowed, and how it is displayed across the dashboard. Statuses Every Feature in DevCycle always has one Status , which determines its lifecycle stage. By default, DevCycle provides a set of predefined Statuses aligned to core lifecycle categories. The default Statuses are: Development Live Completed Archived In addition to the default Statuses, teams can define custom Statuses within their Project settings. This allows teams to better align Feature lifecycle tracking with their internal development and release processes while preserving DevCycle's lifecycle guarantees. Each custom Status inherits the behavior of their Category. Status changes are not automatic and are always managed explicitly by the user. Status Categories Statuses are grouped into Categories , which define shared lifecycle behavior. Development This Category represents Features that are actively being built, tested, or prepared for release. By default, new Features are created with the Development Status. While a Feature is in Development, all Targeting rules and Variations remain editable. This stage is typically used while work is ongoing and before a Feature is considered ready for a broader release. Below are some examples of different Statuses that would make sense in the Development Category: In Development Pending Design QA Internal Testing Live The Live Category represents Features that are actively running in production or being exposed to users. While a Feature is Live, all Targeting rules and Variations remain editable. Below are some examples of different Statuses that would make sense in the Live Category: Beta Ramping In Production Live Experiment Completed The Completed Category represents Features that have reached the end of active development and rollout. A Feature may be considered Completed once it has been tested, approved, and is fully released, or when no further targeting changes are expected. When a Feature is moved into a Status within the Completed Category, it enters a semi-read-only state : A single final (release) Variation must be selected All Environments will serve this Variation to all users Targeting rules are replaced with an "All users" rule New targeting rules and Variations cannot be added Variable values may still be edited Environments can still be toggled on or off When using the CLI to generate TypeScript types, Variables belonging to a Feature in the Completed Category will be marked as deprecated . Below are some examples of different Statuses that would make sense in the Completed Category: Ready for Cleanup All Users Enabled Stable Release Cleanup Checklist Upon entering a Completed Status, a cleanup checklist is shown for each Variable associated with the Feature. This checklist helps teams determine when it is safe to remove Variables from their codebase or archive them. If a Variable is still referenced in code or evaluated in production, removing it may result in default values being served. If Code References are enabled, additional context will be provided to assist with cleanup. Archived The Archived Category represents the terminal lifecycle state for Features. This Category and Status cannot be edited or changed. A Feature should be archived once it has been fully cleaned up and its Variables have been removed from the codebase. When a Feature is Archived: It becomes fully read-only It is hidden from standard dashboard views Audit Logs remain accessible for historical reference Metrics & Reach data will not be visible on the dashboard for Archived features Archiving Features helps keep both your dashboard and codebase clean while preserving valuable lifecycle history. Note: Feature deletion still exists, but should only be used for mistakes. Deleting a Feature permanently removes it and its Audit Log. Archived Features retain historical data that may be used for future reporting and analysis. Changing Status Moving a Feature to Completed When a Feature is moved into the Completed Category: A final Variation must be selected All Environments serve that Variation to all users Existing Environment statuses are preserved Targeting rules are replaced with a single "All users" rule Additional Variations and targeting rules are locked Reverting to Development or Live Features in the Completed Category can be reverted back to an earlier Status. When reverting: Previous Variations become available again Changes made to Variable values while Completed are retained Prior targeting rules are not restored and must be reconfigured Viewing Features by Status (Kanban View) On the Feature list page, users can switch between a List view and a Kanban-style view that displays Features grouped by their current Status, allowing teams to quickly visualize progress across the Feature lifecycle. In this view: Each column represents a Feature Status Each column header includes a total count of Features in each Status Features appear as cards within the column matching their current Status, and can be sorted differently by selected criteria Columns are ordered based on the Status order defined in Project Settings Status colors are reflected in the column headers for quick visual scanning This view is intended for high-level lifecycle tracking and workflow management. Selecting a Feature card opens the Feature detail view for configuration, targeting, and Variable management. Managing Statuses Statuses are managed at the Project level and apply to all Features within that Project. Each Project starts with a default set of Statuses aligned to DevCycle's lifecycle categories. Teams may customize these Statuses to better reflect their internal workflows. Project Settings Statuses can be viewed and managed from the Project Settings page under the Feature Statuses section. From this page, users can: View all Statuses grouped by Category Create new custom Statuses within supported Categories Edit existing Status names (Note: each Status must have a unique key) Reorder Statuses within a Category Assign colors to Statuses for quick visual identification Add a description to provide context behind what a Status represents Select the default Status applied when a new Feature is created Changes made in Project Settings take effect immediately and apply across the Project. Status Categories and Rules Statuses must belong to one of DevCycle's predefined Categories. The following rules apply: New Categories cannot be created Each Category must contain at least one Status The last remaining Status in a Category cannot be deleted Status labels and ordering within a Category can be modified Permissions for Status Changes Permission Rules When permissions are enabled: Statuses in the Development and Live Categories can be applied by any user with access to the Project Statuses in the Completed and Archived Categories can only be applied by users with the Publisher permission Only Publishers can create, and modify Feature Statuses in the Project Settings Edit this page Last updated on Jan 9, 2026 Previous EdgeDB (Stored Custom Properties) Next Stale Feature Notifications Statuses Status Categories Development Live Completed Archived Changing Status Moving a Feature to Completed Reverting to Development or Live Viewing Features by Status (Kanban View) Managing Statuses Project Settings Permissions for Status Changes DevCycle Dashboard Blog Privacy Policy Twitter Discord GitHub Copyright © 2026 DevCycle. All rights reserved. | 2026-01-13T08:48:44 |
https://docs.devcycle.com/platform/feature-flags/status-and-lifecycle#reverting-to-development-or-live | Status and Lifecycle | DevCycle Docs Skip to main content Home SDKs APIs Management API Bucketing API Integrations CLI / MCP Best Practices Community Blog Discord Search Sign Up Home Getting Started Essentials DevCycle Overview Key Features System Architecture Feature Hierarchy Feature Types Platform Feature Flags Features Variables and Variations Targeting Status and Lifecycle Stale Feature Notifications Experimentation Account Management Security and Guardrails Testing and QA Extras Examples Platform Feature Flags Status and Lifecycle On this page Feature Status and Lifecycle Management In DevCycle, Features have Statuses that indicate their current position in the feature lifecycle. Statuses provide a clear, at-a-glance understanding of where a Feature is in its development, release, and cleanup process. Each Status belongs to a Status Category , which defines how the Feature behaves, what actions are allowed, and how it is displayed across the dashboard. Statuses Every Feature in DevCycle always has one Status , which determines its lifecycle stage. By default, DevCycle provides a set of predefined Statuses aligned to core lifecycle categories. The default Statuses are: Development Live Completed Archived In addition to the default Statuses, teams can define custom Statuses within their Project settings. This allows teams to better align Feature lifecycle tracking with their internal development and release processes while preserving DevCycle's lifecycle guarantees. Each custom Status inherits the behavior of their Category. Status changes are not automatic and are always managed explicitly by the user. Status Categories Statuses are grouped into Categories , which define shared lifecycle behavior. Development This Category represents Features that are actively being built, tested, or prepared for release. By default, new Features are created with the Development Status. While a Feature is in Development, all Targeting rules and Variations remain editable. This stage is typically used while work is ongoing and before a Feature is considered ready for a broader release. Below are some examples of different Statuses that would make sense in the Development Category: In Development Pending Design QA Internal Testing Live The Live Category represents Features that are actively running in production or being exposed to users. While a Feature is Live, all Targeting rules and Variations remain editable. Below are some examples of different Statuses that would make sense in the Live Category: Beta Ramping In Production Live Experiment Completed The Completed Category represents Features that have reached the end of active development and rollout. A Feature may be considered Completed once it has been tested, approved, and is fully released, or when no further targeting changes are expected. When a Feature is moved into a Status within the Completed Category, it enters a semi-read-only state : A single final (release) Variation must be selected All Environments will serve this Variation to all users Targeting rules are replaced with an "All users" rule New targeting rules and Variations cannot be added Variable values may still be edited Environments can still be toggled on or off When using the CLI to generate TypeScript types, Variables belonging to a Feature in the Completed Category will be marked as deprecated . Below are some examples of different Statuses that would make sense in the Completed Category: Ready for Cleanup All Users Enabled Stable Release Cleanup Checklist Upon entering a Completed Status, a cleanup checklist is shown for each Variable associated with the Feature. This checklist helps teams determine when it is safe to remove Variables from their codebase or archive them. If a Variable is still referenced in code or evaluated in production, removing it may result in default values being served. If Code References are enabled, additional context will be provided to assist with cleanup. Archived The Archived Category represents the terminal lifecycle state for Features. This Category and Status cannot be edited or changed. A Feature should be archived once it has been fully cleaned up and its Variables have been removed from the codebase. When a Feature is Archived: It becomes fully read-only It is hidden from standard dashboard views Audit Logs remain accessible for historical reference Metrics & Reach data will not be visible on the dashboard for Archived features Archiving Features helps keep both your dashboard and codebase clean while preserving valuable lifecycle history. Note: Feature deletion still exists, but should only be used for mistakes. Deleting a Feature permanently removes it and its Audit Log. Archived Features retain historical data that may be used for future reporting and analysis. Changing Status Moving a Feature to Completed When a Feature is moved into the Completed Category: A final Variation must be selected All Environments serve that Variation to all users Existing Environment statuses are preserved Targeting rules are replaced with a single "All users" rule Additional Variations and targeting rules are locked Reverting to Development or Live Features in the Completed Category can be reverted back to an earlier Status. When reverting: Previous Variations become available again Changes made to Variable values while Completed are retained Prior targeting rules are not restored and must be reconfigured Viewing Features by Status (Kanban View) On the Feature list page, users can switch between a List view and a Kanban-style view that displays Features grouped by their current Status, allowing teams to quickly visualize progress across the Feature lifecycle. In this view: Each column represents a Feature Status Each column header includes a total count of Features in each Status Features appear as cards within the column matching their current Status, and can be sorted differently by selected criteria Columns are ordered based on the Status order defined in Project Settings Status colors are reflected in the column headers for quick visual scanning This view is intended for high-level lifecycle tracking and workflow management. Selecting a Feature card opens the Feature detail view for configuration, targeting, and Variable management. Managing Statuses Statuses are managed at the Project level and apply to all Features within that Project. Each Project starts with a default set of Statuses aligned to DevCycle's lifecycle categories. Teams may customize these Statuses to better reflect their internal workflows. Project Settings Statuses can be viewed and managed from the Project Settings page under the Feature Statuses section. From this page, users can: View all Statuses grouped by Category Create new custom Statuses within supported Categories Edit existing Status names (Note: each Status must have a unique key) Reorder Statuses within a Category Assign colors to Statuses for quick visual identification Add a description to provide context behind what a Status represents Select the default Status applied when a new Feature is created Changes made in Project Settings take effect immediately and apply across the Project. Status Categories and Rules Statuses must belong to one of DevCycle's predefined Categories. The following rules apply: New Categories cannot be created Each Category must contain at least one Status The last remaining Status in a Category cannot be deleted Status labels and ordering within a Category can be modified Permissions for Status Changes Permission Rules When permissions are enabled: Statuses in the Development and Live Categories can be applied by any user with access to the Project Statuses in the Completed and Archived Categories can only be applied by users with the Publisher permission Only Publishers can create, and modify Feature Statuses in the Project Settings Edit this page Last updated on Jan 9, 2026 Previous EdgeDB (Stored Custom Properties) Next Stale Feature Notifications Statuses Status Categories Development Live Completed Archived Changing Status Moving a Feature to Completed Reverting to Development or Live Viewing Features by Status (Kanban View) Managing Statuses Project Settings Permissions for Status Changes DevCycle Dashboard Blog Privacy Policy Twitter Discord GitHub Copyright © 2026 DevCycle. All rights reserved. | 2026-01-13T08:48:44 |
https://highlight.io/for/node | highlight.io: The open source monitoring platform. Star us on GitHub Star Product Integrations Pricing Resources Docs Sign in Sign up Your browser does not support the video tag. Your browser does not support the video tag. The Node.js monitoring toolkit you've been waiting for. What if monitoring your Node.js app was as easy as deploying it? With session replay and error monitoring, Highlight's got you covered. Get started Live demo Session Replay Investigate hard-to-crack bugs by playing through issues in a youtube-like UI. With access to requests, console logs and more! Error Monitoring Continuously monitor errors and exceptions in your Node.js application, all the way from your frontend to your backend. Performance Metrics Monitor and set alerts for important performance metrics in Node.js like Web Vitals, Request latency, and much more! Highlight for Node.js Get started in your Node.js app today. Get started for free Live demo Backend import { H } from '@highlight-run/node' const highlightOptions = {} if (!H.isInitialized()) { H.init(highlightOptions) } const onError = (request, error) => { const parsed = H.parseHeaders(request.headers) if (parsed !== undefined) { H.consumeError(error, parsed.secureSessionId, parsed.requestId) } } Reproduce issues with high-fidelity session replay. With our pixel-perfect replays of your Node.js app, you'll get to the bottom of issues in no time and better understand how your app is being used. Read our docs Get a ping when exceptions or errors are thrown. Our alerting infrastructure can take abnormal metrics or errors raised in your Node.js app and notify your engineering team over Slack, Discord, and more! Read our docs Monitor the metrics that keep your customers around. Highlight allows you to track performance, request timings, and several other metrics in your Node.js application. Read our docs Our customers Highlight powers forward-thinking companies. More about our customers → Don't take our word. What our customers have to say → Highlight helps us catch bugs that would otherwise go undetected and makes it easy to replicate and debug them. Max Musing , Founder & CEO Highlight weaves together the incredible, varied, and complex interactions of our users into something understandable and actionable. Kai Hess , Founding Product Designer I love Highlight because not only does it help me debug more quickly, but it gives me insight into how customers are actually using our product. Meryl Dakin , Founding Software Engineer Highlight has helped us win over several customers by making it possible for us to provide hands-on support, based on a detailed understanding of what each user was doing. Neil Raina , CTO Highlight helps us catch bugs that would otherwise go undetected and makes it easy to replicate and debug them. Max Musing , Founder & CEO Highlight weaves together the incredible, varied, and complex interactions of our users into something understandable and actionable. Kai Hess , Founding Product Designer I love Highlight because not only does it help me debug more quickly, but it gives me insight into how customers are actually using our product. Meryl Dakin , Founding Software Engineer Highlight has helped us win over several customers by making it possible for us to provide hands-on support, based on a detailed understanding of what each user was doing. Neil Raina , CTO Try Highlight Today Get the visibility you need Get started for free Product Pricing Sign up Features Privacy & Security Customers Session Replay Error Monitoring Logging Competitors LogRocket Hotjar Fullstory Smartlook Inspectlet Datadog Sentry Site24x7 Sprig Mouseflow Pendo Heap LogicMonitor Last9 Axiom Better Stack HyperDX Dash0 Developers Changelog Documentation Ambassadors Frameworks React Next.js Angular Gatsby.js Svelte.js Vue.js Express Golang Next.js Node.js Rails Hono Contact & Legal Terms of Service Privacy Policy Careers sales@highlight.io security@highlight.io [object Object] | 2026-01-13T08:48:44 |
https://parenting.forem.com/keirasmith5/top-5-breast-pumps-for-2025-soft-practical-tested-by-real-moms-h32#comments | Top 5 Breast Pumps for 2025: Soft, Practical & Tested by Real Moms - Parenting Forem Feed Follow new Subforems to improve your feed DEV Community Follow A space to discuss and keep up software development and manage your software career Future Follow News and discussion of science and technology such as AI, VR, cryptocurrency, quantum computing, and more. Open Forem Follow A general discussion space for the Forem community. If it doesn't have a home elsewhere, it belongs here Gamers Forem Follow An inclusive community for gaming enthusiasts Music Forem Follow From composing and gigging to gear, hot music takes, and everything in between. Vibe Coding Forem Follow Discussing AI software development, and showing off what we're building. Popcorn Movies and TV Follow Movie and TV enthusiasm, criticism and everything in-between. DUMB DEV Community Follow Memes and software development shitposting Design Community Follow Web design, graphic design and everything in-between Security Forem Follow Your central hub for all things security. From ethical hacking and CTFs to GRC and career development, for beginners and pros alike Golf Forem Follow A community of golfers and golfing enthusiasts Crypto Forem Follow A collaborative community for all things Crypto—from Bitcoin to protocol development and DeFi to NFTs and market analysis. Parenting Follow A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Forem Core Follow Discussing the core forem open source software project — features, bugs, performance, self-hosting. Maker Forem Follow A community for makers, hobbyists, and professionals to discuss Arduino, Raspberry Pi, 3D printing, and much more. HMPL.js Forem Follow For developers using HMPL.js to build fast, lightweight web apps. A space to share projects, ask questions, and discuss server-driven templating Dropdown menu Dropdown menu Skip to content Navigation menu Search Powered by Algolia Search Log in Create account Parenting Close Add reaction Like Unicorn Exploding Head Raised Hands Fire Jump to Comments Save Boost More... Copy link Copy link Copied to Clipboard Share to X Share to LinkedIn Share to Facebook Share to Mastodon Share Post via... Report Abuse Keira Smith Posted on Dec 3, 2025 Top 5 Breast Pumps for 2025: Soft, Practical & Tested by Real Moms # babygear # newparents Breastfeeding is deeply personal and often beautifully imperfect. For many families, a breast pump is more than a gadget; it is how you feed your baby when you return to work, protect supply through a growth spurt or illness, or simply get some uninterrupted sleep. As a gentle‑parenting mom who has pumped through the night and in office wellness rooms, I wrote this guide to help you choose confidently. The picks and guidance combine what families tell me works in real life with respected testing and clinical sources, including Consumer Reports, Wirecutter, La Leche League International, Cleveland Clinic, the U.S. FDA, and hospital lactation programs. Where a claim comes from the manufacturer, I say so clearly. How We Chose The five pumps below were selected to cover the most common real‑world needs: initiating supply after birth or NICU discharge, daily work pumping, discreet travel, and occasional or backup use. I weighed comfort, efficiency, ease of cleaning, noise, power options, and cost pathways such as insurance coverage or short‑term rental. Evidence and expert guidance come from La Leche League International on pumping frequency and double pumping efficiency, Cleveland Clinic on pump types, storage, and hygiene, the U.S. FDA on safe use and assembly, and Consumer Reports and Wirecutter on how pumps perform for actual lactating testers, including noise checks and day‑to‑day usability. When a feature is highlighted only by a brand, I name it as a manufacturer claim. If something is an inference from my own and clients’ experiences, I note that too and offer a confidence level. Top Five at a Glance Pump Type Best For Power Double Pumping Noted Feedback Typical Path Medela Symphony Hospital‑grade rental Establishing or rebuilding supply, NICU separation, twins Plug‑in Yes Durable clinical workhorse; research‑based modes; heavy to transport; purchase price often over $2,000.00 so rental is common (Breastfeeding Center for Greater Washington; Medela) Hospital or local lactation center rental Spectra S1/S2 family Double electric personal use Daily work pumping with comfort and customization Rechargeable or plug‑in, model‑dependent Yes Night‑light on S1/S2/S3 helps overnight sessions; generally quiet and adjustable (Breastfeeding Center for Greater Washington; La Leche League International) Often covered by insurance as a primary pump Baby Buddha 2.0 Compact portable electric Small, powerful “go‑bag” pump for on‑the‑go parents Rechargeable Yes (with compatible kits) Wirecutter notes two months of testing by an exclusively pumping parent in 2024; appreciated as a portable “workhorse” option; details vary by setup (Wirecutter) Purchase as a portable complement to a main pump Elvie wearable In‑bra wearable electric Discreet, hands‑free pumping during travel or meetings Rechargeable, app‑connected Double if using two units Very convenient and quiet under clothing; app‑based volume tracking means you cannot watch bottles fill; wearables are generally less efficient for establishing supply (Breastfeeding Center for Greater Washington; Consumer Reports) Often an out‑of‑pocket upgrade; pair with a traditional pump Haakaa silicone Manual silicone collector Letdown catch, occasional pumping, oversupply management aid No power Single Recommended by IBCLCs as a helpful tool; very portable and easy to clean; typical sizes about 5.4 fl oz and 8.5 fl oz (Consumer Reports; Milkbar Breastpumps) Low‑cost add‑on or backup Mom’s note: In my own day‑to‑day, a portable double electric with a soft night‑light made 3:00 AM sessions calmer and simpler. That tiny quality‑of‑life detail matters more than you think at two weeks postpartum. The Reviews Medela Symphony: Best Hospital‑Grade Rental for Starting Strong If you are building supply in the early weeks, separated from your baby, supporting multiples, or recovering from complications, a hospital‑grade rental is often the most reliable path. The Symphony is a clinical mainstay precisely for these use cases. The Breastfeeding Center for Greater Washington rents Medela Symphony alongside other clinical pumps and notes families choose hospital‑grade models to establish supply in the early weeks, for dips in production, for NICU separations, twins, and during travel. The unit is designed for durability and heavy daily use, and it offers research‑based patterns such as Medela’s two‑phase expression that mimic stimulation and expression cycles found in early nursing. This pump is not meant to be tossed into a tote; it is heavy and plug‑in only, and purchase pricing is high, with typical published retail values above $2,000.00. That is why rental through a hospital or lactation center remains the more accessible route. From a comfort and production standpoint, the Symphony’s adjustability and stable suction can help reduce pain and optimize letdown, which matters because pain inhibits milk ejection. In practice, it shines as a short‑term accelerator: rent for a month or two until supply is stable, then transition to a lighter home pump for long‑term use. Confidence in this pick is high, based on clinical use cases and lactation program practices. Spectra S1/S2 Family: Best Everyday Double Electric for Work and Home For regular pumping three times a day and long stretches away from baby, Consumer Reports calls double electric or battery‑powered “workhorse” pumps the right match because they pump both breasts at once and allow you to customize cycle speed and vacuum. Spectra’s S1/S2 family fits this pattern well, with the Breastfeeding Center for Greater Washington pointing out thoughtful touches like a built‑in night‑light on S1, S2, and S3 that eases middle‑of‑the‑night sessions. La Leche League International explains that double pumping generally cuts session time in half, often to about 15 minutes, and elevates prolactin, which supports supply. Those are practical advantages when you are fitting pumping into an eight‑hour workday or a baby’s nap window. Parents typically describe Spectra’s rhythm as gentle but effective, with quiet operation that does not call attention to itself in an office setting. The S1’s rechargeable battery supports mobility around the house, while the S2 is plug‑in; both offer individual control over settings to dial in comfort. Downsides are what you would expect for any traditional setup: parts to clean and tubes to keep track of, and they are more visible than wearables in public. Overall confidence is high, supported by mainstream insurance coverage, lactation‑clinic familiarity, and evidence favoring double pumping for efficiency. Baby Buddha 2.0: Best Compact Portable “Workhorse” If you want strong suction and a tiny footprint, Baby Buddha has an enthusiastic following among parents who crave portability. Wirecutter updated its guide with a two‑month test of Baby Buddha 2.0 by an exclusively pumping parent, comparing it directly with the original model. That kind of hands‑on use gives useful feedback about day‑to‑day reliability, noise, and comfort. Wirecutter’s testing approach, which has included decibel checks with a CDC‑recommended app and timed sessions to judge how fully and quickly breasts empty, suggests a realistic quality bar for any portable. In the real world, a compact motor like this can live in your jacket pocket while you use compatible flanges or collection cups. It pairs well with a pumping bra to keep hands free. Parents should expect a learning curve dialing in settings and compatible kits, and like most minis, it may not feel as smooth as larger pumps on sensitive days. As a primary for exclusives, some still prefer a heavier double electric. As a secondary pump to preserve sanity and mobility, it can be a difference‑maker. Confidence level is moderate to high, anchored in hands‑on tester feedback and typical portable‑pump trade‑offs. Elvie Wearable: Best for Discreet, Hands‑Free Sessions Wearables sit entirely in the bra, run on batteries, and can make pumping during travel, commutes, meetings, or even daycare pickup possible without tubing or a visible motor. Consumer Reports is clear that wearables are convenient but “not going to be quite as efficient” for establishing or boosting supply; many parents use a traditional double electric to lock in supply, then use a wearable as a complementary pump. The Breastfeeding Center for Greater Washington also notes that app‑based wearables like Elvie rely on the app to monitor volume, so you cannot watch bottles fill in real time, which some parents dislike. On the other hand, the muffling effect of clothing and the absence of external tubes can reduce perceived noise and increase discretion. In practice, wearables are game‑changing for multitasking, but they ask more of you in setup and troubleshooting. The pieces must be aligned precisely to avoid leaks, your bra fit matters, and cleaning is different from standard flanges. Costs are typically higher, and insurance often treats wearables as upgrades. If your priority is freedom of movement and pumping where no one will notice, a wearable like Elvie earns its place, with the caveat that you should keep a traditional double electric as your supply backbone. Confidence level is high for convenience, with the efficiency caveat supported by Consumer Reports. Haakaa Silicone: Best Manual Option for Simplicity and Letdown Catch Manual pumps still matter. Cleveland Clinic describes manual pumps as low‑cost, portable tools that excel for occasional use, backup, or letdown capture. The manual silicone Haakaa in particular has won praise from IBCLCs cited by Consumer Reports because it passively collects milk through gentle suction while you nurse or pump on the other side. Milkbar Breastpumps notes that its Gen 3 system can collect into detachable bottles roughly 5.4 fl oz or 8.5 fl oz. There is almost nothing to assemble, no power to charge, and cleaning is fast. The trade‑offs are equally clear. This is not a high‑output, double‑sided solution; it is one breast at a time and depends on your letdown. If you experience oversupply, even a passive collector can encourage extra production; Consumer Reports warns that oversupply can contribute to forceful letdown and maternal mastitis, so moderation and comfort‑first settings matter. As a budget‑friendly add‑on, a silicone manual often pays for itself by saving milk that would otherwise be lost to a nursing pad. Confidence level is high as a supplement, moderate as a primary. Buying Guide: How to Match a Pump to Your Life The right pump is the one that fits your routine, goals, and comfort. Cleveland Clinic and La Leche League International both emphasize that there is no one‑size‑fits‑all choice, so start with your use pattern. If you will be away from your baby for eight or more hours most days, a double electric that lets you customize suction and cycle speed will save time, with double pumping often cutting sessions to about 15 minutes and supporting prolactin. If you need to establish supply in the first few days or are separated after birth, a hospital‑grade rental offers the strongest, most consistent stimulation patterns, and Medela’s initiation program on a hospital unit is designed for that window. If your priority is pumping discreetly while you move, wearables trade a bit of efficiency for significant freedom. For occasional pumping, a manual silicone collector or lever‑style manual pump is small, quiet, and inexpensive. Power and portability are next. Battery options, rechargeable cases, and car adapters can turn an everyday pump into a reliable travel companion. Noise matters if you pump in shared spaces, and both Consumer Reports and Wirecutter have measured or described motor volume as part of their hands‑on testing. For hygiene and cleaning, Sanrai and other medical suppliers advise favoring closed systems because they help keep milk out of tubing and the motor. Regardless of system type, the U.S. FDA recommends reading the full manual, assembling correctly, and contacting the manufacturer if you see persistent leaks. Cost and coverage deserve early attention. Consumer Reports and ByramBaby note that many insurance plans cover a pump, often with upgrade options for a small fee, though some plans have exceptions. Wearables are frequently classified as upgrades. Hospital‑grade units are generally rented rather than purchased. Wirecutter reminds parents to treat pumps as medical devices and to verify that any pump you buy is listed in the FDA’s device database, and to note that opened pumps are often not returnable for health reasons. Finally, plan for fit and comfort. The flange or breast shield must fit your nipple diameter, allow free movement without rubbing, and may need to change over time or differ between sides; both Cleveland Clinic and Ameda emphasize that proper fit improves comfort and milk flow. Start your session with a gentle stimulation rhythm, then switch to expression. The FDA advises starting at the lowest suction and speed, breaking the seal gently with a finger after pumping, and labeling milk with date and time before refrigeration or freezing. Care, Safety, and Troubleshooting A comfortable pumping routine protects supply and your well‑being. Consumer Reports highlights that most newborns nurse every two to four hours initially, and pumping beyond comfort can backfire. Keep sessions roughly 10 to 15 minutes, avoid pain, and if it is taking longer than 30 minutes to empty in the first twelve weeks, check flange fit, settings, and schedule, or consider underlying medical factors. Postpartum hemorrhage, retained placenta, thyroid disease, diabetes, polycystic ovarian syndrome, and insufficient glandular tissue can all affect supply; lactation professionals support technique but do not diagnose or prescribe, so concerns about low supply should go to your OB/GYN or primary care clinician. Supply is demand‑driven, and the feedback inhibitor of lactation reduces production when milk sits in the breast. Prolactin peaks at night, which is why a middle‑of‑the‑night pump helps parents who exclusively pump. If you are balancing older children, Consumer Reports shares a practical time‑saver: some parents pump both breasts into two bottles while feeding previously expressed milk to their baby, cutting a long feed‑and‑pump block roughly in half. For short‑term boosts, Mamava describes power pumping that mimics cluster feeding; expect a few days before you see a change, and try not to fixate on the bottle level in the moment. When pain or output throws you a curveball, simplify. Check assembly against the manual and adjust suction down to comfort. Warm compresses and gentle breast massage before a session can help trigger letdown, and a calm environment matters; the FDA even suggests that holding your baby or looking at a photo can help. For workplace logistics, La Leche League points to U.S. protections that require reasonable break time and a private non‑bathroom space for pumping under federal law; knowing your rights reduces stress and supports consistency. Storage and Cleaning Essentials Cleveland Clinic’s storage guidance is straightforward for U.S. families. Refrigerate expressed milk for up to four days and freeze for up to twelve months, with best quality if used within six months. Label each container with the date and time. The FDA recommends washing all milk‑contact parts after each use, sanitizing at least daily for very young, preterm, or immunocompromised infants, and letting parts air‑dry on a clean surface rather than using a dish towel. The FDA also emphasizes the importance of comfortable settings and correct assembly to prevent leaks and protect nipples. The NHS describes that, once capped securely, freshly expressed milk can be left at room temperature for four to six hours before refrigeration in typical conditions, which many U.S. parents find helpful for commutes or a short appointment; confirm with your pediatrician which room‑temperature window they prefer you follow. Pump Types at a Glance Type Typical Use Convenience and Cost Notes Manual (lever or silicone) Occasional sessions, letdown capture, travel backup Lightweight, very portable, quiet, and simple. Often about $20.00 to $50.00. Best for short or infrequent use (La Leche League International; Cleveland Clinic). Small electric (single or some double) One to two sessions daily Battery or AC, varying noise. Typically about $50.00 to $150.00. Useful as backups or for light routines (La Leche League International). Double electric personal use Three or more sessions daily, eight‑hour separations Time‑efficient and usually quiet. Often about $200.00 to $300.00, commonly covered by insurance as a primary pump (La Leche League International; Consumer Reports). In‑bra wearable Discreet pumping on the move Highly portable and quiet under clothing; often less efficient for establishing supply and treated as an insurance upgrade (Consumer Reports). Hospital‑grade multi‑user Establishing or rebuilding supply; separation after birth Strong, consistent suction and durability. Purchases can exceed $2,000.00, so rental via hospital or DME supplier is common (Breastfeeding Center for Greater Washington; Ameda). Practical Schedules and Strategies La Leche League International suggests that when you are apart from your baby, you aim to pump every two to three hours to match a typical nursing pattern. For an eight‑hour workday, that often looks like nursing before leaving, then pumping mid‑morning, at lunch, and mid‑afternoon, followed by nursing after work. Double pumping can cut total time roughly in half, and a hands‑free bra frees your hands for a snack or to answer email. If your baby reverse cycles, sleeping more during the day and nursing more overnight after you reunite, you may reduce daytime pumping as long as your overall 24‑hour output remains stable. Keep sessions comfortable; pain stalls letdown. If you are still in the first few weeks, many experts recommend introducing bottles once breastfeeding is established, typically around four to six weeks, unless medical needs dictate earlier pumping. Safety Notes on Sharing and Secondhand Cleveland Clinic and Ameda advise never to share single‑user pumps or buy them secondhand, because backflow and microscopic residue can contaminate internal parts in a way that is not fixable with surface cleaning. Multi‑user hospital‑grade pumps, by contrast, are designed for rental with a personal kit of milk‑contact parts. Wirecutter further advises verifying that any pump you buy is listed in the U.S. FDA’s device database and to expect most opened pumps to be nonreturnable due to health and safety policies. FAQ When should I start pumping and offering a bottle? If breastfeeding is going smoothly, many clinicians suggest waiting until breastfeeding is established, often around four to six weeks, before adding regular pumping and bottle feeding. That timing helps avoid early oversupply or nipple confusion and maintains the nursing rhythm. If your baby is in the NICU, has latch challenges, or you need to protect supply immediately after birth, a hospital‑grade rental in the first days is appropriate. Guidance here is consistent with Cleveland Clinic and major lactation organizations. How often should I pump when I am away from my baby? La Leche League International recommends every two to three hours to mimic a nursing routine. For a typical eight‑hour workday, that translates to three daytime sessions, plus nursing before and after work. Double pumping saves time, and consistency protects supply. If you are exclusively pumping, include a middle‑of‑the‑night session while prolactin peaks. Are wearables enough, or do I still need a traditional pump? Wearables like Elvie are a gift for discretion and mobility, but Consumer Reports notes that they tend to be less efficient for establishing and growing supply. Many parents use a double electric to set their baseline and keep a wearable for commutes, travel days, and meetings. That combination balances efficiency with freedom. What flange size do I need, and why does it matter? The flange should match your nipple diameter and allow the nipple to move freely without rubbing. A poor fit can hurt, reduce output, and contribute to clogged ducts. Cleveland Clinic and Ameda stress reassessing size over time and even using different sizes for each breast. Many pumps include multiple sizes, and a lactation consultant can help you measure and fit. Is secondhand safe if I clean it well? Single‑user pumps should not be shared or bought secondhand, even with careful cleaning, because internal parts can harbor residue. Hospital‑grade multi‑user units are designed for rental with a personal kit. Wirecutter also encourages checking the pump’s FDA listing, and be aware that opened pumps are rarely returnable. How long can I store expressed milk? Cleveland Clinic advises refrigerating expressed milk for up to four days and freezing it for up to twelve months, with best quality if used within six months. Label every container with date and time. The FDA recommends washing and sanitizing parts as directed and breaking the vacuum seal gently before removing flanges to protect nipples. The NHS notes that capped, freshly expressed milk can sit at room temperature for four to six hours before refrigeration; discuss with your pediatrician which room‑temperature window they prefer in your situation. Takeaway Choosing a breast pump is not about chasing hype; it is about matching a tool to your life. If you need to establish supply or navigate separation, a hospital‑grade rental like Medela Symphony offers clinical‑strength reliability. For daily work pumping, a quiet, adjustable double electric such as the Spectra S1/S2 family is a proven “workhorse.” When you need compact power in a tiny body, a portable like Baby Buddha 2.0 can be a sanity saver. If discretion is king, a wearable such as Elvie frees your hands and your schedule, while a simple Haakaa silicone manual catches every drop without fuss. Layer in sound habits—correct flange fit, comfortable settings, consistent timing, and safe storage—and you will protect your supply and your peace of mind. When in doubt, lean on an IBCLC or your clinician. This is a season, and with the right support, you can make it work for you and your baby. Acknowledgments and Notes on Evidence Clinical and technique guidance in this review is informed by La Leche League International, Cleveland Clinic, Ameda, the U.S. FDA, and the NHS. Real‑world product performance and noise considerations draw on Consumer Reports and Wirecutter testing with lactating parents, including a two‑month update on Baby Buddha 2.0. Insurance and buying considerations are summarized from Consumer Reports, ByramBaby, and Wirecutter. The Haakaa silicone pump’s popularity with IBCLCs is noted by Consumer Reports, and capacity examples are based on Milkbar Breastpumps. Manufacturer‑specific features such as Medela’s two‑phase expression and the Elvie app are described as the companies present them; eufy manufacturer claims include HeatFlow technology and a reported suction up to 300 mmHg and about 46 dB operation for certain models. Where I extend advice from personal experience as a mom, I say so, and my confidence is highest where multiple reputable sources and testers align. Top comments (1) Subscribe Personal Trusted User Create template Templates let you quickly answer FAQs or store snippets for re-use. Submit Preview Dismiss Some comments may only be visible to logged-in visitors. Sign in to view all comments. Code of Conduct • Report abuse Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink . Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse Keira Smith Follow Joined Dec 2, 2025 💎 DEV Diamond Sponsors Thank you to our Diamond Sponsors for supporting the DEV Community Google AI is the official AI Model and Platform Partner of DEV Neon is the official database partner of DEV Algolia is the official search partner of DEV Parenting — A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other. Home About Contact Code of Conduct Privacy Policy Terms of Use Built on Forem — the open source software that powers DEV and other inclusive communities. Made with love and Ruby on Rails . Parenting © 2016 - 2026. Navigating the chaos and joy of parenting. Log in Create account | 2026-01-13T08:48:44 |
https://docs.devcycle.com/platform/feature-flags/status-and-lifecycle#viewing-features-by-status-kanban-view | Status and Lifecycle | DevCycle Docs Skip to main content Home SDKs APIs Management API Bucketing API Integrations CLI / MCP Best Practices Community Blog Discord Search Sign Up Home Getting Started Essentials DevCycle Overview Key Features System Architecture Feature Hierarchy Feature Types Platform Feature Flags Features Variables and Variations Targeting Status and Lifecycle Stale Feature Notifications Experimentation Account Management Security and Guardrails Testing and QA Extras Examples Platform Feature Flags Status and Lifecycle On this page Feature Status and Lifecycle Management In DevCycle, Features have Statuses that indicate their current position in the feature lifecycle. Statuses provide a clear, at-a-glance understanding of where a Feature is in its development, release, and cleanup process. Each Status belongs to a Status Category , which defines how the Feature behaves, what actions are allowed, and how it is displayed across the dashboard. Statuses Every Feature in DevCycle always has one Status , which determines its lifecycle stage. By default, DevCycle provides a set of predefined Statuses aligned to core lifecycle categories. The default Statuses are: Development Live Completed Archived In addition to the default Statuses, teams can define custom Statuses within their Project settings. This allows teams to better align Feature lifecycle tracking with their internal development and release processes while preserving DevCycle's lifecycle guarantees. Each custom Status inherits the behavior of their Category. Status changes are not automatic and are always managed explicitly by the user. Status Categories Statuses are grouped into Categories , which define shared lifecycle behavior. Development This Category represents Features that are actively being built, tested, or prepared for release. By default, new Features are created with the Development Status. While a Feature is in Development, all Targeting rules and Variations remain editable. This stage is typically used while work is ongoing and before a Feature is considered ready for a broader release. Below are some examples of different Statuses that would make sense in the Development Category: In Development Pending Design QA Internal Testing Live The Live Category represents Features that are actively running in production or being exposed to users. While a Feature is Live, all Targeting rules and Variations remain editable. Below are some examples of different Statuses that would make sense in the Live Category: Beta Ramping In Production Live Experiment Completed The Completed Category represents Features that have reached the end of active development and rollout. A Feature may be considered Completed once it has been tested, approved, and is fully released, or when no further targeting changes are expected. When a Feature is moved into a Status within the Completed Category, it enters a semi-read-only state : A single final (release) Variation must be selected All Environments will serve this Variation to all users Targeting rules are replaced with an "All users" rule New targeting rules and Variations cannot be added Variable values may still be edited Environments can still be toggled on or off When using the CLI to generate TypeScript types, Variables belonging to a Feature in the Completed Category will be marked as deprecated . Below are some examples of different Statuses that would make sense in the Completed Category: Ready for Cleanup All Users Enabled Stable Release Cleanup Checklist Upon entering a Completed Status, a cleanup checklist is shown for each Variable associated with the Feature. This checklist helps teams determine when it is safe to remove Variables from their codebase or archive them. If a Variable is still referenced in code or evaluated in production, removing it may result in default values being served. If Code References are enabled, additional context will be provided to assist with cleanup. Archived The Archived Category represents the terminal lifecycle state for Features. This Category and Status cannot be edited or changed. A Feature should be archived once it has been fully cleaned up and its Variables have been removed from the codebase. When a Feature is Archived: It becomes fully read-only It is hidden from standard dashboard views Audit Logs remain accessible for historical reference Metrics & Reach data will not be visible on the dashboard for Archived features Archiving Features helps keep both your dashboard and codebase clean while preserving valuable lifecycle history. Note: Feature deletion still exists, but should only be used for mistakes. Deleting a Feature permanently removes it and its Audit Log. Archived Features retain historical data that may be used for future reporting and analysis. Changing Status Moving a Feature to Completed When a Feature is moved into the Completed Category: A final Variation must be selected All Environments serve that Variation to all users Existing Environment statuses are preserved Targeting rules are replaced with a single "All users" rule Additional Variations and targeting rules are locked Reverting to Development or Live Features in the Completed Category can be reverted back to an earlier Status. When reverting: Previous Variations become available again Changes made to Variable values while Completed are retained Prior targeting rules are not restored and must be reconfigured Viewing Features by Status (Kanban View) On the Feature list page, users can switch between a List view and a Kanban-style view that displays Features grouped by their current Status, allowing teams to quickly visualize progress across the Feature lifecycle. In this view: Each column represents a Feature Status Each column header includes a total count of Features in each Status Features appear as cards within the column matching their current Status, and can be sorted differently by selected criteria Columns are ordered based on the Status order defined in Project Settings Status colors are reflected in the column headers for quick visual scanning This view is intended for high-level lifecycle tracking and workflow management. Selecting a Feature card opens the Feature detail view for configuration, targeting, and Variable management. Managing Statuses Statuses are managed at the Project level and apply to all Features within that Project. Each Project starts with a default set of Statuses aligned to DevCycle's lifecycle categories. Teams may customize these Statuses to better reflect their internal workflows. Project Settings Statuses can be viewed and managed from the Project Settings page under the Feature Statuses section. From this page, users can: View all Statuses grouped by Category Create new custom Statuses within supported Categories Edit existing Status names (Note: each Status must have a unique key) Reorder Statuses within a Category Assign colors to Statuses for quick visual identification Add a description to provide context behind what a Status represents Select the default Status applied when a new Feature is created Changes made in Project Settings take effect immediately and apply across the Project. Status Categories and Rules Statuses must belong to one of DevCycle's predefined Categories. The following rules apply: New Categories cannot be created Each Category must contain at least one Status The last remaining Status in a Category cannot be deleted Status labels and ordering within a Category can be modified Permissions for Status Changes Permission Rules When permissions are enabled: Statuses in the Development and Live Categories can be applied by any user with access to the Project Statuses in the Completed and Archived Categories can only be applied by users with the Publisher permission Only Publishers can create, and modify Feature Statuses in the Project Settings Edit this page Last updated on Jan 9, 2026 Previous EdgeDB (Stored Custom Properties) Next Stale Feature Notifications Statuses Status Categories Development Live Completed Archived Changing Status Moving a Feature to Completed Reverting to Development or Live Viewing Features by Status (Kanban View) Managing Statuses Project Settings Permissions for Status Changes DevCycle Dashboard Blog Privacy Policy Twitter Discord GitHub Copyright © 2026 DevCycle. All rights reserved. | 2026-01-13T08:48:44 |
https://porkbun.com/event/holidaysales | porkbun.com | Hogiday domain deals! Toggle navigation porkbun $0.00 (0) products Domains Transfers Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting All Web Hosting Options Easy WordPress Link In Bio Articulation Sitebuilder Cloud WordPress Shared cPanel Hosting Static Hosting Website Builder Easy PHP Email Hosting All Email Hosting Options Proton Mail Porkbun Email Free Email Forwarding Marketing Tools Textla - SMS Marketing Free WHOIS Privacy Free SSL Certificates Free URL Forwarding transfer Free WordPress SALE! .COM SALE! About --> About Who We Are Why Choose Porkbun Porkbun vs Cloudflare FAQs Resources Knowledge Base Porkbun Blog Service Status Help $0.00 (0) sign in Hogiday domain deals! bulk search Uh oh! Domain List TLD Selection Enter one domain per line in the box above. You can search for a maximum of 100 domains at a time. Enter a single SLD in the box above and select the TLDs to search below. You can select a maximum of 100 TLDs. abogado ac ac.nz academy accountant accountants actor adult ae.org ag agency ai airforce am apartments app archi army art as asia associates attorney auction audio auto autos baby band bar bargains basketball bayern beauty beer best bet bh bible bid bike bingo bio biz biz.pr black blackfriday blog blue boats bond boo boston bot boutique br.com broker build builders business buzz bz ca cab cafe cam camera camp capital car cards care careers cars casa cash casino catering cc center ceo cfd channel charity chat cheap christmas church city claims cleaning click clinic clothing cloud club club.tw cn.com co co.ag co.bz co.com co.gg co.in co.je co.lc co.nz co.uk coach codes coffee college com com.ag com.ai com.bz com.de com.lc com.mx com.ph com.pr com.sc com.se com.vc community company compare computer condos construction consulting contact contractors cooking cool country coupons courses credit creditcard cricket cruises cv cx cymru cyou dad dance date dating day de de.com deal dealer deals degree delivery democrat dental dentist desi design dev diamonds diet digital direct directory discount diy doctor dog domains download earth ebiz.tw eco education email energy engineer engineering enterprises equipment esq estate eu eu.com events exchange expert exposed express fail faith family fan fans farm fashion fast feedback finance financial firm.in fish fishing fit fitness flights florist flowers fly fm fo foo food football forex forsale forum foundation free fun fund furniture futbol fyi gallery game game.tw games garden gay gb.net geek.nz gen.in gen.nz gg gift gifts gives giving glass global gmbh gold golf gr.com graphics gratis green gripe group guide guitars guru hair haus health healthcare help hiphop hiv hockey holdings holiday homes horse hospital host hosting hot house how hu.net icu id immo immobilien in in.net inc ind.in industries info info.pr ing ink institute insure international investments io irish isla.pr it.com je jetzt jewelry jobs jp.net jpn.com juegos kaufen kids kim kitchen kiwi.nz kyoto l.lc la land lat law lawyer lc lease legal lgbt life lifestyle lighting limited limo link live living llc loan loans lol london lotto love ltd ltda luxe luxury maison makeup management maori.nz market marketing markets mba me me.uk med media melbourne meme memorial men menu mex.com miami mn mobi moda moe moi mom money monster mortgage motorcycles mov movie mu music mx my nagoya name name.pr navy net net.ag net.ai net.bz net.gg net.in net.je net.lc net.nz net.ph net.pr net.vc network new news nexus ngo ninja nl nom.ag now nrw nyc nz observer off.ai one ong onl online ooo org org.ag org.ai org.bz org.gg org.in org.je org.lc org.mx org.nz org.ph org.pr org.sc org.uk org.vc organic osaka p.lc page partners parts party pet ph phd photo photography photos pics pictures pink pizza place plumbing plus poker porn pr press pro pro.pr productions prof promo properties property protection pub pw qpon quest racing radio.am radio.fm realty recipes red rehab reise reisen rent rentals repair report republican rest restaurant review reviews rich rip rocks rodeo rsvp ru.com rugby run sa.com saarland sale salon sarl sbs sc school school.nz schule science se.net security select services sex sexy sh shiksha shoes shop shopping show singles site ski skin soccer social software solar solutions soy spa space spot srl storage store stream studio study style sucks supplies supply support surf surgery sydney systems taipei talk tattoo tax taxi team tech technology tel tennis theater theatre tickets tienda tips tires tm to today tokyo tools top tours town toys trade trading training travel tube tv tw uk uk.com uk.net university uno us us.com us.org vacations vana vc vegas ventures vet viajes video villas vin vip vision vodka vote voto voyage wales wang watch watches webcam website wedding wiki win wine work works world ws wtf xn--5tzm5g xn--6frz82g xn--czrs0t xn--fjq720a xn--q9jyb4c xn--unup4y xn--vhquv xxx xyz yachts yoga yokohama you za.com zip zone Add available domains to the cart. 100 max. AI Search | Auction Search | Marketplace Search Hoofprints on the roof? 🎅 Porkbun is coming down the chimney with a whole stocking full of savings! Yule have a holly jolly hogiday season with sweet deals on domains like .xyz, .shop, .ORG, .club, and more. 🍬Make your list, check it twice, and grab your next domain name at the perfect price! .xyz $12.98 $2.04 First Year Only .shop $25.23 $2.06 First Year Only .org $10.74 $6.88 First Year Only .club $12.87 $1.54 First Year Only Grab your savings before these deals end! .app $14.93 $10.81 First Year Sale .day $10.81 Everyday Price .design $41.71 $10.81 First Year Sale .dev $12.87 $10.81 First Year Sale .page $10.81 Everyday Price .rsvp $10.81 Everyday Price .art $21.11 $3.60 First Year Sale .blog $21.11 $3.60 First Year Sale .bar $52.01 Everyday Price .buzz $26.26 $2.05 First Year Sale .cloud $21.11 $3.88 First Year Sale .club $12.87 $1.54 First Year Sale .help $26.26 $1.54 First Year Sale .lol $26.26 $1.54 First Year Sale .cv $8.03 $2.37 First Year Sale .diy $31.41 Everyday Price .food $31.41 Everyday Price .fitness $33.47 $5.66 First Year Sale .fun $26.26 $2.57 First Year Sale .one $20.08 $2.57 First Year Sale .inc $2,060.25 $257.98 First Year Sale .info $20.08 $3.09 First Year Sale .io $46.65 $28.12 First Year Sale .me $17.27 Everyday Price .med $144.88 $73.82 First Year Sale .org $10.74 $6.88 First Year Sale .shop $25.23 $2.06 First Year Sale .tech $46.86 $8.75 First Year Sale .vegas $41.66 $15.96 First Year Sale .xyz $12.98 $2.04 First Year Sale Subscribe to our newsletter Stay in the loop on all things Porkbun by signing up for our newsletter! Email Address: You're In Good Hooves We are the highest-rated domain name registrar on Trustpilot, as reviewed by real customers. Trustpilot × Modal Title Close Close × Modal Title Close porkbun Porkbun is an amazingly awesome ICANN accredited domain name registrar based out of the Pacific Northwest. We're different, we're easy, and we're affordable. Use us, you won't be sorry. If you don't use us we'll be sad, but we'll still love you. Get Pork-Puns In Your Inbox Stay in the loop on all things Porkbun by signing up for our newsletter! 21370 SW Langer Farms Parkway, Suite 142-429 Sherwood, OR 97140, US If you're looking for support, you might be able to answer your own question using our Knowledge Base . Support Hours Impacted From January 3rd to January 11th we will be holding our annual company summit which will impact live and after hours support. Our goal is to provide you with an excellent domain registration experience and support and we all appreciate your patience as the whole company works together to make Porkbun even better. Thank you. Reach our USA-Based phone support team: 1.855.PORKBUN (1.855.767.5286) 9AM - 5PM Pacific Time Other Hours: Your mileage may vary, but give it a whirl support@porkbun.com 24 / 7 Email Support Chat Support Hours Vary Your browser does not support the audio element. This plays a little Porkbun jingle. Stay up to date with Porkbun. Sign up for our cool newsletter and we'll keep you up to date with sweet deals, amazing info, and maybe even the occasional limerick or sonnet. Sign Up Products Domain Names Greatest Deals Local Marketplace Local Auctions 3rd Party Aftermarket Web Hosting Link In Bio Articulation Sitebuilder Cloud WordPress cPanel Hosting Static Hosting Easy PHP Website Builder Email Hosting WHOIS Privacy DNS Management SSL Certificates Email Forwarding URL Forwarding Quick Connect Domain Transfer Affiliate Program Handshake Names Ethereum Name Service International Domain Names API Access Support Contact Us Knowledge Base Payment Options Report Abuse Tools Domain Search Domain Suggestion Generator RDAP (WHOIS) Password Generator Service Status Don't like our name? The Buniverse Your IP Address Online DNS Lookup Our Company About Us Our Official Blog Careers Branding Guidelines Policies and Legal Privacy Policy Data Disclosure Policy Bug Bounty Program Porkbun Merchandise Awesomeness Copyright © Porkbun LLC. All rights reserved. Porkbun is a Top Level Design Company Made in the USA 🇺🇸 This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. WARNING: This site has been known to cause a mind blowing experience. We recommend you prepare yourself mentally and if possible be sitting down. Side effects may include saving money, letting out a chuckle, and sporadic oinking. 1 × Modal Title Cancel Continue | 2026-01-13T08:48:44 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.