David W. Lambert added the comment:
(prospective, not perspective programmer)
Spelling out the possibilities as suggested in Message80563 makes better
sense to me than writing in words the logic handling the mode argument
of the io.open function. (Perhaps there is a clearer implementation
David W. Lambert added the comment:
Nice. Now I know that $e$ is a least transcendental number. But I
can't figure out why inserting this code into your file (and removing
some "itertools.") is difficult or unreadable. I maintain a personal
library of modules that I don
David W. Lambert added the comment:
Probably a better prime factor algorithm uses Sieve of E. to generate
primes through int(1+sqrt(n)) and test these.
The other algorithm uses a custom generator anyway. Oh well, good luck,
I'll shut up.
You do have use cases that I couldn't think
Changes by David W. Lambert :
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue1397474>
___
___
Python-bugs-list mailing list
Unsubscribe:
David W. Lambert added the comment:
I'd prefer round(x,positive_integer) return float. Returning int is a
bit of a lie, except that the decimal module is available to avoid this
sort of lie.
For non-positive integer roundings I'd like an integer return.
In my opinion, we'
David W. Lambert added the comment:
The value of one of the arguments controls how many digits there are.
Certainly if you rounded $10 to the nearest cents you'd expect $10.00.
Thus round(10,2) should be 10.00. Without using decimal module, the
best we can do is produce 10.0.
I'
David W. Lambert added the comment:
The del statement makes the variable local, as alluded to by
http://docs.python.org/dev/3.0/reference/simple_stmts.html#the-del-
statement
The manual is clearer about assignments, which are local unless declared
global or nonlocal.
For other question, me
David W. Lambert added the comment:
My second answer is irrelevant. Function receives the global data as
well as the arguments.
___
Python tracker
<http://bugs.python.org/issue5
Changes by David W. Lambert :
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue5099>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by David W. Lambert :
___
Python tracker
<http://bugs.python.org/issue4174>
___
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/o
Changes by David W. Lambert :
___
Python tracker
<http://bugs.python.org/issue4174>
___
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/o
David W. Lambert added the comment:
The alternative is unreasonable. I doubt you'd be happy with this:
a = 'Something'
def variable_both_global_and_local()->Exception('No good!'):
del a# delete a from global name space
a = 'anotherthing
David W. Lambert added the comment:
memcpy won't work if the data type changes. (possibly signed <->
unsigned same-byte-count works).
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python
David W. Lambert added the comment:
#Ah! Not a problem. You need globals() and locals() dictionaries.
# as a python3 script, this message produces next couple lines output.
#method one
#yup, global a is gone
#method two
#{'gv': 'local here', 'name': '
David W. Lambert added the comment:
Python 3.0rc1+ (py3k, Nov 5 2008, 14:44:46) [GCC 3.4.6 20060404 (Red
Hat 3.4.6-3)] on linux2 Type "help", "copyright", "credits" or "license"
for more information.
>>> ' '.
Changes by David W. Lambert :
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue5142>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by David W. Lambert :
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue5157>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from David W. Lambert :
Allow logger object log message creation methods using ''.format method.
have:
logger_object.info('%s','lazy is better')
logger_object.debug('{0!s}'.format('wasted effort'))
want:
logger_object.
New submission from David W. Lambert :
help function is not current, then again, neither is my python3.
Possibly sequencemethods[12] are eradicated.
$ p3
Python 3.0rc1+ (py3k, Nov 5 2008, 14:44:46)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on linux2
Type "help", "copyright
David W. Lambert added the comment:
"x |= x>>4"
Are you (Ray) sure you didn't mean
"x ^= x>>4"?
--
nosy: +LambertDW
___
Python track
David W. Lambert added the comment:
I run my shells with low priority so I can sneak around and kill them.
___
Python tracker
<http://bugs.python.org/issue5032>
___
___
Changes by David W. Lambert :
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue5229>
___
___
Python-bugs-list mailing list
Unsubscribe:
David W. Lambert added the comment:
'{d}{s}{f}'.format(3, 'foo', 3.14)
is possibly unclear,
but is shorter than
'{#d}{#s}{#f}'.format(...)
--
nosy: +LambertDW
___
Python tracker
<
David W. Lambert added the comment:
I am net yet fluent in format method. I meant
":" where "#" appeared.
Anyway, I think you need the colon.
If from
print('{0:9}'.format(33))
you make the argument number implicit and remove the colon you'd get
prin
David W. Lambert added the comment:
Answering first question msg81873.
Without colon separator, this might be considered confusing:
>>> (
... '{d}{s}{f}{f}'.format(3, 'foo', 3.14, 2.72),
... '{d}{s}{f}{f}'.format(d=3, s='foo', f=3
Changes by David W. Lambert :
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue5247>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from David W. Lambert:
http://forums.devshed.com/newreply.php?do=newreply&noquote=1&p=2838814
>>> class c(tuple):
... def __init__(s,a,b):
... tuple.__init__(s,a)
... self.b = b
...
>>> c(tuple(),666)
Traceback (most recent call last):
File "
David W. Lambert added the comment:
The apparent problem was that the constructing str with __init__ failed. I now
recall that immutables take initial values in the __new__ method. Sorry!
Otherwise, it was quite thoughtful for you to search for a problem. Dave
David W. Lambert added the comment:
Sorry again. You probably didn't follow the link I posted to see the
problem origination. Which was "Cannot subclass str." I generalized
this to tuple.
On Tue, 2012-12-04 at 20:08 +, R. David Murray wrote:
> R. David Murray added t
New submission from David W. Lambert :
lambertdw$ p3
Python 3.1.1 (r311:74480, Oct 2 2009, 12:29:57)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> not 23
False
>>> not(23
David W. Lambert added the comment:
problem also exists in 2.6.
It's a, in my humble opinion, release blocker.
--
type: compile error -> behavior
___
Python tracker
<http://bugs.python.or
Changes by David W. Lambert :
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue3976>
___
___
Python-bugs-list mailing list
Unsubscribe:
David W. Lambert added the comment:
I believe this issue was resolved---expect it in a future release.
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue7
New submission from David W. Lambert :
'''
RuntimeError: maximum recursion depth exceeded in cmp
Python 3.1.1 (r311:74480, Oct 2 2009, 12:29:57)
[GCC 4.3.3] on linux2
'''
import itertools,pprint
combos = itertools.combinations
def connect(nod
New submission from David W. Lambert :
Raymond Hettinger posted clever Hamming number generator,
http://code.activestate.com/recipes/576961/
which I tried to modify. The function gives incorrect output when
called as hamming_numbers(shorthand = True). It seemed reasonable to
expect the two
David W. Lambert added the comment:
Thank you!
A prime sieve variant is a better way to generate the generalized
Hamming numbers I'm after, at least if the maximum is known ahead of
time.
Dave Lambert
--
___
Python tracker
<http://bugs.py
New submission from David W. Lambert :
'''
This brute [possibly a] solution to
http://projecteuler.net/index.php?section=problems&id=159
causes segmentation fault.
$ p3 # an AMD 64 bit build.
Python 3.1.1 (r311:74480, Oct 2 2009, 12:29:57)
[G
David W. Lambert added the comment:
Further isolation, following change removes segmentation fault:
digital_roots = tuple(map(digital_root,factorization))
becomes
digital_roots = [digital_root(factor) for factor in
factorization
New submission from David W. Lambert :
http://docs.python.org/dev/py3k/library/stdtypes.html#index-559
Proposal: remove last sentence from
"class.__bases__
The tuple of base classes of a class object. If there are no base
classes, this will be an empty tuple."
Reason: Sentence is
New submission from David W. Lambert :
x/lib/python3.0$ diff --unified turtle.py.bak turtle.py
--- turtle.py.bak 2009-02-17 11:29:15.0 -0500
+++ turtle.py 2009-02-17 11:29:37.0 -0500
@@ -2265,7 +2265,7 @@
"outline": positive number
David W. Lambert added the comment:
Fails also on this system.
$ p3
Python 3.0.1 (r301:69556, Feb 13 2009, 23:52:55)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on linux2
(...)
>>> # use both hangs
(...)
>>> p.start()
>>> p.join()
(hmm la do diii laaa...)^C
Trace
New submission from David W. Lambert :
Following instructions in
http://docs.python.org/dev/3.0/library/csv.html#module-csv
I opened file in binary mode. This might be simply a documentation
problem or it may run deeper. Text mode works on red hat linux system.
Here's the use:
>&
Changes by David W. Lambert :
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue5350>
___
___
Python-bugs-list mailing list
Unsubscribe:
David W. Lambert added the comment:
Nice. I had thought of this a while ago but found counter example,
probably using the empty iterator
def f():
raise StopIteration
yield
I didn't realize "next" had optional argument.
___
Python
David W. Lambert added the comment:
I'd like textwrap option to preserve new lines. Actual case:
I have a code that produces cryptograms meant to be printed and solved
with paper and pencil. Standard format for cryptogram inserts space
character between each character of the original
David W. Lambert added the comment:
granted, this isn't terribly difficult:
'\n'.join(textwrap.fill(line) for line in text.split('\n'))
___
Python tracker
<http
David W. Lambert added the comment:
Use cases are easy to find.
So easily found that there's probably a sound reason for reserved words.
The proposal couples lexical analysis to the parser.
# syntax error or name error?
def f():
class
return
def f(class):
class
r
David W. Lambert added the comment:
You can sneak them in thusly:
def f(**kwargs):
print(kwargs)
f(**{'class':'sidebar'})
___
Python tracker
<http://bu
David W. Lambert added the comment:
I think you need this order preserving paradigm using python as is:
def xhtmlNode(tag,*args):
...
xhtmlNode('div', {'id':'sidebar'}, 'Hello world')
Less work in xhtmlNode might offset the extra work in writi
David W. Lambert added the comment:
0->kbk
I avoid idle altogether and run python in emacs shell buffer. Switching
windows usually involves mice. Mice are evil.
emacs has gazillions of features.
artist mode (oops, mice!)
rectangular regions,
registers,
25 (hundreds with C-{di
David W. Lambert added the comment:
I completely agree that this is a documentation issue.
Also, or perhaps for foolish completeness, in
http://docs.python.org/3.0/library/stdtypes.html
we would point out that the following group of string methods also work
for bytes and bytearrays. Of
Changes by David W. Lambert :
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue5420>
___
___
Python-bugs-list mailing list
Unsubscribe:
David W. Lambert added the comment:
With older versions of each timedelta rejects the data type. Maybe
that's a good resolution?
$ /usr/local/bin/python2.4
Python 2.4.2 (#2, Jul 7 2006, 10:20:47)
[GCC 3.4.5 20051201 (Red Hat 3.4.5-2)] on linux2
Type "help", "copy
David W. Lambert added the comment:
That's the best version I recall seeing at activestate.
Still, I'd deprecate and remove > and >= from mathematics.
--
nosy: +LambertDW
___
Python tracker
<http://bugs.p
David W. Lambert added the comment:
(As I recall) in python-dev mailing list Ray claimed he could clean up a
cited active state recipe to address this issue. He succeeded to the
extent I'm aware---he's the author of
http://code.activestate.com/recipes/576685/.
I haven't use
Changes by David W. Lambert :
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue3565>
___
___
Python-bugs-list mailing list
Unsubscribe:
David W. Lambert added the comment:
Resolution of this may be applicable to Issue3446 as well.
"center, ljust and rjust are inconsistent with unicode parameters"
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.
David W. Lambert added the comment:
http://linux.die.net/man/3/strftime
or this link may be in USA, if you care:
http://www.manpagez.com/man/3/strftime/
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue1520
David W. Lambert added the comment:
(with similar links for strpfime).
These are reasons a patch may be worth while:
x difficult to work around using ctypes module with c library.
x help(strftime) advises the programmer to see the reference manual for
formatting codes.
x Searching
David W. Lambert added the comment:
(I have no clue where the servers are.)
--
___
Python tracker
<http://bugs.python.org/issue1520662>
___
___
Python-bugs-list m
David W. Lambert added the comment:
# With py3Krc1 it took me days to figure out how to
# replace my base class file. Granted, there were
# issues with io module at the time. Following met
# my need.
import io
class File(io.TextIOWrapper):
'''Open a text file w
David W. Lambert added the comment:
#OOPS! I forgot the subtlety.
#I must also retain the stream
#else it gets collected.
#Nasty.
import io
class file(io.TextIOWrapper):
'''condensing code for this list without test is a no no!'''
def __init__(s
David W. Lambert added the comment:
My file class extends text files with seek or read through condition or
pattern, providing an awk like pattern{action} task separation.
If I allow a pre-existing stream into my constructor (subprocess.Popen
my favorite) I still suffer the same garbage
New submission from David W. Lambert :
See thread
http://groups.google.com/group/comp.lang.python/browse_thread/thread/85e
c714aa6898d84#
En Sun, 22 Mar 2009 19:12:13 -0300, Benjamin Peterson
escribió:
> Gabriel Genellina yahoo.com.ar> writes:
>> The undocumented behavior i
New submission from David W. Lambert :
http://docs.python.org/dev/py3k/tutorial/inputoutput.html#methods-of-
file-objects
Is it proper to discuss file objects in py3K?
--
assignee: georg.brandl
components: Documentation
messages: 83991
nosy: LambertDW, georg.brandl
severity: normal
Changes by David W. Lambert :
--
assignee: -> georg.brandl
components: +Documentation
nosy: +georg.brandl
versions: +Python 3.0
___
Python tracker
<http://bugs.python.org/iss
David W. Lambert added the comment:
File objects should not be discussed in the tutorial to emphasize that
the file type is gone.
File objects should be in the tutorial as a useful familiar concept.
--
___
Python tracker
<http://bugs.python.
New submission from David W. Lambert:
doc string suggests str is a valid init argument. The code strongly
discourages this.
ctypes.create_string_buffer
def create_string_buffer(init, size=None):
"""create_string_buffer(aBytes) -> character array
create_strin
101 - 168 of 168 matches
Mail list logo