Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
tempfile._RandomNameSequence Class Reference
Collaboration diagram for tempfile._RandomNameSequence:
Collaboration graph

List of all members.

Public Member Functions

def __init__
def __iter__
def __next__

Public Attributes


Static Public Attributes

string characters = "abcdefghijklmnopqrstuvwxyz0123456789_"

Detailed Description

An instance of _RandomNameSequence generates an endless
sequence of unpredictable strings which can safely be incorporated
into file names.  Each string is six characters long.  Multiple
threads can safely use the same instance at the same time.

_RandomNameSequence is an iterator.

Definition at line 105 of file

Constructor & Destructor Documentation

Definition at line 115 of file

00116     def __init__(self):
00117         self.rng = _Random()

Here is the caller graph for this function:

Member Function Documentation

Definition at line 118 of file

00119     def __iter__(self):
00120         return self

Definition at line 121 of file

00122     def __next__(self):
00123         c = self.characters
00124         choose = self.rng.choice
00125         letters = [choose(c) for dummy in "123456"]
00126         return ''.join(letters)

Member Data Documentation

string tempfile._RandomNameSequence.characters = "abcdefghijklmnopqrstuvwxyz0123456789_" [static]

Definition at line 113 of file

Definition at line 116 of file

The documentation for this class was generated from the following file: