On Feb 4, 2008 1:36 AM, 7stud [EMAIL PROTECTED] wrote:
print dir(type) #__mro__ attribute is in here
print dir(object) #no __mro__ attribute
class Mammals(object):
pass
class Dog(Mammals):
pass
print issubclass(Dog, type) #False
print Dog.__mro__
--output:--
(class
On Feb 5, 2008 1:30 PM, Nick Craig-Wood [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Ruby has a neat little convenience when writing loops where you don't
care about the loop index: you just do n.times do { ... some
code ... } where n is an integer representing how
On Feb 19, 2008 3:15 AM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Does this have to be true? Beneath the more complex syntax are there
a few core design principles/objects/relationships to help in grokking
the whole thing? Got any related links?
Take a look at a simpler implementation, like
On Tue, Apr 1, 2008 at 3:57 PM, [EMAIL PROTECTED] wrote:
On Apr 1, 12:47 pm, Gabriel Genellina [EMAIL PROTECTED]
wrote:
En Tue, 01 Apr 2008 13:57:55 -0300, [EMAIL PROTECTED] escribió:
On Mar 31, 1:36 pm, Gabriel Genellina [EMAIL PROTECTED]
wrote:
Don't be scared by the
On Tue, Apr 1, 2008 at 4:20 PM, [EMAIL PROTECTED] wrote:
Please explain how the existence of Python 3.0 would break your
production
code.
The existence of battery acid won't hurt me either, unless I come into
contact with it. If one eventually upgrades to 3.0 -- which
On Thu, May 8, 2008 at 7:25 AM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Hi,
i was reading/learning some hello world program in python.
I think its very simillar to Java/C++/C#. What's different (except
syntax) ?
what can i do easily with python which is not easy in c++/java !?
On Wed, May 14, 2008 at 12:20 PM, Blubaugh, David A.
[EMAIL PROTECTED] wrote:
To Whom It May Concern,
I was wondering if anyone has ever worked with hash tables within the Python
Programming language? I will need to utilize this ability for quick
numerical calculations.
On Fri, May 16, 2008 at 6:40 PM, Gary Herron [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
On 16 mai, 23:28, Hans Nowak [EMAIL PROTECTED] wrote:
Dan Upton wrote:
for pid in procs_dict:
if procs_dict[pid].poll() != None
# do the counter updates
del procs_dict[pid]
The
On Sun, Apr 12, 2009 at 8:53 AM, Tim Chase
python.l...@tim.thechases.com wrote:
From the docs:
all(iterable)
Return True if all elements of the iterable are true.
Equivalent
to:
def all(iterable):
for element in iterable:
if
On Sat, Sep 20, 2008 at 11:26 AM, Kay Schluehr [EMAIL PROTECTED] wrote:
On 20 Sep., 12:14, Fredrik Lundh [EMAIL PROTECTED] wrote:
Kay Schluehr wrote:
Answer: if you want to define an entity it has to be defined inside a
class. If you want to access an entity you have to use the dot
On Tue, May 20, 2008 at 8:24 PM, Gabriel Genellina
[EMAIL PROTECTED] wrote:
En Tue, 20 May 2008 10:28:51 -0300, castironpi [EMAIL PROTECTED]
escribió:
You meant 'thd1.start( )' and 'thd2.start( )'.
Wow! A message with a high S/N ratio coming from you!
And it's not the first I've seen -
On Thu, May 29, 2008 at 3:06 PM, Jason [EMAIL PROTECTED] wrote:
I've got Python 3.0 alpha 2. In this version, it looks like you can
define classes in either the old style or new style. (I snipped the
top line a bit in the following example):
Wrong. Py3k Classes are always new-style. They
On Thu, Jun 5, 2008 at 10:29 AM, Hans Nowak
[EMAIL PROTECTED] wrote:
Helmut Jarausch wrote:
Hi,
just to let you know ...
Today I've got an email from Amazon recommending me
Harry Potter and the Deathly Hallows
and they told me why they recommended this book,
because I've bought
Core
On Wed, Jun 11, 2008 at 10:28 AM, Kless [EMAIL PROTECTED] wrote:
I understand very well that a service is a software which is accessed
through a network.
And the description given on Wikipedia [1] is A 'Web service' (also
Web Service) is defined by the W3C as a software system designed to
On Jan 18, 2008 3:09 PM, Zbigniew Braniecki
[EMAIL PROTECTED] wrote:
I found a bug in my code today, and spent an hour trying to locate it
and then minimize the testcase.
Once I did it, I'm still confused about the behavior and I could not
find any reference to this behavior in docs.
On Jan 23, 2008 9:55 AM, Steven D'Aprano
[EMAIL PROTECTED] wrote:
For that to work, you need to give your class an __eq__ method, and have
it match by name:
# put this in MyClass
def __eq__(self, other):
return self.name == self.other
Do you mean:
# put this in MyClass
On Feb 1, 2008 5:19 AM, Arnaud Delobelle [EMAIL PROTECTED] wrote:
On Feb 1, 5:08 am, Paddy [EMAIL PROTECTED] wrote:
On Feb 1, 1:26 am, Blubaugh, David A. [EMAIL PROTECTED] wrote:
To Everyone on the planet Earth,
Please accept my apologies for
Why the Hell has nobody answered
On Jan 29, 2008 2:43 PM, John Nagle [EMAIL PROTECTED] wrote:
Submitting Python 2.5 to ISO/ANSI might be a good idea.
From GvR himself:
- Does a specification (ISO, ECMA, ..) is planned for Python and when ?
No, never. I don't see the point.
On Fri, Jul 18, 2008 at 4:21 PM, mark floyd [EMAIL PROTECTED] wrote:
I'm new to Python and have been doing work converting a few apps from Perl
to Python. I can not figure out the comparable Python structures for
multi-variable for loop control.
Examples:
# In Perl
for($i = 0, j = 0; $i
On 10/11/07, Luis Zarrabeitia [EMAIL PROTECTED] wrote:
Hi there.
I just tried this test:
def f(**kwds):
print kwds
import UserDict
d = UserDict.UserDict(hello=world)
f(**d)
And it fails with a TypeError exception (f() argument after ** must be a
dictionary). I find
On 10/18/07, danfolkes [EMAIL PROTECTED] wrote:
I thought I would post the source to a program that I made that will
download the http://ubuntu.media.mit.edu/ubuntu-releases/gutsy/
as soon as its posted.
It checks the site every 10 min time.sleep(600)
This is mostly untested so I would
On 10/29/07, brad [EMAIL PROTECTED] wrote:
Will len(a_string) become a_string.len()? I was just reading
http://docs.python.org/dev/3.0/whatsnew/3.0.html
One of the criticisms of Python compared to other OO languages is that
it isn't OO enough or as OO as others or that it is inconsistent.
On Nov 30, 2007 11:36 AM, Hrvoje Niksic [EMAIL PROTECTED] wrote:
Eduardo O. Padoan [EMAIL PROTECTED] writes:
No, writing this way will confound the 2to3 tool.
Why? print(foo) is a perfectly valid Python 2 statement. Maybe
it's simply a matter of fixing the tool.
print(foo) - print((foo
On Nov 30, 2007 11:18 AM, Peter Decker [EMAIL PROTECTED] wrote:
On Nov 30, 2007 1:19 AM, Tim Roberts [EMAIL PROTECTED] wrote:
You also have a couple of instances of:
print(Error Squeezing %s...)
The parentheses serve no purpose here, and are unidiomatic.
I thought that with the
For example, if I have x=[ [1,2], [3,4] ]
What I want is a new list of list that has four sub-lists:
[[1,2], [f(1), f(2)], [3,4], [f(3), f(4)]]
[[a, [f(b) for b in a]] for a in x]
--
http://mail.python.org/mailman/listinfo/python-list
On 9/2/07, llothar [EMAIL PROTECTED] wrote:
I'm afraid that the GIL is killing the usefullness of python for some
types of applications now where 4,8 oder 64 threads on a chip are here
or comming soon.
What is the status about that for the future of python?
I know that at the moment allmost
No. http://www.artima.com/weblogs/viewpost.jsp?thread=211430
Ops, I meant:
http://www.artima.com/forums/threaded.jsp?forum=106thread=211200
--
http://www.advogato.org/person/eopadoan/
Bookmarks: http://del.icio.us/edcrypt
--
http://mail.python.org/mailman/listinfo/python-list
On 9/13/07, Wildemar Wildenburger [EMAIL PROTECTED] wrote:
because I'm trained to interpret the underscore as a synonym for one
space. It's not particularly beautiful, but that is probably a matter of
habituation. And that exact word is probably the reason why I'd still
use self or s
On 9/14/07, Steven D'Aprano [EMAIL PROTECTED] wrote:
I thought that overflow errors would be a thing of the past now that
Python automatically converts ints to longs as needed. Unfortunately,
that is not the case.
class MyInt(int):
... pass
...
MyInt(sys.maxint)
2147483647
On 14 Sep 2007 18:08:00 -0700, Paul Rubin
http://phr.cx@nospam.invalid wrote:
Eduardo O. Padoan [EMAIL PROTECTED] writes:
Not totally unrelated, but in Py3k, as it seems, overflows are really
things of the past:
Python 3.0a1 (py3k:58061, Sep 9 2007, 13:18:37)
[GCC 4.1.3 20070831
On 9/15/07, Carl Banks [EMAIL PROTECTED] wrote:
On Fri, 14 Sep 2007 22:59:13 -0300, Eduardo O. Padoan wrote:
On 14 Sep 2007 18:08:00 -0700, Paul Rubin
http://phr.cx@nospam.invalid wrote:
Eduardo O. Padoan [EMAIL PROTECTED] writes:
Not totally unrelated, but in Py3k, as it seems
It's nice people have invented so many ways to spell the
builting map ;)
,.join(map(str,[1,2,3]))
'1,2,3'
IIRC, map's status as a builtin is going away.
Actually, py3k built-in map == itertools.imap
map(str, [])
itertools.imap object at 0xb7c7c9ec
--
On 9/15/07, J. Cliff Dyer [EMAIL PROTECTED] wrote:
And I'd hate to have to remember all of the rules for what can go
together and what can't, especially when it comes time to debug. No.
I don't think it should be forced, but maybe put it in PEP8 or PEP3008.
It is: see Whitespace in
On 9/27/07, TheFlyingDutchman [EMAIL PROTECTED] wrote:
It seems that Python 3 is more significant for what it removes than
what it adds.
What are the additions that people find the most compelling?
- dict.items(), .values() and .keys() returns dict views, and the
.iter*() removal
What's the equivalent of unittest's assertRaises?
In certain situations it is also useful to test wether an exception
(along its type) is raised or not.
Does py.test support such thing?
import py.test
py.test.raises(NameError, blablabla)
--
http://www.advogato.org/person/eopadoan/
On Mon, Nov 17, 2008 at 7:30 AM, Johannes Bauer [EMAIL PROTECTED] wrote:
Hello list,
since I've read so much about Python 3 and ran into some trouble which
was supposed to be fixed with 3k, I yesterday came around to compile it
and try it out.
To sum it up: It's awesome. All the promised
On Mon, Dec 1, 2008 at 9:16 AM, Michele Simionato
[EMAIL PROTECTED] wrote:
I am thinking about releasing a new version of the decorator module,
[...]
Just FYI, the module being discussed here is
http://www.phyast.pitt.edu/~micheles/python/documentation.html
I dont use it myself, but given how
On Thu, Dec 4, 2008 at 7:44 AM, James Stroud [EMAIL PROTECTED] wrote:
alex23 wrote:
On Dec 4, 3:42 pm, Warren DeLano [EMAIL PROTECTED] wrote:
So you prefer broken code to broken rules, eh? Your customers must love
that! This is exactly the kind of ivory-tower thinking I feared might
be
On Thu, Jan 22, 2009 at 7:10 AM, bearophileh...@lycos.com wrote:
I use the Python shell daily, plus of course normal editors to edit
python scripts. They both are very useful for different purposes. But
the default interactive shell isn't much handy if you want to modify
the past code to run
On Thu, Jan 22, 2009 at 5:01 PM, bearophileh...@lycos.com wrote:
Eduardo O. Padoan:
You are almost *describing* reinteract:
- Thank you for the link and the software, I have not tried it yet,
but from the screencast it looks quite nice.
- I am glad that there are people that don't think
40 matches
Mail list logo