Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d6cf8bea
Commit
d6cf8bea
authored
Oct 22, 2002
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify example to use string methods instead of the string module.
parent
4b247264
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
Doc/lib/libfuncs.tex
Doc/lib/libfuncs.tex
+2
-4
No files found.
Doc/lib/libfuncs.tex
View file @
d6cf8bea
...
@@ -37,7 +37,7 @@ are always available. They are listed here in alphabetical order.
...
@@ -37,7 +37,7 @@ are always available. They are listed here in alphabetical order.
a non-empty
\var
{
fromlist
}
argument is given, the module named by
a non-empty
\var
{
fromlist
}
argument is given, the module named by
\var
{
name
}
is returned. This is done for compatibility with the
\var
{
name
}
is returned. This is done for compatibility with the
bytecode generated for the different kinds of import statement; when
bytecode generated for the different kinds of import statement; when
using
\samp
{
import spam.ham.eggs
}
, the top-level package
\
cod
e
{
spam
}
using
\samp
{
import spam.ham.eggs
}
, the top-level package
\
modul
e
{
spam
}
must be placed in the importing namespace, but when using
\samp
{
from
must be placed in the importing namespace, but when using
\samp
{
from
spam.ham import eggs
}
, the
\code
{
spam.ham
}
subpackage must be used
spam.ham import eggs
}
, the
\code
{
spam.ham
}
subpackage must be used
to find the
\code
{
eggs
}
variable. As a workaround for this
to find the
\code
{
eggs
}
variable. As a workaround for this
...
@@ -45,11 +45,9 @@ are always available. They are listed here in alphabetical order.
...
@@ -45,11 +45,9 @@ are always available. They are listed here in alphabetical order.
components. For example, you could define the following helper:
components. For example, you could define the following helper:
\begin{verbatim}
\begin{verbatim}
import string
def my
_
import(name):
def my
_
import(name):
mod =
__
import
__
(name)
mod =
__
import
__
(name)
components =
string.split(name,
'.')
components =
name.split(
'.')
for comp in components[1:]:
for comp in components[1:]:
mod = getattr(mod, comp)
mod = getattr(mod, comp)
return mod
return mod
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment