On Sun, 01 Dec 2013 19:18:58 +, G. wrote:
> Hi, I can't figure out how I can extend the 'function' built-in class. I
> tried:
> class test(function):
> def test(self):
> print("test")
> but I get an error. Is it possible ?
You cannot subclass the function type directly, but you c
On Monday, December 2, 2013 5:11:15 AM UTC+5:30, jade wrote:
> > To: pytho...@python.org
> > From: wlf...@ix.netcom.com
> > Subject: Re: Checking Common File Types
> > Date: Sun, 1 Dec 2013 18:23:22 -0500
> >
> > On Sun, 1 Dec 2013 18:27:16 +, jade declaimed the
> > following:
> >
> > >Hello
> To: python-list@python.org
> From: wlfr...@ix.netcom.com
> Subject: Re: Checking Common File Types
> Date: Sun, 1 Dec 2013 18:23:22 -0500
>
> On Sun, 1 Dec 2013 18:27:16 +, jade declaimed the
> following:
>
> >Hello,
> >I'm trying to create a script that checks all the files in my 'down
On 2/12/2013 5:18 AM, G. wrote:
Hi, I can't figure out how I can extend the 'function' built-in class. I tried:
class test(function):
def test(self):
print("test")
but I get an error. Is it possible ?
Others have pointed out that you cannot subclass the function type.
Could you
> Hi, I can't figure out how I can extend the 'function' built-in class. I
> tried:
> class test(function):
> def test(self):
> print("test")
> but I get an error. Is it possible ?
It has to do with differing models of computation, and python isn't
designed for this. Perhaps you're s
On 11/29/2013 04:31 PM, farhan...@gmail.com wrote:
It's for a school assignment. Basically, I need to roll 5 dies with 6 sides each. So basically, 6 random
numbers. That part is easy. Then I need to add it up. Ok, done that. However, I also need to say something
along the lines of "your total n
On 01/12/2013 22:50, Ethan Furman wrote:
On 12/01/2013 02:06 PM, Mark Lawrence wrote:
I don't remember him [jmf] ever having a valid point, so FTR can we
have a reference please. I do remember Steven D'Aprano
showing that there was a regression which I flagged up here
http://bugs.python.org/is
On 12/01/2013 02:06 PM, Mark Lawrence wrote:
I don't remember him [jmf] ever having a valid point, so FTR can we have a
reference please. I do remember Steven D'Aprano
showing that there was a regression which I flagged up here
http://bugs.python.org/issue16061. It was fixed by Serhiy
Storch
On 01/12/2013 22:29, Tim Delaney wrote:
On 2 December 2013 09:06, Mark Lawrence mailto:breamore...@yahoo.co.uk>> wrote:
I don't remember him ever having a valid point, so FTR can we have a
reference please. I do remember Steven D'Aprano showing that there
was a regression which I fl
On Mon, Dec 2, 2013 at 5:27 AM, jade wrote:
> file_sigs = {'\xFF\xD8\xFF':('JPEG','jpg'),
> '\x47\x49\x46':('GIF','gif')}
>
> file_sig = fh.read(4)
You're reading in four bytes, but your signatures are three bytes long. :)
After that, all you need to do is look up file_sig in the file_sigs
On 2 December 2013 09:06, Mark Lawrence wrote:
> I don't remember him ever having a valid point, so FTR can we have a
> reference please. I do remember Steven D'Aprano showing that there was a
> regression which I flagged up here http://bugs.python.org/issue16061. It
> was fixed by Serhiy Storc
On Mon, 2 Dec 2013 05:59:07 +0800
martin koh wrote:
> Hi all..may i know how to do the IR tracking by using wiimote? i did tried
> the source code from
> (http://ph-elec.com/archives/simple-python-wii-mote-test/) using command
> prompt but i can't compile successfully, i think is because i don'
On 01/12/2013 20:54, Tim Delaney wrote:
On 2 December 2013 07:15, mailto:wxjmfa...@gmail.com>> wrote:
0.11.13 02:44, Steven D'Aprano написав(ла):
> (2) If you reverse that string, does it give "lëon"? The
implication of
> this question is that strings should operate on grapheme
Hi all..may i know how to do the IR tracking by using wiimote? i did tried the
source code from
(http://ph-elec.com/archives/simple-python-wii-mote-test/) using command prompt
but i can't compile successfully, i think is because i don't have any idea how
to import the cwiid module. Can anyone p
Hello,
I'm trying to create a script that checks all the files in my 'downloaded'
directory against common file types and then tells me how many of the files in
that directory aren't either a GIF or a JPG file. I'm familiar with basic
Python but this is the first time I've attempted anything li
On 2 December 2013 07:15, wrote:
> 0.11.13 02:44, Steven D'Aprano написав(ла):
> > (2) If you reverse that string, does it give "lëon"? The implication of
> > this question is that strings should operate on grapheme clusters rather
> > than code points. ...
> >
>
> BTW, a grapheme cluster *is* a
0.11.13 02:44, Steven D'Aprano написав(ла):
> (2) If you reverse that string, does it give "lëon"? The implication of
> this question is that strings should operate on grapheme clusters rather
> than code points. ...
>
BTW, a grapheme cluster *is* a code points cluster.
jmf
--
https://mail.pyth
On 2013-12-01 19:43, Tim Chase wrote:
I'm not quite sure *why* one might want to subclass FunctionType, but
I'm also not sure why you should be *prevented* from subclassing it.
Previously:
http://grokbase.com/t/python/python-list/033r5nks47/type-function-does-not-subtype#20030324rcnwbkfedhzba
Le 01-12-2013, Gary Herron a écrit :
> And in particular: What 'function' built-in class? I know of no such
> thing, and the error message I get with your code says exactly that:
>NameError: name 'function' is not defined
> Did you not get that same error?
Yes, indeed. The 'function' built-
On 12/01/2013 11:18 AM, G. wrote:
Hi, I can't figure out how I can extend the 'function' built-in class. I tried:
class test(function):
def test(self):
print("test")
but I get an error. Is it possible ?
Regards, G.
What error do you get?
What version of Python?
What OS?
And in
On 2013-12-01 19:18, G. wrote:
> Hi, I can't figure out how I can extend the 'function' built-in
> class. I tried: class test(function):
> def test(self):
> print("test")
> but I get an error. Is it possible ?
While I don't have an answer, I did find this interesting. First,
"function"
Le 01-12-2013, Roy Smith a écrit :
>
> class foo(type(open)):
> pass
>
> I get:
>
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: Error when calling the metaclass bases
> type 'builtin_function_or_method' is not an acceptable base type
>
> So, we're back to askin
In article <529b8ba2$0$2270$426a7...@news.free.fr>,
"G." wrote:
> Hi, I can't figure out how I can extend the 'function' built-in class. I
> tried:
> class test(function):
> def test(self):
> print("test")
> but I get an error. Is it possible ?
>
> Regards, G.
It really helps to g
Hi, I can't figure out how I can extend the 'function' built-in class. I tried:
class test(function):
def test(self):
print("test")
but I get an error. Is it possible ?
Regards, G.
--
https://mail.python.org/mailman/listinfo/python-list
30.11.13 02:44, Steven D'Aprano написав(ла):
(2) If you reverse that string, does it give "lëon"? The implication of
this question is that strings should operate on grapheme clusters rather
than code points. Python fails this test:
py> print("noe\u0308l"[::-1])
leon
>>> print(unicodedata.norma
Le dimanche 1 décembre 2013 00:07:36 UTC+1, Ned Batchelder a écrit :
> On 11/30/13 5:37 PM, Gregory Ewing wrote:
>
> > wxjmfa...@gmail.com wrote:
>
> >> And do you know the origin of this typographical feature?
>
> >> Because, mechanically, the dot of the "i" broke too often.
>
> >>
>
> >> In
On Sun, 01 Dec 2013 16:03:17 +1100, Chris Angelico wrote:
> Most of it is getting annoyed at the results of 3, and then attacking 3.
I know the feeling. I've never trusted 3, I've always felt that it's
plotting something. And it looks like half an 8, but it's not. What's
with that?
--
Steven
On 01/12/2013 00:04, Eamonn Rea wrote:
Thanks for the help!
Ok, I'll look into the mailing list.
It's very useful, you can even see things in context, which is
conspicious by its absence above :)
--
Python is the second best programming language in the world.
But the best has yet to be inv
28 matches
Mail list logo