easy way to construct or to interrogate ctypes objects from C is a
legitimate complaint... and if you can define your requirements, it
should be relatively easy to add a C interface to meet those needs.
-- Michael Chermside
___
Python-Dev mailing list
something clearer than my suggestion,
but in my own head, the terms head and tail are tighly bound
with the idea of beginning and end (respectively) rather than with
the idea of small part chopped off and big part that is still
choppable.
-- Michael Chermside
that
raise exceptions suffer), but I think it would be more friendly to
use warnings for now and exceptions after another full release
cycle. The warnings should solve the underlying issue (hard-to-debug
problems).
-- Michael Chermside
___
Python-Dev mailing
should note this policy someplace official -- perhaps
in the Language Reference where __eq__ and __lt__ are defined. But
I do not think that these changes should be made until Py3K.
What do others think? Is this the right approach?
-- Michael Chermside
will not help with my example. I'm not sure the
motivation for breaking code like that example -- the bug-hunting
motivation is satisfied by issuing a warning as Michael Urman proposes,
then use an exception after one more release when people have had time
to fix their code.
-- Michael Chermside
.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Marc-Andre Lemburg writes:
How about generating a warning instead and then go for the exception
in 2.6 ?
Agreed. Michael Hudson's explanation convinced me.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http
they are supported by specialized hardware,
then I'd go along, but they're not a better model.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman
of precision to your numbers / lookup tables / whatever.
If so, then even more credit needs to be given to the system that
supports adjustable precision (the Decimal module).
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http
object pools.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
of Python code cannot access or communicate
with certain Python objects in the same interpreter.
E. A given piece of Python code can access only a limited set
of Python objects in the same interpreter.
Hmmm. I'm not sure.
-- Michael Chermside
bound to a given file (perhaps open()).
Essentially, we give up on hiding file, which is a frequently-used
type, and very hard to hide, and instead we rely on our ability to
write a reliably secure SecureFileWrapper class (in C).
-- Michael Chermside
memory.)
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
been working on that 'whee'/'.whee' prohibition,
but he hasn't mastered it yet.
Gotta-go-wash-another-load-of-underpants -lly yours,
Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
, it would simplify a bit
of your proposal, and make me feel a little less worried.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options
to achieve
the user-customizability of capabilities without throwing
out the entire standard library -- maybe some hybrid of
resource hiding and resource crippling. I can almost see
a way to achieve it, but there are still a few flaws.
-- Michael Chermside
explanation of the tradeoffs
or at least a link to such an explanation.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python
that Michele's proposal is that inspect.isgenerator() (or
perhaps inspect.isgenfunc()) would return True for foo and bar
but false for foo_or_bar. Can you give a single use case for which
that distinction is desirable?
-- Michael Chermside
___
Python-Dev
)
This violates the specification given above... it has non-escaped '}'
characters. Make up one rule and be consistant.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http
to the above ideas...
I wouldn't have said anything if you hadn't asked what my approach
would be.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http
obvious to me from the start. The ability to use callable objects as
functions is a powerful tool in Python, and ought not be broken by decorator
inconsistencies.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org
database.oracle
there's no need to group the SQL databases.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive
, there
are literally hundreds of thousands of not-very-skillful Java programmers
out there. Yet it is rare to see them write catch Throwable when they
should use catch Exception. That mistake is far more common among
beginning Python users. Surely we can do at least as well as Java!
-- Michael Chermside
PS
to threading, I think it is unwise to build such a
feature into the Python language. Supporting it in CPython only
requires (I think) no more than a very simple C extension. I think
it should stay as an extension and not become part of the language.
-- Michael Chermside
business model. Good luck!
-- Michael Chermside
(PS: too bad I can't buy stock in Coverity. How come all the GOOD
companies are private? I had to wait around 6 years before I could
buy stock in Google.)
___
Python-Dev mailing list
Python-Dev@python.org
http
.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
certain vote-counting software where the true behavior needed
to remain obscure even in the face of source code publication.[1]
-- Michael Chermside
[1] http://graphics.stanford.edu/~danielrh/vote/scores.html
___
Python-Dev mailing list
Python-Dev@python.org
for next() won't hurt, but if we make a
practice of it we'll eventually have too many).
All told, I prefer using the underscores. I think that the first
invariant is important. But it's a judgement call, and a close one, so
I'll be happy with either decision.
-- Michael Chermside
used to 3.0 yet. I'll need to borrow
the time machine for a little longer before my fingers really pick up on
the 3.0 names and idioms.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python
.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
A minor related point about on_missing():
Haven't we learned from regrets over the .next() method of iterators
that all magically invoked methods should be named using the __xxx__
pattern? Shouldn't it be named __on_missing__() instead?
-- Michael Chermside
). If a
_trivial_ decision is already made, there's no need for a
PEP, but if a difficult decision has been made, then
documenting it in a PEP saves years of having to justify
it to newbies.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev
if we're honest about what are the accidents -- every language or
software package has some, and just because it's an accident does NOT
mean we should fix it.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org
would be simpler.
Of course, the person who REALLY gets to decide how it works isn't me;
it's whoever decides to spend the time to BUILD this system.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman
this particular note belongs to so the doc editors can read only the ones
that people thought ought to be included in the docs.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe
) use cases for abstract base classes of fundamental types.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive
__len__. Perhaps the container uses an algorithm to generate the
items and is effectively of infinite size. In your hierarchy, this
wouldn't even be a basecontainer (and thus, clearly not a
basesequence). But if all you want to do is to use __getitem__ then
it ought to work fine.
-- Michael Chermside
the conversation that preceded putting that into
PEP 8, and the impetus for that particular decision was input from
non-native English speakers (particularly those not coming from a
European alphabet) that it was far easier to read with underscore
separation rather than capWords.
-- Michael Chermside
_do_ believe that
the lack of such conventions is a bit distracting. (Not enough to
make me prefer Java, of course!)
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe
the user
specially imports the pure-python version. Perhaps importing
xml.etree gets you cElementTree unless that isn't compiled on your
platform, but you can import xml.pure_python.etree or something
like that to get the pure Python version if you really want it.
-- Michael Chermside
handle
either choice. If others felt like me, then its likely that the
backward compatibility argument and the need to fight the pervasive
meme that Python is slow will win the day.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
that
works well with Python would NOT be rejected. The idea is interesting,
and it _may_ be sound; only an actual implementation could prove this
either way.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman
common in most
situations. A beneficial side-effect is that the default behavior
of __eq__ is QUITE simple to explain, and if the implementation is
easy to explain then it may be a good idea.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev
, and
there wouldn't have been any need for discussion.
Oh yeah, and you can also put extra info into an exception object
besides just the error message. (We don't do that as often as we
should... it's a powerful technique.)
-- Michael Chermside
___
Python-Dev
by renaming it until 3.0 arrives.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Aahz writes:
I'm suggesting that we add a doc note that using the thread module is
discouraged and that it will be renamed in 3.0.
Then we're apparently all in agreement.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http
and Queue.Queues are True...
it follows the general rule that everything is true except the above
(short) list of objects and user-defined (or library) classes that
want to mimic the behavior of one of these or have some obvious
meaning for non-true.
-- Michael Chermside
opinion.
Thanks Guido, for maintaining your patience in the face of this
discussion.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman
that
using star unpacking in tuple and list literals is an idea that
I'm sure I've seen proposed at least a couple of times before.
This doesn't necessarily make it a good idea, nor a bad one.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev
is technically an error (although in many OSs
you'll get away with it).
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python
interpreter by using the @ .fture. command.
I love making Perl users jealous, so I certainly wouldn't vote less than
-0 (I don't care so why bother) on a proposal like this one.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http
only within subscripts and thus do not
conflict with this use.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive
because modern operating systems (like Windows) have two
distinct file types.
Don't blame the language designers, blame the OS folks.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
to instrument a JVM to record how often
the underlying buffers are shared, then run some common Java apps. Since
the feature is exactly analogous to what is being proposed here, I would
find such such analysis very helpful.
-- Michael Chermside
___
Python-Dev
if it weren't).
Simplicity and elegence are two of the reasons that this is such
an excellent proposal, let's not lose them. We have existing
tools (like split() and the re module) to handle the tricky
problems.
-- Michael Chermside
___
Python-Dev mailing list
everything I write these days is larger and more complex, but
I retain a soft spot for short simple scripts and want Python to
continue to be the best tool available for these tasks.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http
to supply a patch.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
, that you use a new subject
header. It will make it easier for the Python-Dev summary
authors and for the people who look back in 20 years to ask
That str.partition() function is really swiggy! It's everywhere
now, but I wonder what language had it first and who came up with
it?
-- Michael Chermside
, if the use of bare except:
is all you are interested in it is quite easy to grep the code to
find all uses.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http
[PLEASE IGNORE PREVIOUS EMAIL... I HIT [Send] BY MISTAKE]
Guido:
But how about the following compromise: make it a silent deprecation
in 2.5, and a full deprecation in 2.6.
Reinhold Birkenfeld:
That said, I think that unless it is a new feature (like with statements)
transitions to Python
. So I don't see any advantage to keeping bare except: in the
long run. What we do to ease the transition is a different question,
but one more easily resolved.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org
, and having only one kind of
except clause for try statements is clearly simpler than having both except
some-exception-type: and also bare except:.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo
it with a sentence or two that DID introduce the (revised) str() function,
it ought to work. In particular, it could mention that you can call str()
on any object, which isn't stated here at all.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev
I'm
going to go frame this and have it posted in my cubical.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive
.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
to those who need
them (not everyone uses threads!), and it rather forcefully makes the
point that it's NOT usually a good idea to modify global state info in
a context manager because doing so is not generally threadsafe.
-- Michael Chermside
___
Python-Dev
... these docs read quite nicely.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
the door
dividing outside from inside. If you accept this connotation, then
it's clear that exit is a closer match for the with statement's
behavior than leave.
Anyway, this stuff is always very subjective and, as I said, I'm just
expressing an opinion. So take it for what it's worth.
-- Michael
a subprocess.CLOSED constant, which if
passed to Popen causes a new closed file descriptor to be given to the
subprocess.
-1.
It is easy enough to create a closed FD to read from... why complicate the
API?
-- Michael Chermside
___
Python-Dev mailing list
Python
not offer access to the flags and traps), but this is one of those
few cases where it's worth using platform-and-compiler specific code.
Of course, someone still has to step forward and offer to code it.
-- Michael Chermside
___
Python-Dev mailing list
:
fail('Should not have raised TypeError')
There ARE situations when you want to allow an exception (but not
necessarily expect it) and do nothing when it occurs, but I don't
find them all that common, and I certainly don't find them arising
in unit tests.
-- Michael Chermside
Gerrit Holl writes:
What would happen if...
Raymond replies:
Every molecule in your body would simultaneously implode at the speed of
light.
So you're saying it triggers C-language undefined behavior?
-- Michael Chermside
___
Python-Dev mailing
happened to Not every 3 line function needs to be a builtin?
It's a common pattern. It's easy to do. Where's the problem?
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe
it. What
am I missing?
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
done on real code. But it's
a cool optimization if it actually pays off.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python
way to write that code, and that I was just not
smart enough to have realized it until he showed me.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http
to examine
bugs that got closed without proper investigation. I'm not holding my
breath.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org
in with a detailed
and well-considered explanation of his thoughts on the matter.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options
in Java. Wouldn't it be nice if Python could do better?
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail
?
(By the way... even if other constructors begin to respect context
precision, the constructor from tuple should NOT -- it exists to provide
low-level access to the implementation. I'll express no opinion on the
constructor from Decimal, because I don't understand the issues.)
-- Michael Chermside
:
import decimal
decimal.getcontext().prec = 4
decimal.getcontext().create_decimal(1.234567890)
Decimal(1.235)
Frankly, I have no idea WHAT purpose is served by passing a context
to the decimal constructor... I didn't even realize it was allowed!
-- Michael Chermside
Decimal OBJECTS.) So I fear that the whole with_extra_precision()
idea is just likely to tempt people into introducing subtle bugs, and
it should probably be scrapped anyhow. Guido's approach to save-and-
restore context works fine.
-- Michael Chermside
(PS: Another reason that I avoided a basic
not important enough to incurr other penalties.
So in this case, I (reluctantly, after giving myself quite a talking-to)
favor having the 'with' statement with VAR create said variable in the
appropriate scope as a side-effect, much like 'for'.
-- Michael Chermside
the appropriate cleanup (or locking, or whatever), but it doesn't
happen.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev
that allowing the use of generators
instead of classes with the do_template decorator is quite nice in
practice, even though it gets confusing (for beginners anyhow) if you
start to think about it too much.
-- Michael Chermside
# = SAMPLE #1: increasing precision during a sub-calculation =
import
== or the
y = VARIES has a totally different *meaning* to the programmer
than one in which the x == or y = is the same for every
single branch.
But let's not start discussing conditional expressions now,
because there's already more traffic on the list than I can read.
-- Michael Chermside
want to prohibit nothing, then the right
solution is macros.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive
.
Well, that's a lot of wanting... now I all I need to do is invent a
clever syntax that allows these in an elegant fashion while also solving
Guido's point about imports (hint: the answer is that it ALL happens at
runtime). I'll go think some while you guys zoom past me again. wink
-- Michael
for Python before I could begin to consider it.
If I understand it properly, pattern matching in Haskell relies
primarily on Haskell's excellent typing system, which is absent in
Python.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev
this) that if you mangle
these then the code object won't work correctly. If anyone's got a
suggestion for fixing this, I'd love to hear it.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
installs, and
I found no problems anywhere. Nice work!
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail
if the deprecated function
is invoked via reflection. It's a fundamental difference in style between
the two languages: Python barely even HAS a compile phase, and Python
programs tend to be far more dynamic than Java.
-- Michael Chermside
___
Python-Dev
map, filter, and reduce into the functional module now that it exists.
This doesn't create any need or pressure to remove these as builtins, but
it does contemplate a day when we might choose to make such a choice.
-- Michael Chermside
___
Python-Dev
this applies to libmd.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
this old code which is
violating the rules doesn't get broken.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive
adaptation because they think they know what they're doing
or because they're in a big hurry and it's the most convenient
tool at hand.
I wish I lived in your world, but I don't.
-- Michael Chermside
[1] - Except for Eiffel. Eiffel seems to do a pretty good job
of enforcing
name seems unbeatably
clear and concise.
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
the trick.
I just got notification of the change to PEP 246 (and I haven't received
other checkin notifications), so I guess I can report that this is
working.
Thanks, Barry. Should we now mention this on c.l.py for others who
may be interested?
-- Michael Chermside
?
-- Michael Chermside
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
99 matches
Mail list logo