g until
3.0 to remove the old way of doing things.
So "at end" or "on normal exit" could be put in any time;
the use of "else" in that context wouldn't go away until 3.0.
The real question is whether it's worth doing at all. I consider
it a fairly minor iss
ething that's meaningful to a human being when
it's printed or otherwise rendered. repr() should be something that
can round trip: that is, if you feed it into eval() it should reproduce
the object.
You can't always achieve either one, especially with very
complex objects, but that's the goal.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
"Donn Cave" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Quoth "John Roth" <[EMAIL PROTECTED]>:
> ...
> | str() should be something that's meaningful to a human being when
> | it's printed or otherwise rendered.
>
d a
unicode string on input; it got a character string already
encoded in utf-8 format. The internal mechanism is first
going to try to decode that into unicode before then
encoding it into utf-8. Unfortunately, the default for
encoding or decoding (outside of special contexts) is
ASCII-7. So everything
"Richard Lewis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> On Thu, 16 Jun 2005 12:06:50 -0600, "John Roth"
> <[EMAIL PROTECTED]> said:
>> "Richard Lewis" <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL
n
builtins. That's the function of the types module.
The other point to be made here is that, in most cases,
type checks are a design smell. That's not always true, but
it's the first thing to check when you see one.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
ing the
socket in promiscuous mode. Either one will give you that symptom.
There are definitely anti-virus products that are that clueless.
Scream at the vendor.
I doubt if it's Idle, but I'm not in the mood to check the code to see
if it's doing it right.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
also makes your variable longer.
>
> >From My point,I think this only help python interpreter to deside
>
> where to look for.
> Is there anyone know's how to make the interpreter find instance name
> space first?
> Or any way to make programmer's life easier?
Guido ha
munity. I
will most likely emphasize those in my documentation.
Providing a method that would translate an arbitrary string into a
valid Python identifier would be helpful. It would be even more
helpful if it could provide a way of converting untranslatable
characters. However, I suspect that the transla
It would ALSO eliminate a whole level of indirection in method
invocation and get rid of the instancemethod, classmethod and
staticmethod wrapper classes. This would be a significant
simplification. If it had been done earlier, it would have eliminated
most of the justification for method attributes (those silly @
things), thus showing that unneeded complexity breeds more unneeded
complexity.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
http://del.icio.us/steve.holden
>
> Sorry, the dog ate my .sigline
I was thinking of starting work on converting Python FIT to 3.0, and
then they posted PEP 3137. I think it's a real good idea, but it shows
that 3.0a1 isn't ready for a conversion effort.
http://www.python.org/de
#x27;t
have hooks where I need them, and it doesn't have a byte code
dedicated to a debugging hook (I think). In other words, the current
coverage.py tool is getting the most out of the available hooks: the
ones we really need just aren't there.
I'd probably opt to rewrite the pr
quot;, or "do the tests exercise
> the 'no iterations' case for this loop", et cetera. That is, whether
> all the functional branches are exercised by tests, not whether the
> language is parsed correctly.
Since
to dig into
the SWIG code before I could figure out what was going on.
Bottom line: the c-types module was a lot smaller, in Python, and
completely comprehensible. And while I didn't measure the performance,
I doubt if it was slower.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
epended on the
default source coding. Fortunately, the fix is (not quite trivially)
easy - just scan the library and put the right coding comment in the
front.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
res
You've got two problems. First, you don't need to encode it; if the
command prompt window displayed your output after encoding it would
display the multi-byte form of your characters. You should just send
it a unicode object.
Second, check the .encoding attribute of the sys.stdout object.
Th
ess natural language. The direction that natural
language processing has taken in the last 50 years has come up lacking
big-time. It does a good job in a single domain, but try to build
something that crosses domains and nothing works. There isn't a good
alternative in sight
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
y.
In particular, the decorator problem goes away (the decorators are
irrelevant, and can be ignored) and so does the problem with injecting
a method into an object.
It is, of course, harder to implement, and it would not be backwards
compatible because all the internal wrappers vanish as well. That
makes problems for anyone who is looking through __dict__ to find
particular kinds of method.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
tance, not
to a class. As another poster said, an instance method
in a class is simply the function object. Static and
class methods require wrappers, but those are both
built-in functions and they also have decorators.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
x27;re checking for a
> file type, you'll want to use isinstance(some_file, io.IOBase). If you're
> inheriting form it, I suggest you look at the io module's classes.
Nontheless, a warning would be helpful, possibly with some doc.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
a random permutation as a way of flushing
out intertest dependencies.
> Does the following patch has a chance of being introduced in the
> standard python distribution?
I certainly hope not!
John Roth
Python FIT
--
http://mail.python.org/mailman/listinfo/python-list
ecipe (
http://aspn.activestate.com/ASPN/Cookbook/Python/ ) or a note in the
documentation with a caveat that it's not good practice, but it may be
useful in some circumstances.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
t implements it.
The general pattern is to get the class for the first operand, check
to see if it has the implementation method, and call it if present. If
it doesn't, get the class for the other operand, check and if it has
the method call it with the operands reversed.
Then if it isn't
d that story around the campfire |
> > _o__) and nobody got scared.” —Jack Handey |
> > Ben Finney
>
>
The PEPs are also a good source; library changes are all listed in PEP
3008. PEP 361 not only gives the schedule but it also gives a lot of
detail
down
the process of the import step by step. There are more productive ways
of banging your head against the wall and going insane.
In your situation, it might be a whole lot easier to extract a common
superclass that both of your classes could inherit from.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
wrong way to
go.
Finally, as Gerhard Haring has said, it's backward incompatible, so
the window for considering it has past: the 3.x series is pretty much
frozen.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
n that calling str() on a bytes object returns a bytes
literal rather than an unadorned character string is that there are no
default encodings or decodings: there is no way of determining what
the corresponding string should be.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
nd ==. I wouldn't mind
seeing a way of assigning in the middle of an expression because it
comes up fairly frequently when one needs to do a test and save the
result at the same time. However I absolutely do not want to see the
operator be =.
However, if it's not =, then it opens another can of worms, that is,
what to call it, and where it fits into the precedence structure. <--
might work.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
them. Compare Rake and
Scons - the Ruby and Python embedded DSL build systems that are
intended to replace Make, Ant and similar external build DSLs. You can
see the difference in fluency.
John Roth
Python FIT
--
http://mail.python.org/mailman/listinfo/python-list
mpiler. There's a place in the runtime
for invoking a method where the object is inserted at the beginning
of the parameter list. IIRC, that's done by wrapping the function
object.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
which object.
Summary: I like it, but I think it needs a bit more work.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
not all) of the warts
removed and some more modern features added. Brought to you
by the same people who brought you C and Unix all those years ago.
The use of the Plan 9 toolchain is not a coincidence.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
ng to take more work to get the point across
that comments that reproduce what the method name says are waste.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
iness. There's a reason why commercial products come with huge data
bases -- it's impossible to parse everything correctly with a single
set of rules. Those data bases also contain the actual street names
and address ranges by zip code, so that direct marketing files can be
cleansed to US
hey know now. That's not a
joke - look at the names on the development team.
I haven't a clue how anyone can think it's similar to Python. Or Java,
for that matter.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
t; `\ approaches zero. All non-Free software is a dead end.” —Mark |
> _o__) Pilgrim, 2006 |
> Ben Finney
You might also want to look at PEP 3152, which was just posted.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
>
> In [12]: f = Foo()
>
> In [13]: print f
> foo
Maybe what the OP really wants is the format() method on a string?
That gives a very rich set of override options, at the expense of not
using the print statement/method, including the ability to define your
own formatting language for a class.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
tring] = unicode(value, 'UTF-8')
> TypeError: decoding Unicode is not supported
>
> The solution I've arrived at is to specify the encoding for value
> strings both when reading and writing value strings.
>
> for k, v in valuesDict.iteritems():
> valuePair =
th Paul, any global table trying to do that is going to be
pretty bogus.
John Roth
--
http://mail.python.org/mailman/listinfo/python-list
201 - 239 of 239 matches
Mail list logo