Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
428f0641
Kaydet (Commit)
428f0641
authored
Mar 18, 2007
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove the deprecated and useless "pend" argument from
PyFloat_FromString. (fixes bug #1650903)
üst
9091e3a4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
29 deletions
+10
-29
concrete.tex
Doc/api/concrete.tex
+2
-3
refcounts.dat
Doc/api/refcounts.dat
+0
-1
floatobject.h
Include/floatobject.h
+2
-4
NEWS
Misc/NEWS
+3
-0
abstract.c
Objects/abstract.c
+1
-1
floatobject.c
Objects/floatobject.c
+2
-20
No files found.
Doc/api/concrete.tex
Dosyayı görüntüle @
428f0641
...
...
@@ -430,10 +430,9 @@ booleans. The following macros are available, however.
\versionadded
{
2.2
}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyFloat
_
FromString
}{
PyObject *str
, char **pend
}
\begin{cfuncdesc}
{
PyObject*
}{
PyFloat
_
FromString
}{
PyObject *str
}
Create a
\ctype
{
PyFloatObject
}
object based on the string value in
\var
{
str
}
, or
\NULL
{}
on failure. The
\var
{
pend
}
argument is ignored. It
remains only for backward compatibility.
\var
{
str
}
, or
\NULL
{}
on failure.
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyFloat
_
FromDouble
}{
double v
}
...
...
Doc/api/refcounts.dat
Dosyayı görüntüle @
428f0641
...
...
@@ -385,7 +385,6 @@ PyFloat_FromDouble:double:v::
PyFloat_FromString:PyObject*::+1:
PyFloat_FromString:PyObject*:str:0:
PyFloat_FromString:char**:pend:0:ignored
PyFrozenSet_New:PyObject*::+1:
PyFrozenSet_New:PyObject*:iterable:0:
...
...
Include/floatobject.h
Dosyayı görüntüle @
428f0641
...
...
@@ -21,10 +21,8 @@ PyAPI_DATA(PyTypeObject) PyFloat_Type;
#define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type)
#define PyFloat_CheckExact(op) ((op)->ob_type == &PyFloat_Type)
/* Return Python float from string PyObject. Second argument ignored on
input, and, if non-NULL, NULL is stored into *junk (this tried to serve a
purpose once but can't be made to work as intended). */
PyAPI_FUNC
(
PyObject
*
)
PyFloat_FromString
(
PyObject
*
,
char
**
junk
);
/* Return Python float from string PyObject. */
PyAPI_FUNC
(
PyObject
*
)
PyFloat_FromString
(
PyObject
*
);
/* Return Python float from C double. */
PyAPI_FUNC
(
PyObject
*
)
PyFloat_FromDouble
(
double
);
...
...
Misc/NEWS
Dosyayı görüntüle @
428f0641
...
...
@@ -28,6 +28,9 @@ TO DO
Core and Builtins
-----------------
- The long-deprecated argument "pend" of PyFloat_FromString() has been
removed.
- The dir() function has been extended to call the __dir__() method on
its argument, if it exists. If not, it will work like before. This allows
customizing the output of dir() in the presence of a __getattr__().
...
...
Objects/abstract.c
Dosyayı görüntüle @
428f0641
...
...
@@ -968,7 +968,7 @@ PyNumber_Float(PyObject *o)
PyFloatObject
*
po
=
(
PyFloatObject
*
)
o
;
return
PyFloat_FromDouble
(
po
->
ob_fval
);
}
return
PyFloat_FromString
(
o
,
NULL
);
return
PyFloat_FromString
(
o
);
}
/* Operations on sequences */
...
...
Objects/floatobject.c
Dosyayı görüntüle @
428f0641
...
...
@@ -62,24 +62,8 @@ PyFloat_FromDouble(double fval)
return
(
PyObject
*
)
op
;
}
/**************************************************************************
RED_FLAG 22-Sep-2000 tim
PyFloat_FromString's pend argument is braindead. Prior to this RED_FLAG,
1. If v was a regular string, *pend was set to point to its terminating
null byte. That's useless (the caller can find that without any
help from this function!).
2. If v was a Unicode string, or an object convertible to a character
buffer, *pend was set to point into stack trash (the auto temp
vector holding the character buffer). That was downright dangerous.
Since we can't change the interface of a public API function, pend is
still supported but now *officially* useless: if pend is not NULL,
*pend is set to NULL.
**************************************************************************/
PyObject
*
PyFloat_FromString
(
PyObject
*
v
,
char
**
pend
)
PyFloat_FromString
(
PyObject
*
v
)
{
const
char
*
s
,
*
last
,
*
end
;
double
x
;
...
...
@@ -89,8 +73,6 @@ PyFloat_FromString(PyObject *v, char **pend)
#endif
Py_ssize_t
len
;
if
(
pend
)
*
pend
=
NULL
;
if
(
PyString_Check
(
v
))
{
s
=
PyString_AS_STRING
(
v
);
len
=
PyString_GET_SIZE
(
v
);
...
...
@@ -852,7 +834,7 @@ float_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"|O:float"
,
kwlist
,
&
x
))
return
NULL
;
if
(
PyString_Check
(
x
))
return
PyFloat_FromString
(
x
,
NULL
);
return
PyFloat_FromString
(
x
);
return
PyNumber_Float
(
x
);
}
...
...
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