Jervis Whitley added the comment:
Here is a patch to document string argument requirements.
--
keywords: +patch
Added file: http://bugs.python.org/file18686/complex_doc.diff
___
Python tracker
<http://bugs.python.org/issue9
Jervis Whitley added the comment:
I can write a documentation patch for this:
http://docs.python.org/library/functions.html?highlight=complex#complex
to highlight the expected format of the string argument.
As others have pointed out here, there are a number of other options available
to
Jervis Whitley added the comment:
It hadn't occurred to me to try this without spaces. Thank you for pointing
this out. Agreed that the enhancement is not essential.
--
___
Python tracker
<http://bugs.python.org/i
New submission from Jervis Whitley :
complex() raises ValueError when parsing a string argument containing both real
and imaginary where one of the real or imaginary is a decimal.
To reproduce:
>>> complex("1.1 + 2.1j")
ValueError: complex() arg is a malformed string
>&
Jervis Whitley added the comment:
> Matthew suggested ~= instead of -> or "as".
Try the patch, you can make changes (for those that aren't aware)
by changing the token in Grammar/Grammar to whatever you wish. It is easy
to do and you need only recompile after this step.
Jervis Whitley added the comment:
> Regarding the proposed syntax:
> if (f() == 'spam') -> name:
> newname = name.replace('p', 'h')
> Surely that should assign the *bool* result of comparing f()
> with 'spam' to name? Doing anythin
Jervis Whitley added the comment:
> If we allow this, how many of the following will be allowed?
> if expr as name:
> while expr as name:
> expr as name # alternative to "name = expr"
This patch implements your final point:
expr as name (albeit with a nominal '
Jervis Whitley added the comment:
Hi,
I like this idea.
I've put together a short patch that will implement inline
assignment.
if f() -> name:
use(name)
or more powerfully:
if f() -> name == 'spam':
usespam(name)
the old syntax if something as x: is still avai
Jervis Whitley added the comment:
I can still reproduce on py3
>>> help("modules anything")
Traceback (most recent call last):
...
This patch works (on Py3.1a1).
Amaury, are you still o.k with catching Exception rather
than just (SyntaxError, UnicodeDecodeError, Impo
Jervis Whitley added the comment:
Hi all,
This patch takes the approach of assuming utf-8 format encoding
for files opened with 'rb' directive.
That is:
1. Check if each line is Unicode Or Bytes Type.
2. If Bytes, get char array reference to internal buffer.
3. use PyUnicode_Fro
Jervis Whitley added the comment:
Hi Skip,
Currently, once we are sure the lineobj is a unicode obj we then
get it's internal buffer using:
line = PyUnicode_AsUnicode(lineobj);
for the purpose of iterating through the line.
is there an opportunity to use:
line = PyBytes_AsString(li
Jervis Whitley added the comment:
in _csv.c, the check is done here:
lineobj = PyIter_Next(self->input_iter);
if (lineobj == NULL) {
/* End of input OR exception */
if (!PyErr_Occurred() && self->field_len != 0)
PyErr_Format(error_obj,
"ne
Changes by Jervis Whitley :
--
nosy: +jdwhitley
nosy_count: 1.0 -> 2.0
___
Python tracker
<http://bugs.python.org/issue5455>
___
___
Python-bugs-list mai
Jervis Whitley added the comment:
Updated version of docs for 2.7 and 3k.
--
message_count: 29.0 -> 30.0
Added file: http://bugs.python.org/file13274/ntreader6_py3.diff
___
Python tracker
<http://bugs.python.org/iss
Changes by Jervis Whitley :
Added file: http://bugs.python.org/file13275/ntreader6_py27.diff
___
Python tracker
<http://bugs.python.org/issue1818>
___
___
Python-bug
Changes by Jervis Whitley :
Removed file: http://bugs.python.org/file13268/ntreader5_py3_1.diff
___
Python tracker
<http://bugs.python.org/issue1818>
___
___
Python-bug
Jervis Whitley added the comment:
Antoine> I don't understand why NamedTupleReader requires the
Antoine> fieldnames array
Antoine> rather than the namedtuple class itself. If you could pass it
Antoine> the namedtuple class, users could choose whatever namedtuple
Antoi
Jervis Whitley added the comment:
Jervis> in csv.rst removed reference to reader.next() as a public method.
Skip> Because? I've not seen any discussion in this issue or in any
Skip> other forums
Skip> (most certainly not on the c...@python.org mailing list) which
would S
Jervis Whitley added the comment:
Added a patch against py3k branch.
in csv.rst removed reference to reader.next() as a public method.
Added file: http://bugs.python.org/file13263/ntreader4_py3_1.diff
___
Python tracker
<http://bugs.python.org/issue1
Jervis Whitley added the comment:
Skip> Let me be more explicit. I don't know how it implements it, but I
think
Skip> you really need to give the user the option of specifying the
field
Skip> names and not reading/writing headers. It can't be implicit as I
Skip> int
Jervis Whitley added the comment:
Updated NamedTupleReader to give a rename=False keyword argument.
rename is passed directly to the namedtuple factory function to enable
automatic handling of invalid fieldnames.
Two new tests for the rename keyword.
Cheers,
Added file: http
Jervis Whitley added the comment:
An implementation of a namedtuple reader and writer.
Created a writer for the case where user would like to specify
desired field names and default values on missing field names.
e.g.
mywriter = NamedTupleWriter(f, fieldnames=['f1',
22 matches
Mail list logo