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
d6285af8
Commit
d6285af8
authored
Apr 21, 1999
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Logical markup & other small nits.
parent
e4ff00e8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
Doc/lib/liblocale.tex
Doc/lib/liblocale.tex
+15
-16
No files found.
Doc/lib/liblocale.tex
View file @
d6285af8
\section
{
\module
{
locale
}
---
Internationalization services.
}
\declaremodule
{
standard
}{
locale
}
Internationalization services
}
\declaremodule
{
standard
}{
locale
}
\modulesynopsis
{
Internationalization services.
}
The
\
cod
e
{
locale
}
module opens access to the
\POSIX
{}
locale database
The
\
modul
e
{
locale
}
module opens access to the
\POSIX
{}
locale database
and functionality. The
\POSIX
{}
locale mechanism allows programmers
to deal with certain cultural issues in an application, without
requiring the programmer to know all the specifics of each country
...
...
@@ -14,7 +13,7 @@ where the software is executed.
The
\module
{
locale
}
module is implemented on top of the
\module
{_
locale
}
\refbimodindex
{_
locale
}
module, which in turn uses an
ANSI
\C
{}
locale implementation if available.
ANSI
C
locale implementation if available.
The
\module
{
locale
}
module defines the following exception and
functions:
...
...
@@ -38,8 +37,8 @@ import locale
locale.setlocale(locale.LC
_
ALL,"")
\end{verbatim}
This sets the locale for all categories to the user's default setting
(typically specified in the
\
code
{
LANG
}
environment variable). If the
locale is not changed thereafter, using multithreading should not
(typically specified in the
\
envvar
{
LANG
}
environment variable). If
the
locale is not changed thereafter, using multithreading should not
cause problems.
\end{funcdesc}
...
...
@@ -52,16 +51,16 @@ Returns the database of of the local conventions as a dictionary. This
dictionary has the following strings as keys:
\begin{itemize}
\item
\code
{
decimal
_
point
}
specifies the decimal point used in
floating point number representations for the
\co
de
{
LC
_
NUMERIC
}
floating point number representations for the
\co
nstant
{
LC
_
NUMERIC
}
category.
\item
\code
{
grouping
}
is a sequence of numbers specifying at which
relative positions the
\code
{
thousands
_
sep
}
is expected. If the
sequence is terminated with
\co
de
{
locale.
CHAR
_
MAX
}
, no further
sequence is terminated with
\co
nstant
{
CHAR
_
MAX
}
, no further
grouping is performed. If the sequence terminates with a
\code
{
0
}
, the last
group size is repeatedly used.
\item
\code
{
thousands
_
sep
}
is the character used between groups.
\item
\code
{
int
_
curr
_
symbol
}
specifies the international currency
symbol from the
\co
de
{
LC
_
MONETARY
}
category.
symbol from the
\co
nstant
{
LC
_
MONETARY
}
category.
\item
\code
{
currency
_
symbol
}
is the local currency symbol.
\item
\code
{
mon
_
decimal
_
point
}
is the decimal point used in monetary
values.
...
...
@@ -84,8 +83,8 @@ the currency symbol.
sign should be placed for positive and negative monetary values.
\end{itemize}
The possible values for
\code
{
p
_
sign
_
posn
}
and
\code
{
n
_
sign
_
posn
}
are given below.
The possible values for
\code
{
p
_
sign
_
posn
}
and
\code
{
n
_
sign
_
posn
}
are given below.
\begin{tableii}
{
c|l
}{
code
}{
Value
}{
Explanation
}
\lineii
{
0
}{
Currency and value are surrounded by parentheses.
}
...
...
@@ -138,7 +137,7 @@ conventions.
\begin{datadesc}
{
LC
_
CTYPE
}
\refstmodindex
{
string
}
Locale category for the character type functions. Depending on the
settings of this category, the functions of module
\module
{
string
}
settings of this category, the functions of module
\
ref
module
{
string
}
dealing with case change their behaviour.
\end{datadesc}
...
...
@@ -226,7 +225,7 @@ should you document that your module is not compatible with
non-
\samp
{
C
}
locale settings.
The case conversion functions in the
\module
{
string
}
\refstmodindex
{
string
}
and
\
ref
module
{
string
}
\refstmodindex
{
string
}
and
\module
{
strop
}
\refbimodindex
{
strop
}
modules are affected by the locale
settings. When a call to the
\function
{
setlocale()
}
function changes
the
\constant
{
LC
_
CTYPE
}
settings, the variables
...
...
@@ -258,8 +257,8 @@ generally okay, and Python will use whatever locale is set,
The
\function
{
setlocale()
}
function in the
\module
{
locale
}
module contains
gives the Python progammer the impression that you can manipulate the
\constant
{
LC
_
NUMERIC
}
locale setting, but this not the case at the
\C
{}
level:
\C
{}
code will always find that the
\constant
{
LC
_
NUMERIC
}
locale
\constant
{
LC
_
NUMERIC
}
locale setting, but this not the case at the
C
level:
C
code will always find that the
\constant
{
LC
_
NUMERIC
}
locale
setting is
\samp
{
C
}
. This is because too much would break when the
decimal point character is set to something else than a period
(e.g. the Python parser would break). Caveat: threads that run
...
...
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