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
c90bc759
Commit
c90bc759
authored
May 24, 2007
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlex.split() now has an optional "posix" parameter.
parent
df25efea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
Doc/lib/libshlex.tex
Doc/lib/libshlex.tex
+4
-2
Lib/shlex.py
Lib/shlex.py
+2
-2
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Doc/lib/libshlex.tex
View file @
c90bc759
...
...
@@ -19,13 +19,15 @@ files for Python applications) or for parsing quoted strings.
The
\module
{
shlex
}
module defines the following functions:
\begin{funcdesc}
{
split
}{
s
\optional
{
, comments
}}
\begin{funcdesc}
{
split
}{
s
\optional
{
, comments
\optional
{
, posix
}
}}
Split the string
\var
{
s
}
using shell-like syntax. If
\var
{
comments
}
is
\constant
{
False
}
(the default), the parsing of comments in the given
string will be disabled (setting the
\member
{
commenters
}
member of the
\class
{
shlex
}
instance to the empty string). This function operates
in
\POSIX
{}
mode.
in
\POSIX
{}
mode by default, but uses non-
\POSIX
{}
mode if the
\var
{
posix
}
argument is false.
\versionadded
{
2.3
}
\versionchanged
[Added the \var{posix} parameter]
{
2.6
}
\end{funcdesc}
The
\module
{
shlex
}
module defines the following class:
...
...
Lib/shlex.py
View file @
c90bc759
...
...
@@ -271,8 +271,8 @@ class shlex:
raise
StopIteration
return
token
def
split
(
s
,
comments
=
False
):
lex
=
shlex
(
s
,
posix
=
True
)
def
split
(
s
,
comments
=
False
,
posix
=
True
):
lex
=
shlex
(
s
,
posix
)
lex
.
whitespace_split
=
True
if
not
comments
:
lex
.
commenters
=
''
...
...
Misc/NEWS
View file @
c90bc759
...
...
@@ -217,6 +217,8 @@ Core and builtins
Library
-------
- shlex.split() now has an optional "posix" parameter.
- The posixfile module now raises a DeprecationWarning.
- Remove the gopherlib module. This also leads to the removal of gopher
...
...
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