Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`internet`.`_idna``

module documentation
(source)

Shared interface to IDNA encoding and decoding, using the `idna` PyPI package if available, otherwise the stdlib implementation.

Function | `_idnaBytes` | Convert some text typed by a human into some ASCII bytes.
Function | `_idnaText` | Convert some IDNA-encoded octets into some human-readable text.

def _idnaBytes(text): (source)

Convert some text typed by a human into some ASCII bytes.

This is provided to allow us to use the partially-broken IDNA implementation in the standard library if the more-correct idna package is not available; `service_identity` is somewhat stricter about this.

Parameters
text:`unicode` | A domain name, hopefully.
Returns
`bytes` | The domain name's IDNA representation, encoded as bytes.

def _idnaText(octets): (source)

Convert some IDNA-encoded octets into some human-readable text.

Currently only used by the tests.

Parameters
octets:`bytes` | Some bytes representing a hostname.
Returns
`unicode` | A human-readable domain name.