. Seems
Regards,
Bengt Richter
On 2/20/06, Almann T. Goo [EMAIL PROTECTED] wrote:
I am considering developing a PEP for enabling a mechanism to assign to free
variables in a closure (nested function). My rationale is that with the
advent of PEP 227 , Python has proper nested lexical scopes
On Tue, 21 Feb 2006 05:58:52 -0800, Guido van Rossum [EMAIL PROTECTED]
wrote:
On 2/20/06, Bengt Richter [EMAIL PROTECTED] wrote:
How about doing it as an expression, empowering ( ;-) the dict just afer
creation?
E.g., for
d = dict()
d.default_factory = list
you could write
thought: binary octets aren't numeric ;-)
Regards,
Bengt Richter
___
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
are made of octets that have no instrinsic numerical or character significance.
See other post if interested ;-)
Regards,
Bengt Richter
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe
[k] would only call d.default_factory if the latter was set and the
key was missing
even after on_missing (if present) did something (e.g., it could be logging
passively).
Regards,
Bengt Richter
___
Python-Dev mailing list
Python-Dev@python.org
http
you can't live long enough to complete it ;-)
Regards,
Bengt Richter
___
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
it could always
act either way if defined.
Also, for those wanting to avoid lambda:42 as factory, would a callable test
cost a lot? Of course then the default_factory name might require revision.
Regards,
Bengt Richter
___
Python-Dev mailing list
Python-Dev
-character substitution)
I think at least a tweaked translate method for bytes would be good for py3k,
and I hope we can do it for str.translate now.
It it is just too handy a high speed conversion goodie to forgo IMO.
Regards,
Bengt Richter
___
Python-Dev
?
See above.
Regards,
Bengt Richter
___
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
):
return bytes(%s) % repr(list(self))
def __add__(self, other):
if isinstance(other, array):
return bytes(super(bytes, self).__add__(other))
return NotImplemented
Cool, thanks.
Regards,
Bengt Richter
when the gas price was just below 10 SEK/L,
but they found a way...
IIRC Guido is on record as saying There will be no Python 2.10 because
I hate the ambiguity of double-digit minor release numbers, or words to
that effect.
Hex?
Regards,
Bengt Richter
)'
Regards,
Bengt Richter
___
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
is sugar for b.__get__(a) (or the instancemethod equivalent)
(faked)
'expr' - baz
bound method ?.baz of 'expr'
(actual)
baz.__get__('expr')
bound method ?.baz of 'expr'
and then
baz.__get__('expr')('zee')
'baz(expr, zee)'
What do you think?
Regards,
Bengt Richter
yes, please ban string.decode and bytes.encode.
And maybe introduce bytes.recode for bytes-bytes transforms?
(strings don't have any codes to recode).
Regards,
Bengt Richter
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman
, so I guess it could also temporarily be a cdrom even.
Regards,
Bengt Richter
___
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
? type('Foo',(), **{'this':'one?'})
It will be interesting to see what comes out of the woodwork ;-)
Regards,
Bengt Richter
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http
= f.read(bufsize)
and plug in
by_byte_ords(path)
___
BTW, bytes([]) would presumably be the file.bytes EOF?
Regards,
Bengt Richter
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
thinking single-byte ord value.).
BTW, should bytes be freezable?
Regards,
Bengt Richter
___
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
after py3k turns them into unicode).
BTW, I posted one (I think) other post with this essential idea, and there are
a lot
of posts I am tempted to respond to, but I will restrain myself ;-)
Regards,
Bengt Richter
___
Python-Dev mailing list
Python-Dev
deciding on appropriate methods
and how the type should be defined. It's the same peculiar problem
as str, i.e., length one would be compatible with int, but not other lengths.
How do we do that?
Regards,
Bengt Richter
___
Python-Dev mailing list
Python
source code in several encodings including utf-8
and comiled with coding cookies and exec'd the result)
I could always have overlooked something, but I am hopeful.
Regards,
Bengt Richter
___
Python-Dev mailing list
Python-Dev@python.org
http
will mostly be writing and collecting rationale references etc.
That's really not my favorite kind of work, frankly. But I like thinking and
programming.
Regards,
Bengt Richter
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman
(binaryfile('path'))): ...
which doesn't have the same natural left to right reading order to match
processing order.
Regards,
Bengt Richter
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe
. Note
that my patch does not change PyObject_Str(); that would break
massive amounts of code. Instead, I introduce a new function:
PyString_New(). I'm not crazy about the name but I couldn't think
of anything better.
On 2/10/06, Bengt Richter [EMAIL PROTECTED] wrote:
Should
',
'sort']
But some kind of standards would probably be nice for everyone if they like the
general idea.
I'll leave it to someone else as to whether and where a thread re help
enhancements
might be ok.
My .02USD ;-)
Regards,
Bengt Richter
___
Python-Dev
Regards,
Bengt Richter
___
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
On Sat, 11 Feb 2006 14:14:00 +0100, =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
[EMAIL PROTECTED] wrote:
Bengt Richter wrote:
Will a typedef help?
A typedef can never help. It is always possible to reformulate
a program using typedefs to one that doesn't use typedefs.
I realize that's true
= freeze(d)
fd
{'a': 1, 'b': 2}
fd['a']
1
fd['a']=3
Traceback (most recent call last):
File stdin, line 1, in ?
File alt351.py, line 7, in _immutable
raise TypeError('object is immutable')
TypeError: object is immutable
type(fd)
class 'alt351.imdict'
+0 ;-)
Regards,
Bengt
, for read-only access to the data? (hope I got that right).
(also testing whether I have been redirected to /dev/null ;-)
Regards,
Bengt Richter
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe
of code. Instead, I introduce a new function:
PyString_New(). I'm not crazy about the name but I couldn't think
of anything better.
Should this not be coordinated with PEP 332?
Regards,
Bengt Richter
___
Python-Dev mailing list
Python-Dev@python.org
above just as example, not saying it makes sense
for collection.visit)
Regards,
Bengt Richter
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python
be a typo mutation of clue ;-)
+1 on something with hint.
Regards,
Bengt Richter
___
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
TypeError: return 0))
and
(lambda c1,c2:lambda x:c0+c1*x)(3,5) # also silly with constants
I'm not sure. I think I kind of like lambda args:expr and (lambda args::suite)
but sometimes super-concise is nice ;-)
2) Remove lambda entirely.
-1
Regards,
Bengt Richter
for start:stop:step I believe,
and something[slice(whatever)] will call something.__getitem__ with the slice
instance, though this is neither a fast nor nicely spelled way to customize.
Regards,
Bengt Richter
___
Python-Dev mailing list
Python-Dev
with
It's a hard problem ... For example, consider this hypothetical
example: ...
;-)
Regards,
Bengt Richter
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org
, for the OP, chasing minimum float values is probably best done with powers
of 2
math.ldexp(1, -1074)
4.9406564584124654e-324
math.ldexp(1, -1075)
0.0
.5**1074
4.9406564584124654e-324
.5**1075
0.0
math.frexp(.5**1074)
(0.5, -1073)
math.frexp(.5**1075)
(0.0, 0)
Regards,
Bengt Richter
On Mon, 6 Feb 2006 09:05:01 +0100, Thomas Wouters [EMAIL PROTECTED] wrote:
On Mon, Feb 06, 2006 at 05:33:57AM +, Bengt Richter wrote:
Perhaps I missed a py3k assumption in this thread (where I see in the PEP
that Remove distinction between int and long types is core item number
one
On Sat, 04 Feb 2006 11:11:08 +0100, =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
[EMAIL PROTECTED] wrote:
Bengt Richter wrote:
The typical way of processing incoming ints in C is through
PyArg_ParseTuple, which already has the code to coerce long-int
(which in turn may raise an exception
.
Psst, Nick, how about
(x*y for x,y in ()) ? # () as mnemonic for call args
;-)
Regards,
Bengt Richter
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman
On Sun, 05 Feb 2006 09:38:35 -0800, Josiah Carlson [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] (Bengt Richter) wrote:
Martin v. Lowis [EMAIL PROTECTED] wrote:
Bengt Richter wrote:
The typical way of processing incoming ints in C is through
PyArg_ParseTuple, which already has the code
: The language should be as
simple
as possible, but no simpler.
/rant
++1 QOTW
Regards,
Bengt Richter
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options
On Sun, 05 Feb 2006 18:45:52 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote:
[...]
Psst, Nick, how about
(x*y for x,y in ()) ? # () as mnemonic for call args
D'oh, sorry, that should have been illegal syntax, e.g.,
(x*y for x,y in *) ? # * as mnemonic for call *args
so
(x*y for x,y
On Thu, 2 Feb 2006 20:39:01 -0500, James Y Knight [EMAIL PROTECTED] wrote:
On Feb 2, 2006, at 10:36 PM, Bengt Richter wrote:
So long as we have a distinction between int and long, IWT int will
be fixed width
for any given implementation, and for interfacing with foreign
functions
you can guess my vote is for anonymous def ;-)
Guido was rather unenthused the last time this topic came up, though, so maybe
it isn't worth the effort. . . (although he did eventually change his mind on
PEP 308, so I haven't entirely given up hope yet).
Likewise ;-)
Regards,
Bengt Richter
to check whether the
Python-Dev crowd would just blast it out of the waters, in which case
I may save writing it...
-0 ;-)
Regards,
Bengt Richter
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe
On Fri, 03 Feb 2006 19:10:42 +0100, Christian Tismer [EMAIL PROTECTED] wrote:
Bengt Richter wrote:
...
BTW, re def-time bindings, the default arg abuse is a hack, so I would like
to
see a syntax that would permit default-arg-like def-time function-local
bindings without
affecting
On Fri, 03 Feb 2006 19:56:20 +0100, =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
[EMAIL PROTECTED] wrote:
Bengt Richter wrote:
If you are looking at them in C code receiving them as args in a call,
treat them the same would have to mean provide code to coerce long-int
or reject
31 as
sign).
Regards,
Bengt Richter
___
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
On Thu, 2 Feb 2006 15:26:24 -0500, James Y Knight [EMAIL PROTECTED] wrote:
On Feb 2, 2006, at 7:11 PM, Bengt Richter wrote:
[1] To reduce all this eye-glazing discussion to a simple example,
how do people now
use hex notation to define an integer bit-mask constant with bits
On Thu, 02 Feb 2006 23:46:00 +0100, =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
[EMAIL PROTECTED] wrote:
Bengt Richter wrote:
[1] To reduce all this eye-glazing discussion to a simple example,
how do people now
use hex notation to define an integer bit-mask constant with bits
out of some names:
664'8
bee'16
Regards,
Bengt Richter
___
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
;-)
Regards,
Bengt Richter
___
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
On Wed, 01 Feb 2006 09:47:34 -0800, Josiah Carlson [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] (Bengt Richter) wrote:
On Wed, 01 Feb 2006 12:33:36 +, Gustavo J. A. M. Carneiro [EMAIL
PROTECTED] wrote:
[...]
Hmm.. I'm beginning to think 13r16 or 16r13 look too cryptic to the
casual
showing the bits
as they are in two's complement or with the bits grouped to show as hex or
octal digits etc. And 16cf8000 would become a 32-bit int, not a long as
would -0x8000 (being a unary minus on a positive value that is promoted to
long).
Regards,
Bengt Richter
At 11:43 2005-10-24 +0200, M.-A. Lemburg wrote:
Bengt Richter wrote:
Please bear with me for a few paragraphs ;-)
Please note that source code encoding doesn't really have
anything to do with the way the interpreter executes the
program - it's merely a way to tell the parser how to
convert
on reliable inferences from source
encodings of
string literals or from their effects as format strings.
Regards,
Bengt Richter
[not a normal subscriber to python-dev, so I'll have to google for any
responses]
___
Python-Dev mailing list
Python-Dev
56 matches
Mail list logo