Hello friends,
An instance of my subclass doesn't invoke its superclass method, except when
it is referenced
directly.
Here is what I mean:
class A(object):
... def log(self, module):
... return str('logged')
...
class B(A):
... def __init__(self, module):
...
On 11/09/11 10:18, Kayode Odeyemi wrote:
Hello friends,
An instance of my subclass doesn't invoke its superclass method, except
when it is referenced
directly.
Here is what I mean:
class A(object):
... def log(self, module):
... return str('logged')
...
class
On 09/10/11 22:07, Gelonida N wrote:
http://bytes.com/topic/python/answers/734066-how-output-newline-carriage-return-optparse
It works (of course ;-) ) like a charm. Good to know, that I'm
not the only one who want's to structure the help text a
little nicer.
Considering, that you posted the
On Sun, Sep 11, 2011 at 11:41 AM, Thomas Jollans t...@jollybox.de wrote:
On 11/09/11 10:18, Kayode Odeyemi wrote:
Hello friends,
An instance of my subclass doesn't invoke its superclass method, except
when it is referenced
directly.
Here is what I mean:
class A(object):
...
On 11/09/11 13:17, Kayode Odeyemi wrote:
On Sun, Sep 11, 2011 at 11:41 AM, Thomas Jollans t...@jollybox.de
mailto:t...@jollybox.de wrote:
It is working:
class A(object):
... def log (self, module):
... return str ('logged')
...
class B(A):
...
2011/9/11 蓝色基因 bluegene8...@gmail.com:
This is my first touch on the multiprocessing module, and I admit not
having a deep understanding of parallel programming, forgive me if
there's any obvious error. This is my test code:
# deadlock.py
import multiprocessing
class MPTask:
def
On 01/-10/-28163 02:59 PM, Kayode Odeyemi wrote:
Hello friends,
An instance of my subclass doesn't invoke its superclass method, except when
it is referenced
directly.
Here is what I mean:
class A(object):
... def log(self, module):
... return str('logged')
...
class B(A):
On 09/10/11 14:36, Terry Reedy wrote:
1. Process first item of an iterable separately.
A traditional solution is a flag variable that is tested for each item.
first = True
other setup
for item in iterable:
if first:
process first
first = False
else:
process non-first
Dr. Phillip M. Feldman wrote:
I've written a recursive class that creates an iterator to solve a general
formulation of the combinatorics problem known as balls in numbered
boxes
(also known as indistinguishable balls in distinguishable boxes). The
code has been extensively tested and
On 10 Sep, 19:59, Terry Reedy tjre...@udel.edu wrote:
On 9/10/2011 7:20 AM, Tigerstyle wrote:
Hi guys.
I'm strugglin with some homework stuff and am hoping you can help me
out here.
We appreciate you saying so instead of hiding that this is homework.
small_words = ('into',
Terry Reedy wrote:
3. Process the items of an iterable in pairs.
items = iter(iterable)
for first in items:
second = next(items)
process first and second
This time, StopIteration is raised for an odd number of items. Catch and
process as desired. One possibility is to raise
Hi Steven,
Thanks again for your answer.
On 09/11/2011 06:51 AM, Steven D'Aprano wrote:
Gelonida N wrote:
In your example, you stated that kitchen explicitly imports kitchen.pans and
kitchen.knives. So in that case, take it up with the designer of the
kitchen package -- it was his
Thanks Ben,
On 09/11/2011 07:20 AM, Ben Finney wrote:
Gelonida N gelon...@gmail.com writes:
Considering, that you posted the snippet in 2007 and this is very
probably a reocurring problem for any slighty more complicated help
text it is really a pity, that it did not become of part of the
On Sep 11, 1:43 am, Dr. Phillip M. Feldman
phillip.m.feld...@gmail.com wrote:
I've written a recursive class that creates an iterator to solve a general
formulation of the combinatorics problem known as balls in numbered boxes
(also known as indistinguishable balls in distinguishable boxes).
I get this exception when I run the first program:
Exception in thread Thread-1:
Traceback (most recent call last):
File /usr/lib/python3.1/threading.py, line 516, in _bootstrap_inner
self.run()
File /usr/lib/python3.1/threading.py, line 469, in run
self._target(*self._args,
On 10 Sep, 13:50, Thomas Jollans t...@jollybox.de wrote:
On 10/09/11 13:20, Tigerstyle wrote:
Hi guys.
I'm strugglin with some homework stuff and am hoping you can help me
out here.
All tests are failing even though I am getting the correct output on
the first two tests. And the last
On 10 Sep, 13:43, Mel mwil...@the-wire.com wrote:
Tigerstyle wrote:
Hi guys.
I'm strugglin with some homework stuff and am hoping you can help me
out here.
This is the code:
small_words = ('into', 'the', 'a', 'of', 'at', 'in', 'for', 'on')
def book_title(title):
Takes a
On 10 Sep, 17:56, Chris Angelico ros...@gmail.com wrote:
On Sat, Sep 10, 2011 at 10:24 PM, Alister Ware
alister.w...@ntlworld.com wrote:
Ignoring the docttests my process would be to process each word then
manually capitalize he 1st word, .I would als0 use a comprehension as
makes for
On 9/11/2011 12:01 AM, Ian Kelly wrote:
On Sat, Sep 10, 2011 at 1:36 PM, Terry Reedytjre...@udel.edu wrote:
The statement containing the explicit next(items) call can optionally be
wrapped to explicitly handle the case of an empty iterable in whatever
manner is desired.
try:
set up with
On 11 Sep, 08:18, Dennis Lee Bieber wlfr...@ix.netcom.com wrote:
On Sat, 10 Sep 2011 16:25:42 -0700, Dennis Lee Bieber
wlfr...@ix.netcom.com declaimed the following in
gmane.comp.python.general:
in the language documentation... It will give you a simple way to know
if you are looking at
On 11 Sep, 04:12, t...@thsu.org wrote:
On Sep 10, 7:47 am, Peter Otten __pete...@web.de wrote:
Tigerstyle wrote:
I'm strugglin with some homework stuff and am hoping you can help me
out here.
This is the code:
small_words = ('into', 'the', 'a', 'of', 'at', 'in', 'for',
On 9/11/2011 7:46 AM, Tigerstyle wrote:
Thank you Terry,
I went for this solution as it was the easiest for me to understand
and comment myself keeping in mind what level I am at right now.
Thanks a ton to everyone for sharing so much information and making it
easy to read and understand
On 9/11/2011 9:41 AM, Peter Otten wrote:
Terry Reedy wrote:
3. Process the items of an iterable in pairs.
items = iter(iterable)
for first in items:
second = next(items)
process first and second
This time, StopIteration is raised for an odd number of items. Catch and
process as
On 2011-09-11 13:17, Kayode Odeyemi wrote:
On Sun, Sep 11, 2011 at 11:41 AM, Thomas Jollanst...@jollybox.de wrote:
It is working:
class A(object):
... def log (self, module):
... return str ('logged')
...
class B(A):
... def __init__(self, module):
...
Chris Angelico wrote:
On Sat, Sep 10, 2011 at 10:24 PM, Alister Ware
alister.w...@ntlworld.com wrote:
Ignoring the docttests my process would be to process each word then
manually capitalize he 1st word, .I would als0 use a comprehension as
makes for cleaner code:-
def capitalize(word):
if
Littlefield, Tyler ty...@tysdomain.com wrote:
I don't much care for PHP, but the thing that can be said for it is it's
pretty quick. How does Python compare?
PHP is quick for development, in that you can slap together some schlock
and have it mostly work. The result, however, is usually
Terry Reedy wrote:
On 9/11/2011 12:01 AM, Ian Kelly wrote:
On Sat, Sep 10, 2011 at 1:36 PM, Terry Reedytjre...@udel.edu wrote:
The statement containing the explicit next(items) call can optionally be
wrapped to explicitly handle the case of an empty iterable in whatever
manner is desired.
+1 for PostgreSQL. It's faster than MySQL for years now, and is much more
seriously featured.
If you don't need ACID properties (transactions stuff) you should also give
Document-based databases like MongoDB a try. It changed my code life.
--
http://mail.python.org/mailman/listinfo/python-list
Hello Peter,
When I run my code, I get the same 14 configurations that your code
produces; the only different that I can see in the output is that the
configurations are produced in a different order. Note that your code is
not creating an iterator, so thus doesn't do what I want. Also,
Chris,
Your code is much cleaner than mine. I will have to figure out exactly how
it is working.
Thanks!
Phillip
--
View this message in context:
http://old.nabble.com/recursive-algorithm-for-balls-in-numbered-boxes-tp32440187p32443579.html
Sent from the Python - python-list mailing list
I am agree with postgresql i don' t have any problem, also is better for big
applications. And Python is always better language than PHP if you' re going to
create a web app.
Sent from my BlackBerry® wireless device
-Original Message-
From: Tim Roberts t...@probo.com
Sender:
Dr. Phillip M. Feldman wrote:
When I run my code, I get the same 14 configurations that your code
produces;
I'm sorry, I ran the buggy code from
http://old.nabble.com/file/p32439307/balls_in_numbered_boxes.py
without realizing it was not
On 9/11/11 6:05 AM, Tim Chase wrote:
As Ben Finney replied, optparse is now deprecated, replaced in part by argparse.
Unfortunately, argparse wasn't backported to the standard library for earlier
2.x series (I think it became available in 2.7, and may run in earlier versions
if manually added
On Mon, Sep 12, 2011 at 2:47 AM, Terry Reedy tjre...@udel.edu wrote:
What you are saying is a) that the following code
for title in ['amazinG', 'a helL of a fiGHT', '', 'igNordEd']:
print(fix_title(title))
At least in Python 3.2, this isn't the case. StopIteration breaks the
loop only if
On 9/11/2011 6:41 PM, Chris Angelico wrote:
On Mon, Sep 12, 2011 at 2:47 AM, Terry Reedytjre...@udel.edu wrote:
What you are saying is a) that the following code
for title in ['amazinG', 'a helL of a fiGHT', '', 'igNordEd']:
print(fix_title(title))
At least in Python 3.2, this isn't
On Mon, Sep 12, 2011 at 4:43 AM, Ethan Furman et...@stoneleaf.us wrote:
Chris Angelico wrote:
And I'd do this with a lambda, but that's just me. Of course, if your
logic is more complicated, it makes more sense to keep it in a named
function, but a single conditional call can fit nicely into
Chris Angelico ros...@gmail.com writes:
A lambda is basically a function defined in an expression. For instance:
def add_one(x):
return x+1
is (practically) the same as:
add_one = lambda x: x+1
Those are only practically the same if you ignore the practical worth of
a function knowing
On Mon, Sep 12, 2011 at 11:37 AM, Ben Finney ben+pyt...@benfinney.id.au wrote:
Those are only practically the same if you ignore the practical worth of
a function knowing the name it was defined with. The latter does not
have that, hence I don't see it as practically the same as the former.
I
On Mon, 12 Sep 2011 01:06 pm Chris Angelico wrote:
On Mon, Sep 12, 2011 at 11:37 AM, Ben Finney ben+pyt...@benfinney.id.au
wrote:
Those are only practically the same if you ignore the practical worth of
a function knowing the name it was defined with. The latter does not
have that, hence I
Hello,
What do you guys think about adding a method to_json to dictionaries
and sequence types? Perhaps through a module import?
Regards,
Juan Pablo
--
http://mail.python.org/mailman/listinfo/python-list
2011/9/11 Juan Pablo Romero Méndez jpablo.rom...@gmail.com:
Hello,
What do you guys think about adding a method to_json to dictionaries
and sequence types? Perhaps through a module import?
Why? We already have json.dumps(); seems to cover the use case.
Cheers,
Chris
--
Perhaps an actual use-case would clarify the need for this?
2011/9/12 Chris Rebert c...@rebertia.com
2011/9/11 Juan Pablo Romero Méndez jpablo.rom...@gmail.com:
Hello,
What do you guys think about adding a method to_json to dictionaries
and sequence types? Perhaps through a module
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
resolution: - rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12914
___
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
assignee: - rhettinger
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12917
___
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
assignee: - rhettinger
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12916
___
Changes by Ned Deily n...@acm.org:
--
nosy: +ned.deily
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12958
___
___
Python-bugs-list mailing list
Stefan Krah stefan-use...@bytereef.org added the comment:
I left some remarks on Rietveld.
--
nosy: +skrah
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1172711
___
Raymond Hettinger raymond.hettin...@gmail.com added the comment:
Resist the urge to fatten APIs until you're sure that:
* they are needed
* they are well developed (many internal utils fail this test)
* they are worth the extra time it takes to learn what is in a module (adding
rarely needed
Stefan Krah stefan-use...@bytereef.org added the comment:
Traceback with faulthandler disabled:
Core was generated by `./python -m test -uall -r --randseed=8304772'.
Program terminated with signal 11, Segmentation fault.
[New process 3948]
#0 0x40011d20 in __tls_get_addr () from
Charles-François Natali neolo...@free.fr added the comment:
Traceback with faulthandler disabled:
It crashes when trying to look up TLS (which explains why it doesn't crash when
built ``without-threads`).
Looks like a libc bug, but would it be possible to have a backtrace with Python
built
Nick Coghlan ncogh...@gmail.com added the comment:
First attempt didn't quite work - the FD passing tests somehow seem to be
reporting both 'ERROR' *and* 'expected failure', which is causing the test
overall to remain red.
Pavel Boldin boldin.pa...@gmail.com added the comment:
OK. So, it seems just like ctypes work, but don't for my needs.
Thing that bothers me anyway is the strange code, where size contains either
size (when bitsize==0) or bitsize in upper 16 bits and bitoffset in lower 16
bits.
--
Changes by Meador Inge mead...@gmail.com:
--
nosy: +meadori
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12936
___
___
Python-bugs-list mailing
New submission from July Tikhonov july.t...@gmail.com:
ChainMap is the only item from collections module, that is described in docs,
but is not included in collections.__all__
--
components: Library (Lib)
files: chainmap_in___all__.diff
keywords: patch
messages: 143862
nosy: july
Nick Coghlan ncogh...@gmail.com added the comment:
Ah, I believe I see why the expected failure isn't working properly - the
failing testFDPass* tests are causing the subsequent tear down code to also
fail.
--
___
Python tracker
New submission from Nikolaus Rath nikol...@rath.org:
According to http://docs.python.org/library/threading.html#condition-objects,
threading.Condition is a class. However, in fact it turns out to be function
that constructs a _Condition instance.
I don't know the reason for that, but it seems
Changes by Nikolaus Rath nikol...@rath.org:
--
versions: +Python 3.1, Python 3.2, Python 3.3, Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12704
___
Stefan Krah stefan-use...@bytereef.org added the comment:
Curiously enough python *is* built --with-pydebug.
Version 9d658f000419, which is pre-faulthandler, runs without segfaults.
Could faulthandler cause problems like these:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=370060
Larry Hastings la...@hastings.org added the comment:
Mark Dickinson:
I realize a new float type would be a major undertaking
That's an understatement and a half. The only way this could ever
be viable is if float128 support becomes widespread enough that we
don't have to write our own
STINNER Victor victor.stin...@haypocalc.com added the comment:
As I mentioned earlier in this thread, GCC has supported __float128 since 4.3,
Clang added support within the last year, and Intel has a _Quad type. All are
purported to be IEEE 754-2008 quad-precision floats. Glibc added
Larry Hastings la...@hastings.org added the comment:
Victor STINNER:
Python is compiled using Visual Studio 2008 on Windows. Portability
does matter on Python. If a type is not available on *all* platforms
(including some old platforms, e.g. FreeBSD 6 or Windows XP), we
cannot use it by
Charles-François Natali neolo...@free.fr added the comment:
Could faulthandler cause problems like these:
Well, that would explain why it crashes in the TLS lookup code, and why the
core dump looks borked.
1) Apparently, Etch on ARM uses linuxthread instead of NPTL: what does
$ getconf
Charles-François Natali neolo...@free.fr added the comment:
Looks good to me.
--
nosy: +neologix
stage: patch review - commit review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12881
___
New submission from Ned Deily n...@acm.org:
gcc -o Python.framework/Versions/2.7/Python -dynamiclib \
-all_load libpython2.7.a -Wl,-single_module \
-install_name /tmp/a/empty
space/Python.framework/Versions/2.7/Python \
-compatibility_version
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 12bb3cd873c8 by Benjamin Peterson in branch 'default':
add ChainMap to __all__ (closes #12959)
http://hg.python.org/cpython/rev/12bb3cd873c8
--
nosy: +python-dev
resolution: - fixed
stage: -
Martin v. Löwis mar...@v.loewis.de added the comment:
The quad-precision float would be highly portable
Larry, please stop this discussion in this issue. I believe
a PEP would be needed, and would likely be rejected because
of the very very very long list of issues that can't be
resolved. I
Changes by Nikolaus Rath nikol...@rath.org:
--
nosy: +Nikratio
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1230540
___
___
Python-bugs-list
New submission from Phillip Feldman phillip.m.feld...@gmail.com:
The current set of combinatorial functions in `itertools` does not include
unlabelled balls in labeled boxes and unlabelled balls in unlabelled boxes. If
the boxes have no capacity limits (i.e., can store an unlimited number of
dirn d...@dirnonline.com added the comment:
Replacing r with result works only when urlopen doesn't raise HTTPError
--
nosy: +dirn
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12853
___
Changes by Brett Cannon br...@python.org:
--
nosy: +brett.cannon
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12958
___
___
Python-bugs-list
Changes by Nadeem Vawda nadeem.va...@gmail.com:
Added file: http://bugs.python.org/file23129/fe2c9998f329.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6715
___
Nadeem Vawda nadeem.va...@gmail.com added the comment:
I've attached another patch (fe2c9998f329.diff) with a more complete
implementation of the lzma module. All that's left now is to write the
documentation, and make sure that the module can build on Windows.
--
Stefan Krah stefan-use...@bytereef.org added the comment:
I completely removed faulthandler from e91ad9669c08 and the problem
still occurs (with the same broken backtrace).
$ getconf GNU_LIBPTHREAD_VERSION
NPTL 2.7
It is a bit unsatisfying that the segfault isn't reproducible with
the earlier
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset b21d1de6d78e by Nadeem Vawda in branch 'default':
Issue #12306: Add ZLIB_RUNTIME_VERSION to the zlib module.
http://hg.python.org/cpython/rev/b21d1de6d78e
--
nosy: +python-dev
Nadeem Vawda nadeem.va...@gmail.com added the comment:
I've committed your patches. I took the liberty of removing the
versionadded tag for ZLIB_VERSION; I don't think many people will need
to worry about compatibility with Python 1.5 ;-)
Once again, thanks for the patches!
--
STINNER Victor victor.stin...@haypocalc.com added the comment:
Looks like a libc bug ...
http://sources.redhat.com/bugzilla/show_bug.cgi?id=12453
Yes, the GNU libc has bugs (as every software!): this one has been fixed only
recently (in glibc 2.14, released the 2011-05-31). I don't know if
STINNER Victor victor.stin...@haypocalc.com added the comment:
If a two-ints representation
is considered necessary, I'd favor a rational number (numerator,
denominator) over a pair (second, subsecond); this would also support
2**-32 fractions (as used in NTP !!!).
Which OS uses NTP
Meador Inge mead...@gmail.com added the comment:
Would you mind explaining your use case and why ctypes won't fit it? Maybe
there is something that can be fixed.
FWIW, I agree that the overloading of 'size' is unnecessary.
--
___
Python tracker
Meador Inge mead...@gmail.com added the comment:
I ran the ctypes tests on Debian GNU/Linux 5.0.8 (lenny) on an ARMv5tejl
Versatile kernel and everything passed. Is anyone else still seeing
errors?
--
assignee: theller -
nosy: +meadori -theller
Raymond Hettinger raymond.hettin...@gmail.com added the comment:
Thank you.
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12959
___
80 matches
Mail list logo