On Wed, 25 Apr 2012 20:50:21 -0700, Adam Skutt wrote:
> On Apr 25, 8:01 pm, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote:
>> On Wed, 25 Apr 2012 13:49:24 -0700, Adam Skutt wrote:
>> > Though, maybe it's better to use a different keyword than 'is
other languages just like Python, C# and Java would be
invented to fill those niches, and the functional-obsessed crowd would
then complain that they wished those languages would be more like Python,
C# and Java.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 26 Apr 2012 17:16:10 -0700, Adam Skutt wrote:
> On Apr 26, 7:33 pm, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote:
>> On Thu, 26 Apr 2012 12:22:55 -0700, Adam Skutt wrote:
>> > I often wonder what the world would be like if Python, C#, and Java
>
27;t be, to be fair.
I disagree. Violating reflexivity has its uses. NANs are the classic
example.
Another example is if you redefine "==" to mean something other than
"equals". If your class treats == as something other than equality, there
is no need for a==a to necessarily return True.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
sentinel. You
can break it by passing an object which compares equal to None but isn't
actually None.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
.
So "have the same genes" meets all your conditions for equality, but
isn't equality: the three brothers are very different. Fred lost his arm
in a car crash, Barney is a hopeless alcoholic, and George is forty years
younger than his two brothers.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
y)
>
> with res << func(arg1) << block_name << 'x, y':
> print(x, y)
I'm sorry, I don't see how this is a code block. Where is the code in the
block, and how can you pass it to another object to execute it?
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 27 Apr 2012 17:03:19 +0200, Kiuhnm wrote:
> On 4/27/2012 16:09, Steven D'Aprano wrote:
>> On Fri, 27 Apr 2012 13:24:35 +0200, Kiuhnm wrote:
>>
>>> I'd like to change the syntax of my module 'codeblocks' to make it
>>> more pythonic.
&
entities. The Borg design pattern, for example, would be an excellent
>> candidate for ID:identity being treated as many-to-one.
>
> How would inheritance work if I did that?
You don't inherit from Borg instances, and instances inherit from their
class the same as any other instance.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 26 Apr 2012 04:42:36 -0700, Adam Skutt wrote:
> On Apr 26, 5:10 am, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote:
>> But I was actually referring to something more fundamental than that.
>> The statement "a is b" is a *direct* statement of iden
On Thu, 26 Apr 2012 04:42:36 -0700, Adam Skutt wrote:
> On Apr 26, 5:10 am, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote:
>> Solution to *what problem*?
>>
> This confusion that many people have over what 'is' does, including
> yourself.
I hav
les of both incorrect and
correct code demonstrating what you mean?
(I know what distinction *I* would make, but I'm not sure if it is the
same one you are making.)
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
spider, which is is a subtype of wolf spider but is
completely eyeless.
- Subclasses in Eiffel are not necessarily subtypes and may not be
substitutable for superclasses. If it's good enough for Eiffel, it's good
enough for my hypothetical Borg subclasses.
You can always declare that Bertrand Meyer doesn't "understand OOP at
all" too.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
;> struct.unpack('>h',b'\xC0\xA8')
(-16216,)
>>> n = int('0xC0A8', 16)
>>> if n >= 0x:
... n -= 0x1
...
>>> n
49320
Should be -16216.
Personally, I don't see why the OP doesn't just use struct.unpack to
unpack a struct.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ect the documentation to define "except", "instead", "is",
"to" and "the"?
If you don't know what "install" and "remove" means, then you need an
English dictionary, not a technical manual.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
{'when_odd': lambda n: n-1,
'when_prime': lambda n: n**2 - 1,
...})
although I would discourage that unless they are *really* trivial. But
for callbacks of any complexity, they will need to be tested, otherwise
how do you know they do what you want them to do?
Your code blocks make unit testing of the callbacks impossible, and for
that reason the Pythonic way is better.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
#x27;, '', 'float', 'right']
>
> Is there any way to avoid getting '' in my list without adding px; as a
> delimiter?
Probably. But why not do it the easy way?
items = re.split(':|;|px', "width:150px;height:50px;float:right")
items = filter(None, item)
In Python 3, the second line will need to be list(filter(None, item)).
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 01 May 2012 19:07:58 +0200, Kiuhnm wrote:
> On 5/1/2012 17:11, Steven D'Aprano wrote:
>>> My way
>>> --
>>>
>>> with func(some_args)<< ':dict':
>>> with when_odd as 'n':
>>> pas
dy who doesn't know Python very well?
Here's one way (untested but should work):
import numpy
f = open("my data file.txt", "r")
contents = numpy.array([float(line) for line in f])
f.close()
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
its of accuracy, as in your
example, then the result is meaningless -- the accuracy will be 2-2
digits, or 0 -- *no* digits in the answer can be trusted to be accurate.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
the contents of
os.listdir requires a large amount of effort. Just try it and see whether
it performs well enough.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ou
should take a close look at it because there *may* be a problem.
> So far, pretty much everyone who has tried to engage you on this subject
> on the list. I'm sorry we're not all ZOMGRUBYBLOCKS111 like the
> commenters on your project page.
Goddamit, did I miss a post somewhere? What the hell is this project
people keep talking about?
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
sult
>>> looked good to me... So I don't understand what you're saying about 10
>>> = 1 or 2 digits. I think my problem was accurate enough, though I
>>> don't know what error with 1e6 in condition number, I should expect.
>>> How did you arrive at
;
> What would be the best way to figure out how to do this?
Try googling "python web app how to". For example, the very first link
found here:
https://duckduckgo.com/html/?q=python%20web%20app%20how%20to
is an introduction to making Python applications available to run over
the Int
of thing that gives open source a bad reputation.
(The sad thing is, when closed source software developers do this sort of
thing, it gets blamed on "bad apples"; when open source developers do it,
it gets used as an indictment on the entire FOSS community.)
--
Steven
--
http
t seems to work, too. But is that a sound way to write python? Am I
> relying on undocumented implementation details or am I safe?
Are you referring to the part where you define a __doc__ string at the
top of the module, and then add to it with __doc__ += "more text"? If
not, it isn't clear to me what you mean.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
t 3.1.
You can also use this:
python -m compileall
to produce .pyc files without waiting for them to be imported.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
[steve@ando ~]$ python -m byteformat --prefix=K 1000 12300 145000
1 KB
12.3 KB
145 KB
byteformat understands all the relevant SI and IEC unit prefixes, and is
released under the MIT licence.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
have two problems *wink*
> Any hints? Thanks in advance!
>>> s = "This is a 'simple test':'string which' shows 'exactly my'
problem"
>>> import shlex
>>> result = shlex.split(s, posix=True)
>>> result
[
y> unicodedata.numeric(c)
0.2
py> c = '\u00B2'
py> print(c)
²
py> c.isdecimal(), c.isdigit(), c.isnumeric()
(False, True, True)
py> unicodedata.numeric(c)
2.0
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
newbie00 source file
reload(newbie00)
# ... now the changes will show up
but be warned that there are some traps to using reload(), so much so
that in Python 3 it has been relegated to the "imp" (short for "import")
module, where it is less tempting to newbies.
ook is probably acceptable, in my opinion.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
that unicodedata is buggy, or perhaps just
doesn't support the multilingual plane characters.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
elf, *args: self._dispatcher('foometh', *args),
self, self.__class__)
)
setattr(self, 'barmeth',
types.MethodType(
lambda self, *args: self._dispatcher('barmeth', *args),
self, self.__class__)
like this:
plot(lambda x: sin(x*pi), # function or expression to plot,
start=0.0,
end=2.0,
)
and have step size taken either from some default, or better still,
automatically calculated so one point is calculated per pixel.
Is there a way to do this in iPython or matplotlib?
e confirm that they are missing?
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ot;???")
> Assume the list
> of choices is short enough that the cost of building a temporary dict on
> each call is negligible.
Negligible or not, why bother?
Not that it really matters -- if you have a good reason for CHOICES to
remain a list, still stick with the dict lookup rather
raise TypeError('bad export')
Namespace = type(func.__name__, (), ns)
return Namespace()
Have fun!
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
f the mail server to
decide whether email can be delivered, not yours.
http://northernplanets.blogspot.com.au/2007/03/how-not-to-validate-email-addresses.html
http://haacked.com/archive/2007/08/21/i-knew-how-to-validate-an-email-address-until-i.aspx
http://haacked.com/archive/2007/08/26/don
that it is a code injection attack.
To learn more, you can start here:
http://cwe.mitre.org/top25/index.html
Two of the top three most common vulnerabilities are code injection
attacks, similar to the improper use of eval.
Here is the "eval injection" vulnerability:
http://cwe.mitr
On Thu, 24 May 2012 18:35:21 -0700, Paul Rubin wrote:
> Steven D'Aprano writes:
>> Why do you want to write buggy code that makes your users hate your
>> program? ...
>> The only way to validate an email address is to ACTUALLY SEND AN EMAIL
>> TO IT.
>
> Of
return self.s
Another is to use an extra level of indirection, and a mutable argument.
Instead of rebinding the non-local, you simply modify it in place:
def adder():
s = [0]
def a(x):
s[0] += x
return s[0]
return a
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
Pardon me for breaking threading, but Daniel's response is not available
on my ISP's news server, and I only discovered it by accident.
On Thu May 24 15:04:34 CEST 2012, Daniel Fetchinson wrote:
> > On Thu, 24 May 2012 08:50:59 +, Steven D'Aprano wrote:
> > From
ple_params
ws_comma
xreadlines
plus "from __future__ import print", and see what breaks :)
Also, don't forget future_builtins:
http://docs.python.org/library/future_builtins.html
Good luck, and if you do go ahead with this, please consider posting an
update here, or writing a blo
x27;: 5}
somefunc(*args, **kwargs)
is expanded to
somefunc(1, 2, 3, x=4, y=5)
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
to be
modified" actually means "Files that include something that a fixer cares
about, whether or not it gets modified" (in this case, isinstance).
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
n't being garbage collected, you probably have cycles of
objects with __del__ methods. Python's reference garbage collector can't
delete objects in cycles, and the alternative garbage collector can't
delete objects with __del__ methods.
Try removing the __del__ methods, and see
n't blocking scripts;
- try using a different browser.
If it still doesn't work, then ask for help.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
t; k = K()
py> x = k
py> y = [1, 2, x, 3]
py> z = {'spam': y}
py> del k
py> del x
py> del y
py> del z
Goodbye cruel world!
The destructor doesn't get called into the last reference is gone.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ar for
Mapping and MutableMapping are a bit unclear to me. But have you tried
registering your class as a Mapping explicitly?
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
are raising exceptions, your tests are broken. They
should either raise expected exceptions, in which case the exception is a
passing test, or they are failing tests, or they are bugs in your test
code. Fix the failing tests and the bugs in the test code, don't hide
them.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
g
are usually rare, you only notice it when there's a lot of data.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 01 Jun 2012 20:24:30 -0700, Temia Eszteri wrote:
> On 02 Jun 2012 03:05:01 GMT, Steven D'Aprano
> wrote:
>
>>I doubt that very much. If you are using threads, it is more likely your
>>code has a race condition where you are modifying a weak set at the sam
then running "make clean", "make", "sudo make altinstall" again.
(I used altinstall instead of install so as to avoid changing the system
Python.)
This was on a 32-bit Centos system, but I expect it should work just as
well on a 64-bit Debian system.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
/some/directory:/another/directory
To replace the system path completely:
export $PATH=/some/directory:/another/directory
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ee that this will happen in a timely manner. Best practice is to
close them manually once you are done.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ne 794, in getargspec
getfullargspec(func)
File "/usr/local/lib/python3.2/inspect.py", line 821, in getfullargspec
raise TypeError('{!r} is not a Python function'.format(func))
TypeError: is not a Python
function
How do I programmatically get the argument spec of built-in types'
__init__ or __new__ methods?
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
>>
>>>
>>> class MyClass(metaclass=Meta): # And now try to use it.
... pass
...
Traceback (most recent call last):
File "", line 1, in
TypeError: object.__new__() takes no parameters
What am I doing wrong?
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
> print a
> 3
>
>
> Now within an application I'd like to achieve exactly this behaviour
Before you reinvent the wheel, see the cmd and code modules.
http://docs.python.org/library/cmd.html
http://docs.python.org/library/code.html
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
r-loop:
for L in (a, b, c):
function(*L)
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
HP.
http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
and especially lack PHP's security vulnerabilities.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
you even consider reinventing the wheel?
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 14 Jun 2012 00:44:23 +0200, Gilles wrote:
> On 13 Jun 2012 22:16:51 GMT, Steven D'Aprano
> wrote:
>>Surely the obvious answer is that a framework offers the benefit that
>>you don't have to write the application from scratch.
>
> Yes, but between r
e-freeze is only days away, I strongly recommend
that you also raise it here:
http://mail.python.org/mailman/listinfo/python-dev
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
hing in between?
Python's random module is not cryptographically strong, which means that
it will probably take an organisation like the NSA, MI5, ASIO, Mossad,
etc. about 10 or 20 minutes to crack your password. But your little
sister will probably take a hundred million years to guess it.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
state.com/recipes/langs/python/
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ten it will, but that can't be taken for granted.
"A foolish consistency is the hobgoblin of little minds"
- Ralph Waldo Emerson
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
n from the
more conservative Python developers.)
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
before they did something
about it.
[1] And very likely a Facebook-like website that *was* Facebook. I reckon
the odds are about 50:50 that FB would prefer to keep a breach secret
than risk the bad publicity by fixing it.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 18 Jun 2012 01:19:32 -0700, jmfauth wrote:
> What is input() supposed to return?
Whatever you type.
u'a' == 'a'
> True
This demonstrates that in Python 3.3, u'a' gives a string equal to 'a'.
r1 = input(':')
> :a
Since you typed the letter a, r1 is the string "a" (a single ch
!
Incorrect. You are assuming that Python 3 input eval's the input like
Python 2 does. That is wrong. All you show is that the one-character
string "a" is not equal to the four-character string "u'a'", which is
hardly a surprise. You wouldn't expect the s
:: %s\r' % (i, c))
sys.stdout.flush()
time.sleep(0.2)
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 02 Jun 2011 10:55:49 -0500, harrismh777 wrote:
> Steven D'Aprano wrote:
>> What do you expect this code to do?
>>
>> a = 42
>> funcs = [(lambda x: x+a) for i in range(10)] funcs[0](1)
>
> I do see your point with this... truly... but it did get
On Fri, 03 Jun 2011 11:17:17 +1200, Gregory Ewing wrote:
> Steven D'Aprano wrote:
>
>> def kronecker(x, y):
>> if x == y: return 1
>> return 0
>>
>> This will correctly consume NAN arguments. If either x or y is a NAN,
>> it will return 0.
On Fri, 03 Jun 2011 14:35:52 +1000, Chris Angelico wrote:
> On Fri, Jun 3, 2011 at 2:23 PM, Steven D'Aprano
> wrote:
>>> You can't get a valid result from data produced by an invalid
>>> computation. Garbage in, garbage out.
>>
>> Of course yo
l you Matt?"
http://www.youtube.com/watch?v=_f_p0CgPeyA
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 03 Jun 2011 19:00:22 +0800, TheSaint wrote:
> Steven D'Aprano wrote:
>
>> def spinner():
>> chars = '|/-\\'
>
> Not exactly.
> I'd like to show 4~6 line of report and refreshing periodically all of
> them, avoiding to scroll
part to Perl's over-reliance on them, there's a tendency
among many coders (especially those coming from Perl) to abuse and/or
misuse regexes; people react to that misuse by treating any use of
regexes with suspicion.
But they have their role to play as a tool in the programmers toolbox.
Regarding their syntax, I'd like to point out that even Larry Wall is
dissatisfied with regex culture in the Perl community:
http://www.perl.com/pub/2002/06/04/apo5.html
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
rm "hard-wired string manipulation", but I
don't understand what point you're making. I don't understand what you
see as "hard-wired", or why you think
source.startswith(prefix)
is more hard-wired than
re.match(prefix, source)
[...]
> Perhaps you stopped reading after seeing his "regular expression culture
> is a mess" comment without trying to see what he meant by "culture" or
> "mess"?
Perhaps you are being over-sensitive and reading *far* too much into what
I said. If regexes were more readable, as proposed by Wall, that would go
a long way to reducing my suspicion of them.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 04 Jun 2011 12:14:03 +1200, Gregory Ewing wrote:
> Steven D'Aprano wrote:
>> Fair point. Call it an extension of the Kronecker Delta to the reals
>> then.
>
> That's called the Dirac delta function, and it's a bit different
Yes, I'm familiar w
On Fri, 03 Jun 2011 13:27:00 -0700, Carl Banks wrote:
> On Wednesday, June 1, 2011 5:53:26 PM UTC-7, Steven D'Aprano wrote:
[...]
>> On the contrary, it blows it out of the water and stomps its corpse
>> into a stain on the ground.
>
> Really? I am claiming that,
x27;t include function boolean arguments that merely swap between
two different actions".
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 03 Jun 2011 22:30:59 -0400, Roy Smith wrote:
> In article <4de992d7$0$29996$c3e8da3$54964...@news.astraweb.com>,
> Steven D'Aprano wrote:
>
>> Of course, if you include both case-sensitive and insensitive tests in
>> the same calculation, that's
On Fri, 03 Jun 2011 23:04:38 -0700, Ethan Furman wrote:
> Steven D'Aprano wrote:
>> NANs are not necessarily errors, they're hardly silent, and if you
>> don't want NANs, the standard mandates that there be a way to turn them
>> off.
>
> So how does o
ow that they're
more powerful than regexes, and it seems to me that they're also easier
to read and learn. I suspect that the programming world would have been
much better off if SNOBOL pattern matching had won the popularity battle
against regexes.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
for x in f():
yield x
A nice piece of syntax that has been proposed for Python is "yield from",
which will do the same thing, but you can't use that yet.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 04 Jun 2011 21:02:32 +0100, Nobody wrote:
> On Sat, 04 Jun 2011 05:14:56 +0000, Steven D'Aprano wrote:
>
>> This fails to support non-ASCII letters, and you know quite well that
>> having to spell out by hand regexes in both upper and lower (or mixed)
>>
On Sat, 04 Jun 2011 16:49:40 -0500, Robert Kern wrote:
> Steven is being a little hyperbolic. Python does not fully conform to
> all of the details of the IEEE-754 specification, though it does conform
> to most of them.
I'm not sure that "most" is correct, but that
them, but that falls down once you leave
> the scope of floating-point. It wouldn't have been within IEEE-754's
> ambit to declare that comparing NaNs should return NaB (Not A Boolean).
Of course it would have been. That's effectively what the standard
actually does
2)
0.7071067811865476
>>> s.send(5)
1.5275252316519465
>>> s.send(5)
1.4998
The non-running calculation of stdev gives this:
>>> stats.stdev([3, 2, 5, 5])
1.5
http://pypi.python.org/pypi/stats/
http://code.google.com/p/pycalcstats/
Be warned that the version on Google Code is unstable, and currently
broken.
Feedback is welcome!
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 05 Jun 2011 19:15:02 +0100, Nobody wrote:
> On Sun, 05 Jun 2011 07:21:10 +0000, Steven D'Aprano wrote:
>
>> Returning a sentinel meaning "an exceptional event occurred" is hardly
>> unusual, even in Python. str.find() does is, as does re.search() and
y conforms
to IEEE-754. The bottleneck now is not hardware, but languages that don't
treat floating point maths correctly.
http://www.cs.berkeley.edu/~wkahan/JAVAhurt.pdf
(The article is seven years old now, but as far as I know, the criticisms
still apply.)
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 06 Jun 2011 14:11:03 +1000, Chris Angelico wrote:
> On Mon, Jun 6, 2011 at 11:21 AM, Steven D'Aprano
> wrote:
>> The intended behaviour is operations on "quiet NANs" should return
>> NANs, but operations on "signalling NANs" should cause
of it. I won't say the only part.
[...]
>> If regexes were more readable, as proposed by Wall, that would go a
>> long way to reducing my suspicion of them.
>
> I am delighted to read that you find the new syntax more acceptable.
Perhaps I wasn't as clear as I could
lly start by writing the
documentation (a docstring and doctests) first. How else do you know what
the function is supposed to do if you don't have it documented?
By writing the documentation and examples before the code, I often
discover that the API I first thought of was rubbish :
On Mon, 06 Jun 2011 23:14:15 +0100, Nobody wrote:
> On Mon, 06 Jun 2011 00:55:18 +0000, Steven D'Aprano wrote:
>
>> And thus we come back full circle. Hundreds of words, and I'm still no
>> closer to understanding why you think that "NAN == NAN" should be
;__doc__': None, '__package__': None}
>>> def f(**kwargs):
... print kwargs
...
>>>
>>> f(**vars())
Traceback (most recent call last):
File "", line 1, in
TypeError: f() keywords must be strings
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 07 Jun 2011 01:03:55 -0300, Gabriel Genellina wrote:
> En Sat, 28 May 2011 14:05:16 -0300, Steven D'Aprano
> escribió:
>
>> On Sat, 28 May 2011 09:39:08 -0700, John Nagle wrote:
>>
>>> Python allows patching code while the code is executing.
>&g
its" or "license" for more information.
>>> class K(object):
... "foo"
...
>>> K.__doc__ = 'bar'
Traceback (most recent call last):
File "", line 1, in ?
TypeError: attribute '__doc__' of 'type' objects is not writable
It's an unnecessary restriction, as far as I'm concerned, but an old one.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 10 Jun 2011 07:33:34 +1000, Ben Finney wrote:
> Steven D'Aprano writes:
>> It's an unnecessary restriction, as far as I'm concerned, but an old
>> one.
>
> Well, it's incompatible with the Python compiler I keep in my head. Have
> these devel
1501 - 1600 of 15557 matches
Mail list logo