doc_content stringlengths 1 386k | doc_id stringlengths 5 188 |
|---|---|
class nntplib.NNTP(host, port=119, user=None, password=None, readermode=None, usenetrc=False[, timeout])
Return a new NNTP object, representing a connection to the NNTP server running on host host, listening at port port. An optional timeout can be specified for the socket connection. If the optional user and passwor... | python.library.nntplib#nntplib.NNTP |
NNTP.article(message_spec=None, *, file=None)
Send an ARTICLE command, where message_spec has the same meaning as for stat(). Return a tuple (response, info) where info is a namedtuple with three attributes number, message_id and lines (in that order). number is the article number in the group (or 0 if the informatio... | python.library.nntplib#nntplib.NNTP.article |
NNTP.body(message_spec=None, *, file=None)
Same as article(), but sends a BODY command. The lines returned (or written to file) will only contain the message body, not the headers. | python.library.nntplib#nntplib.NNTP.body |
NNTP.date()
Return a pair (response, date). date is a datetime object containing the current date and time of the server. | python.library.nntplib#nntplib.NNTP.date |
NNTP.description(group)
Get a description for a single group group. If more than one group matches (if ‘group’ is a real wildmat string), return the first match. If no group matches, return an empty string. This elides the response code from the server. If the response code is needed, use descriptions(). | python.library.nntplib#nntplib.NNTP.description |
NNTP.descriptions(grouppattern)
Send a LIST NEWSGROUPS command, where grouppattern is a wildmat string as specified in RFC 3977 (it’s essentially the same as DOS or UNIX shell wildcard strings). Return a pair (response, descriptions), where descriptions is a dictionary mapping group names to textual descriptions. >>>... | python.library.nntplib#nntplib.NNTP.descriptions |
NNTP.getcapabilities()
Return the RFC 3977 capabilities advertised by the server, as a dict instance mapping capability names to (possibly empty) lists of values. On legacy servers which don’t understand the CAPABILITIES command, an empty dictionary is returned instead. >>> s = NNTP('news.gmane.io')
>>> 'POST' in s.g... | python.library.nntplib#nntplib.NNTP.getcapabilities |
NNTP.getwelcome()
Return the welcome message sent by the server in reply to the initial connection. (This message sometimes contains disclaimers or help information that may be relevant to the user.) | python.library.nntplib#nntplib.NNTP.getwelcome |
NNTP.group(name)
Send a GROUP command, where name is the group name. The group is selected as the current group, if it exists. Return a tuple (response, count, first, last, name) where count is the (estimated) number of articles in the group, first is the first article number in the group, last is the last article nu... | python.library.nntplib#nntplib.NNTP.group |
NNTP.head(message_spec=None, *, file=None)
Same as article(), but sends a HEAD command. The lines returned (or written to file) will only contain the message headers, not the body. | python.library.nntplib#nntplib.NNTP.head |
NNTP.help(*, file=None)
Send a HELP command. Return a pair (response, list) where list is a list of help strings. | python.library.nntplib#nntplib.NNTP.help |
NNTP.ihave(message_id, data)
Send an IHAVE command. message_id is the id of the message to send to the server (enclosed in '<' and '>'). The data parameter and the return value are the same as for post(). | python.library.nntplib#nntplib.NNTP.ihave |
NNTP.last()
Send a LAST command. Return as for stat(). | python.library.nntplib#nntplib.NNTP.last |
NNTP.list(group_pattern=None, *, file=None)
Send a LIST or LIST ACTIVE command. Return a pair (response, list) where list is a list of tuples representing all the groups available from this NNTP server, optionally matching the pattern string group_pattern. Each tuple has the form (group, last, first, flag), where gro... | python.library.nntplib#nntplib.NNTP.list |
NNTP.login(user=None, password=None, usenetrc=True)
Send AUTHINFO commands with the user name and password. If user and password are None and usenetrc is true, credentials from ~/.netrc will be used if possible. Unless intentionally delayed, login is normally performed during the NNTP object initialization and separa... | python.library.nntplib#nntplib.NNTP.login |
NNTP.newgroups(date, *, file=None)
Send a NEWGROUPS command. The date argument should be a datetime.date or datetime.datetime object. Return a pair (response, groups) where groups is a list representing the groups that are new since the given date. If file is supplied, though, then groups will be empty. >>> from date... | python.library.nntplib#nntplib.NNTP.newgroups |
NNTP.newnews(group, date, *, file=None)
Send a NEWNEWS command. Here, group is a group name or '*', and date has the same meaning as for newgroups(). Return a pair (response, articles) where articles is a list of message ids. This command is frequently disabled by NNTP server administrators. | python.library.nntplib#nntplib.NNTP.newnews |
NNTP.next()
Send a NEXT command. Return as for stat(). | python.library.nntplib#nntplib.NNTP.next |
NNTP.nntp_implementation
A string describing the software name and version of the NNTP server, or None if not advertised by the server. New in version 3.2. | python.library.nntplib#nntplib.NNTP.nntp_implementation |
NNTP.nntp_version
An integer representing the version of the NNTP protocol supported by the server. In practice, this should be 2 for servers advertising RFC 3977 compliance and 1 for others. New in version 3.2. | python.library.nntplib#nntplib.NNTP.nntp_version |
NNTP.over(message_spec, *, file=None)
Send an OVER command, or an XOVER command on legacy servers. message_spec can be either a string representing a message id, or a (first, last) tuple of numbers indicating a range of articles in the current group, or a (first, None) tuple indicating a range of articles starting fr... | python.library.nntplib#nntplib.NNTP.over |
NNTP.post(data)
Post an article using the POST command. The data argument is either a file object opened for binary reading, or any iterable of bytes objects (representing raw lines of the article to be posted). It should represent a well-formed news article, including the required headers. The post() method automati... | python.library.nntplib#nntplib.NNTP.post |
NNTP.quit()
Send a QUIT command and close the connection. Once this method has been called, no other methods of the NNTP object should be called. | python.library.nntplib#nntplib.NNTP.quit |
NNTP.set_debuglevel(level)
Set the instance’s debugging level. This controls the amount of debugging output printed. The default, 0, produces no debugging output. A value of 1 produces a moderate amount of debugging output, generally a single line per request or response. A value of 2 or higher produces the maximum a... | python.library.nntplib#nntplib.NNTP.set_debuglevel |
NNTP.slave()
Send a SLAVE command. Return the server’s response. | python.library.nntplib#nntplib.NNTP.slave |
NNTP.starttls(context=None)
Send a STARTTLS command. This will enable encryption on the NNTP connection. The context argument is optional and should be a ssl.SSLContext object. Please read Security considerations for best practices. Note that this may not be done after authentication information has been transmitted,... | python.library.nntplib#nntplib.NNTP.starttls |
NNTP.stat(message_spec=None)
Send a STAT command, where message_spec is either a message id (enclosed in '<' and '>') or an article number in the current group. If message_spec is omitted or None, the current article in the current group is considered. Return a triple (response, number, id) where number is the articl... | python.library.nntplib#nntplib.NNTP.stat |
NNTP.xhdr(hdr, str, *, file=None)
Send an XHDR command. The hdr argument is a header keyword, e.g. 'subject'. The str argument should have the form 'first-last' where first and last are the first and last article numbers to search. Return a pair (response, list), where list is a list of pairs (id,
text), where id is ... | python.library.nntplib#nntplib.NNTP.xhdr |
NNTP.xover(start, end, *, file=None)
Send an XOVER command. start and end are article numbers delimiting the range of articles to select. The return value is the same of for over(). It is recommended to use over() instead, since it will automatically use the newer OVER command if available. | python.library.nntplib#nntplib.NNTP.xover |
exception nntplib.NNTPDataError
Exception raised when there is some error in the response data. | python.library.nntplib#nntplib.NNTPDataError |
exception nntplib.NNTPError
Derived from the standard exception Exception, this is the base class for all exceptions raised by the nntplib module. Instances of this class have the following attribute:
response
The response of the server if available, as a str object. | python.library.nntplib#nntplib.NNTPError |
response
The response of the server if available, as a str object. | python.library.nntplib#nntplib.NNTPError.response |
exception nntplib.NNTPPermanentError
Exception raised when a response code in the range 500–599 is received. | python.library.nntplib#nntplib.NNTPPermanentError |
exception nntplib.NNTPProtocolError
Exception raised when a reply is received from the server that does not begin with a digit in the range 1–5. | python.library.nntplib#nntplib.NNTPProtocolError |
exception nntplib.NNTPReplyError
Exception raised when an unexpected reply is received from the server. | python.library.nntplib#nntplib.NNTPReplyError |
exception nntplib.NNTPTemporaryError
Exception raised when a response code in the range 400–499 is received. | python.library.nntplib#nntplib.NNTPTemporaryError |
class nntplib.NNTP_SSL(host, port=563, user=None, password=None, ssl_context=None, readermode=None, usenetrc=False[, timeout])
Return a new NNTP_SSL object, representing an encrypted connection to the NNTP server running on host host, listening at port port. NNTP_SSL objects have the same methods as NNTP objects. If ... | python.library.nntplib#nntplib.NNTP_SSL |
None
The sole value of the type NoneType. None is frequently used to represent the absence of a value, as when default arguments are not passed to a function. Assignments to None are illegal and raise a SyntaxError. | python.library.constants#None |
exception NotADirectoryError
Raised when a directory operation (such as os.listdir()) is requested on something which is not a directory. Corresponds to errno ENOTDIR. | python.library.exceptions#NotADirectoryError |
NotImplemented
Special value which should be returned by the binary special methods (e.g. __eq__(), __lt__(), __add__(), __rsub__(), etc.) to indicate that the operation is not implemented with respect to the other type; may be returned by the in-place binary special methods (e.g. __imul__(), __iand__(), etc.) for th... | python.library.constants#NotImplemented |
exception NotImplementedError
This exception is derived from RuntimeError. In user defined base classes, abstract methods should raise this exception when they require derived classes to override the method, or while the class is being developed to indicate that the real implementation still needs to be added. Note ... | python.library.exceptions#NotImplementedError |
numbers — Numeric abstract base classes Source code: Lib/numbers.py The numbers module (PEP 3141) defines a hierarchy of numeric abstract base classes which progressively define more operations. None of the types defined in this module can be instantiated.
class numbers.Number
The root of the numeric hierarchy. If ... | python.library.numbers |
class numbers.Complex
Subclasses of this type describe complex numbers and include the operations that work on the built-in complex type. These are: conversions to complex and bool, real, imag, +, -, *, /, abs(), conjugate(), ==, and !=. All except - and != are abstract.
real
Abstract. Retrieves the real componen... | python.library.numbers#numbers.Complex |
abstractmethod conjugate()
Abstract. Returns the complex conjugate. For example, (1+3j).conjugate()
== (1-3j). | python.library.numbers#numbers.Complex.conjugate |
imag
Abstract. Retrieves the imaginary component of this number. | python.library.numbers#numbers.Complex.imag |
real
Abstract. Retrieves the real component of this number. | python.library.numbers#numbers.Complex.real |
class numbers.Integral
Subtypes Rational and adds a conversion to int. Provides defaults for float(), numerator, and denominator. Adds abstract methods for ** and bit-string operations: <<, >>, &, ^, |, ~. | python.library.numbers#numbers.Integral |
class numbers.Number
The root of the numeric hierarchy. If you just want to check if an argument x is a number, without caring what kind, use isinstance(x, Number). | python.library.numbers#numbers.Number |
class numbers.Rational
Subtypes Real and adds numerator and denominator properties, which should be in lowest terms. With these, it provides a default for float().
numerator
Abstract.
denominator
Abstract. | python.library.numbers#numbers.Rational |
denominator
Abstract. | python.library.numbers#numbers.Rational.denominator |
numerator
Abstract. | python.library.numbers#numbers.Rational.numerator |
class numbers.Real
To Complex, Real adds the operations that work on real numbers. In short, those are: a conversion to float, math.trunc(), round(), math.floor(), math.ceil(), divmod(), //, %, <, <=, >, and >=. Real also provides defaults for complex(), real, imag, and conjugate(). | python.library.numbers#numbers.Real |
class object
Return a new featureless object. object is a base for all classes. It has the methods that are common to all instances of Python classes. This function does not accept any arguments. Note object does not have a __dict__, so you can’t assign arbitrary attributes to an instance of the object class. | python.library.functions#object |
object.__dict__
A dictionary or other mapping object used to store an object’s (writable) attributes. | python.library.stdtypes#object.__dict__ |
object.__getnewargs_ex__()
In protocols 2 and newer, classes that implements the __getnewargs_ex__() method can dictate the values passed to the __new__() method upon unpickling. The method must return a pair (args, kwargs) where args is a tuple of positional arguments and kwargs a dictionary of named arguments for c... | python.library.pickle#object.__getnewargs_ex__ |
object.__getnewargs__()
This method serves a similar purpose as __getnewargs_ex__(), but supports only positional arguments. It must return a tuple of arguments args which will be passed to the __new__() method upon unpickling. __getnewargs__() will not be called if __getnewargs_ex__() is defined. Changed in version... | python.library.pickle#object.__getnewargs__ |
object.__getstate__()
Classes can further influence how their instances are pickled; if the class defines the method __getstate__(), it is called and the returned object is pickled as the contents for the instance, instead of the contents of the instance’s dictionary. If the __getstate__() method is absent, the insta... | python.library.pickle#object.__getstate__ |
object.__reduce_ex__(protocol)
Alternatively, a __reduce_ex__() method may be defined. The only difference is this method should take a single integer argument, the protocol version. When defined, pickle will prefer it over the __reduce__() method. In addition, __reduce__() automatically becomes a synonym for the ext... | python.library.pickle#object.__reduce_ex__ |
object.__reduce__()
The interface is currently defined as follows. The __reduce__() method takes no argument and shall return either a string or preferably a tuple (the returned object is often referred to as the “reduce value”). If a string is returned, the string should be interpreted as the name of a global variab... | python.library.pickle#object.__reduce__ |
object.__setstate__(state)
Upon unpickling, if the class defines __setstate__(), it is called with the unpickled state. In that case, there is no requirement for the state object to be a dictionary. Otherwise, the pickled state must be a dictionary and its items are assigned to the new instance’s dictionary. Note If... | python.library.pickle#object.__setstate__ |
oct(x)
Convert an integer number to an octal string prefixed with “0o”. The result is a valid Python expression. If x is not a Python int object, it has to define an __index__() method that returns an integer. For example: >>> oct(8)
'0o10'
>>> oct(-56)
'-0o70'
If you want to convert an integer number to octal strin... | python.library.functions#oct |
open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
Open file and return a corresponding file object. If the file cannot be opened, an OSError is raised. See Reading and Writing Files for more examples of how to use this function. file is a path-like object giving t... | python.library.functions#open |
BaseHandler.<protocol>_open(req)
This method is not defined in BaseHandler, but subclasses should define it if they want to handle URLs with the given protocol. This method, if defined, will be called by the parent OpenerDirector. Return values should be the same as for default_open(). | python.library.urllib.request#open |
operator — Standard operators as functions Source code: Lib/operator.py The operator module exports a set of efficient functions corresponding to the intrinsic operators of Python. For example, operator.add(x, y) is equivalent to the expression x+y. Many function names are those used for special methods, without the do... | python.library.operator |
operator.abs(obj)
operator.__abs__(obj)
Return the absolute value of obj. | python.library.operator#operator.abs |
operator.add(a, b)
operator.__add__(a, b)
Return a + b, for a and b numbers. | python.library.operator#operator.add |
operator.and_(a, b)
operator.__and__(a, b)
Return the bitwise and of a and b. | python.library.operator#operator.and_ |
operator.attrgetter(attr)
operator.attrgetter(*attrs)
Return a callable object that fetches attr from its operand. If more than one attribute is requested, returns a tuple of attributes. The attribute names can also contain dots. For example: After f = attrgetter('name'), the call f(b) returns b.name. After f = at... | python.library.operator#operator.attrgetter |
operator.concat(a, b)
operator.__concat__(a, b)
Return a + b for a and b sequences. | python.library.operator#operator.concat |
operator.contains(a, b)
operator.__contains__(a, b)
Return the outcome of the test b in a. Note the reversed operands. | python.library.operator#operator.contains |
operator.countOf(a, b)
Return the number of occurrences of b in a. | python.library.operator#operator.countOf |
operator.delitem(a, b)
operator.__delitem__(a, b)
Remove the value of a at index b. | python.library.operator#operator.delitem |
operator.lt(a, b)
operator.le(a, b)
operator.eq(a, b)
operator.ne(a, b)
operator.ge(a, b)
operator.gt(a, b)
operator.__lt__(a, b)
operator.__le__(a, b)
operator.__eq__(a, b)
operator.__ne__(a, b)
operator.__ge__(a, b)
operator.__gt__(a, b)
Perform “rich comparisons” between a and b. Specifically... | python.library.operator#operator.eq |
operator.floordiv(a, b)
operator.__floordiv__(a, b)
Return a // b. | python.library.operator#operator.floordiv |
operator.lt(a, b)
operator.le(a, b)
operator.eq(a, b)
operator.ne(a, b)
operator.ge(a, b)
operator.gt(a, b)
operator.__lt__(a, b)
operator.__le__(a, b)
operator.__eq__(a, b)
operator.__ne__(a, b)
operator.__ge__(a, b)
operator.__gt__(a, b)
Perform “rich comparisons” between a and b. Specifically... | python.library.operator#operator.ge |
operator.getitem(a, b)
operator.__getitem__(a, b)
Return the value of a at index b. | python.library.operator#operator.getitem |
operator.lt(a, b)
operator.le(a, b)
operator.eq(a, b)
operator.ne(a, b)
operator.ge(a, b)
operator.gt(a, b)
operator.__lt__(a, b)
operator.__le__(a, b)
operator.__eq__(a, b)
operator.__ne__(a, b)
operator.__ge__(a, b)
operator.__gt__(a, b)
Perform “rich comparisons” between a and b. Specifically... | python.library.operator#operator.gt |
operator.iadd(a, b)
operator.__iadd__(a, b)
a = iadd(a, b) is equivalent to a += b. | python.library.operator#operator.iadd |
operator.iand(a, b)
operator.__iand__(a, b)
a = iand(a, b) is equivalent to a &= b. | python.library.operator#operator.iand |
operator.iconcat(a, b)
operator.__iconcat__(a, b)
a = iconcat(a, b) is equivalent to a += b for a and b sequences. | python.library.operator#operator.iconcat |
operator.ifloordiv(a, b)
operator.__ifloordiv__(a, b)
a = ifloordiv(a, b) is equivalent to a //= b. | python.library.operator#operator.ifloordiv |
operator.ilshift(a, b)
operator.__ilshift__(a, b)
a = ilshift(a, b) is equivalent to a <<= b. | python.library.operator#operator.ilshift |
operator.imatmul(a, b)
operator.__imatmul__(a, b)
a = imatmul(a, b) is equivalent to a @= b. New in version 3.5. | python.library.operator#operator.imatmul |
operator.imod(a, b)
operator.__imod__(a, b)
a = imod(a, b) is equivalent to a %= b. | python.library.operator#operator.imod |
operator.imul(a, b)
operator.__imul__(a, b)
a = imul(a, b) is equivalent to a *= b. | python.library.operator#operator.imul |
operator.index(a)
operator.__index__(a)
Return a converted to an integer. Equivalent to a.__index__(). | python.library.operator#operator.index |
operator.indexOf(a, b)
Return the index of the first of occurrence of b in a. | python.library.operator#operator.indexOf |
operator.inv(obj)
operator.invert(obj)
operator.__inv__(obj)
operator.__invert__(obj)
Return the bitwise inverse of the number obj. This is equivalent to ~obj. | python.library.operator#operator.inv |
operator.inv(obj)
operator.invert(obj)
operator.__inv__(obj)
operator.__invert__(obj)
Return the bitwise inverse of the number obj. This is equivalent to ~obj. | python.library.operator#operator.invert |
operator.ior(a, b)
operator.__ior__(a, b)
a = ior(a, b) is equivalent to a |= b. | python.library.operator#operator.ior |
operator.ipow(a, b)
operator.__ipow__(a, b)
a = ipow(a, b) is equivalent to a **= b. | python.library.operator#operator.ipow |
operator.irshift(a, b)
operator.__irshift__(a, b)
a = irshift(a, b) is equivalent to a >>= b. | python.library.operator#operator.irshift |
operator.isub(a, b)
operator.__isub__(a, b)
a = isub(a, b) is equivalent to a -= b. | python.library.operator#operator.isub |
operator.is_(a, b)
Return a is b. Tests object identity. | python.library.operator#operator.is_ |
operator.is_not(a, b)
Return a is not b. Tests object identity. | python.library.operator#operator.is_not |
operator.itemgetter(item)
operator.itemgetter(*items)
Return a callable object that fetches item from its operand using the operand’s __getitem__() method. If multiple items are specified, returns a tuple of lookup values. For example: After f = itemgetter(2), the call f(r) returns r[2]. After g = itemgetter(2, 5,... | python.library.operator#operator.itemgetter |
operator.itruediv(a, b)
operator.__itruediv__(a, b)
a = itruediv(a, b) is equivalent to a /= b. | python.library.operator#operator.itruediv |
operator.ixor(a, b)
operator.__ixor__(a, b)
a = ixor(a, b) is equivalent to a ^= b. | python.library.operator#operator.ixor |
operator.lt(a, b)
operator.le(a, b)
operator.eq(a, b)
operator.ne(a, b)
operator.ge(a, b)
operator.gt(a, b)
operator.__lt__(a, b)
operator.__le__(a, b)
operator.__eq__(a, b)
operator.__ne__(a, b)
operator.__ge__(a, b)
operator.__gt__(a, b)
Perform “rich comparisons” between a and b. Specifically... | python.library.operator#operator.le |
operator.length_hint(obj, default=0)
Return an estimated length for the object o. First try to return its actual length, then an estimate using object.__length_hint__(), and finally return the default value. New in version 3.4. | python.library.operator#operator.length_hint |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.