On Tue, 05 Feb 2008 06:19:12 +, Odysseus wrote:
> In article <[EMAIL PROTECTED]>,
> Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>
>> Another issue is testing. If you rely on global names it's harder to test
>> individual functions. [.
gt; getAllUserAttributes?
No and there can't be since the attributes you seem to be interested in
don't exist until an instance is created.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
A))
Out[370]: [('x', 1)]
> When I do help on some built-in function, it displays that function is
> built_in. Can that information get accessed using a function? (now,
> don't ask me to store help-output in buffer and grep for built-in).
Yes but it is not built-in. Have a look at the `inspect` module.
What's the use case?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
s namespace.
> I'm not sure enough of what I am doing to tell if I have another error in
> my code causing the problem. Is either of these examples supposed to work
> as shown? Is it clear that either example is obviously wrong?
The second is wrong. The first should
air the
> "mistake" (as I got an import error __import__ not found if I want to
> import __builtins__...?
Don't ``del __builtins__`` in the first place. :-)
> That's may be obvious for you, but that's all strange to me and I
> didn't find answers on the net...
So the real question is, why you see 'math' in `__builtins__`. It should
not be there.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ee of confusion among the jury when using the Chewbacca defense. :-)
http://en.wikipedia.org/wiki/Chewbacca_defense
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 08 Feb 2008 05:12:29 -0800, Ryszard Szopa wrote:
> Expressing simple loops as C for loops...
You mean simple loops like ``for i in xrange(1000):``? How should the
compiler know what object is bound to the name `xrange` when that loop is
executed?
Ciao,
Marc 'BlackJack&
On Tue, 12 Feb 2008 14:45:43 +0100, Sun wrote:
> then the question is how can I declare a empty set variable as a 'var= []'
> do to a list variable?
You don't declare variables in Python. Just create an instance of `set`
and bind it to a name:
var = set()
Ciao,
lue.
In [18]: def f(func, arg):
: return func(arg)
:
In [19]: f(int, '42')
Out[19]: 42
In [20]: f(str.split, 'a b c')
Out[20]: ['a', 'b', 'c']
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
bject to be sure
that it is still there and not already garbage collected. *But* it's not
guaranteed that `__del__()` is called at all! So if you think this clean
up is necessary to leave a usable console then don't put it into a
`__del__()` method!
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 15 Feb 2008 15:10:12 +, Sion Arrowsmith wrote:
> Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>>When the interpreter shuts down it has to remove objects. Everything you
>>need in a `__del__()` method must be referenced by that object to be su
x27;t create
several `Tk` instances. That usually causes very weird side effects.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
t is still in its early learning phase. ;-)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
uot;boxes", the memory location and type are attached to the name. In
Python both belong to the value.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
lls that it could use some loops to
refactor it into a **much** shorter piece of code.
Then get rid of the asterisk import, ``except``\s without a specific
exception to handle, and the``global`` statement before you repost the
problem.
Ciao,
Marc 'BlackJack' Rintsch
--
http
t do what you want, then
*what* exactly *do* you want? You know that `epydoc` supports
reStructuredText as markup language!?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 22 Feb 2008 12:32:10 +, Steven D'Aprano wrote:
> On Fri, 22 Feb 2008 08:12:56 +0000, Marc 'BlackJack' Rintsch wrote:
>
>> A "variable" in programming languages is composed of a name, a memory
>> location, possibly a type and a value. In C
end(); ++i )
> std::cout << *i << '\n';
> }
>
> As you can see the standard library takes care of all memory
> management.
Aaah, that's much nicer and easier to understand than the list
comprehension. After this great example I'll switch to C++. ;-)
But somehow you still manage memory by writing in a style that favors
value types.
SCNR,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
L` is a class attribute and it's rebound to the
instance, or if they tried it on a list in a tuple. Extending a list
that's a read only property doesn't work either.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
a.append(element)
>
> It may be more readable (although that's debatable), but it always
> traverses the entire list.
The ``not in`` stops if the element is found.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 23 Feb 2008 22:44:30 +, Tim Roberts wrote:
> Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>
>>On Fri, 22 Feb 2008 11:00:17 -0800, Aahz wrote:
>>
>>> It's just too convenient to be able to write
>>>
>>> L +=
? And if not, why?
I guess it's the method lookup that's the slow part. Factor it out of the
loop and measure again::
adict_get = adict.get
for _ in xrange(M):
for k in keys1:
r = adict_get(k, None)
for k in keys2:
r = adict_get(k, Non
ompletely wrong to
have to think about it and to write in that "value style", because that
goes against my expectations/picture of OOP -- a graph of
independent/loosely coupled objects communicating with each other. In
this sense C++ looks like a quite crippled and fragile OOP language t
le
> manner as seen by those general population not by people who holds a
> CS degree.
So why is it creepy then!? ``3 // 4`` is for the people knowing about
integer division and ``3 / 4`` gives the expected result for those who
don't. Those who don't know ``//`` can write ``
On Tue, 26 Feb 2008 06:33:01 -0800, castironpi wrote:
> On Feb 26, 8:14 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>> On Tue, 26 Feb 2008 06:02:12 -0800, bearophileHUGS wrote:
>> > This is a real difference, that has real impact on the programs I
", "copyright", "credits" or "license" for more information.
>>> 3 / 4
0.75
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 26 Feb 2008 09:13:35 -0800, castironpi wrote:
> Back home, the original post would be interesting, so I wrote it.
So you think of this group as your personal notepad. That explains a lot. :-/
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/li
t. I'll bite. This a bit of an overreaction unless you
know what the course was about. If the goal is to learn about the
computer and that basically everything is a number in the end, then C is a
good choice. More portable than assembler but nearly as close to the
metal.
To the OP: If y
of letting it propagate to the
top level and ending the program.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ell works and I don't notice much complaints about it.
Complain! :-)
For implementing this in Python you have to carry an "is allowed to be
coerced to float" flag with every integer object to decide at run time if
it is an error to add it to a float or not. Or you make Python into a
statically typed language like Haskell. But then it's not Python anymore
IMHO.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ly it's about a language called C
++ according to the OP.
>> To the OP: If you try C++, don't hold that crappy language against C#, D,
>> or Java. ;-)
>
> What's the relevance of C#, D, or Java to the OP's post?
The same as C++ to the OP's post if he would have talked about C. :-)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ing.
Then you should work through the tutorial in the docs, at least until
section 8.3 Handling Exceptions:
http://docs.python.org/tut/node10.html#SECTION0010300000
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
how. `x` doesn't start as
`Int` or `Integer` but the very generic and AFAIK abstract type class `Num`.
After seeing the second line the compiler finds an implementation for `+`
and the type class `Fractional` for both operands and now thinks `x` must
be a `Fractional`, a subclass of `Num`.
enied
>
> What is missing?
To state the ovious: the rights to create a file at `file_path`. Remember
that web servers usually have their own "user".
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 02 Mar 2008 14:15:09 +, Steve Turner wrote:
> Apart from doing something like
> a=[0,0,0]
> b=[0,0,0]
> c=[0,0,0]
> d=[a,b,c]
>
> is there a better way of creating d??
a = [[0] * 3 for dummy in xrange(3)]
Ciao,
Marc 'BlackJack' Rintsch
--
On Sun, 02 Mar 2008 21:58:31 +0100, Christoph Zwerschke wrote:
> Marc 'BlackJack' Rintsch schrieb:
>> On Sun, 02 Mar 2008 14:15:09 +, Steve Turner wrote:
>>
>>> Apart from doing something like
>>> a=[0,0,0]
>>> b=[0,0,0]
>>> c=[0,0
a description of either what error message you
get, with full traceback, or if it does not raise an exception but just
does not what you excpect it to do, tell us what you expected and what you
get instead.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
, that you have a problem with encodings
but what is the *specific* problem? Where does the program fail? With
what exception(s)?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
getitem__()` is enough. The end will be signaled by an
`IndexError`.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
] = 'æÂï½ æ½å¤æ¤Ã¥Ã¯Â«Ã¥Ã©Ã©Â§Ã§Â²Ã¨';
> $errorMessage = 'æÂï½ æ½å¤æ¤Ã¥Ã¯Â«Ã¥Ã©Ã©Â§Ã§Â²Ã¨';
> }
Looks like an UTF-8 encoded file viewed as ISO-8859-1. Sou you should
decode `content` to unicode before searching the chinese characters.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
>>>reload(module)
>> >>>c2 = module.Someclass
>> >>>c1 is c2
>
> What about
>
>>>> o= object()
>>>> b1= o.someattr
>>>> reload( o )
>>>> b2= o.someattr
>>>> b1 is b2
>
> ?
You are really a bit thick, a troll, or a bot.
*plonk*
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
occurs and to
> print the sizes. However, i'd like to
> assign these values to the button so it
> always stays the same width as the frame.
Don't do it yourself, pack with the `fill` argument set to `Tkinter.X`.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
he same `CSS` instance.
Ciao,
Marc 'BlackJack'
--
http://mail.python.org/mailman/listinfo/python-list
n_
or Pyrex_ do. Both compile a subset of Python with optional static typing
to C extension modules.
.. _Cython: http://www.cython.org/
.. _Pyrex: http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ays an
implicit ``return None`` at the end of every function.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
tates 'NameError: global name '__file__' is not defined'
>>
>> In Python 2.5 I ran my script as a module in IDLE gui. How does _file_ get
>> defined?
>>
> Do you perhaps mean '__name__'?
I guess not. It makes more sense to apply path functi
On Fri, 14 Mar 2008 17:06:00 +, Matt Nordhoff wrote:
> Hmm, if Perl's on-disk hash tables are good, maybe someone should port
> them to Python, or maybe someone already has.
I don't know Perl's on-disk hash tables but there is a `shelve` module in
the standard library
eedup routine now
> offered by simplejson -- yet the need to do this apostrophe escaping seems
> to negate this advantage! Is there perhaps some combination of dumps keyword
> arguments, python encode()/str() magic, or something similar that
> accomplishes this same result?
>
> What is the highest-performance way to get simplejson to emit the desired
> serialization of the given test string?
Somehow I don't get what you are after. The ' doesn't have to be escaped
at all if " are used to delimit the string. If ' are used as delimiters
then \' is a correct escaping. What is the problem with that!?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
Script embeddable escaped literal string. That's simply not the
job of a JSON encoder. That's another level of encoding/escaping
producing something that is not JSON anymore, so why do you want to ask a
JSON encoder to deliver it?
This is a feature/function you should find in a HTML templating library.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
unpack(">I", s)[0]
Maybe a little more compact and readable:
In [92]: sys.byteorder
Out[92]: 'little'
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
t;
> Those are valid XML and valid XML-RPC, but isn't.
In XML-RPC there is no `None`, so there's the non standard `allow_none`
Option to allow `None` to be represented as .
And is an empty or really valid XML-RPC?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
x27;
>
> There's a difference between those two. The first one has an empty
> string value ('') while the second one pretty clearly says that
> there is a parameter but has no value.
>
> Why ?
Because there is a difference between no value and the NULL value!?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
oring
only binary "tokenized" files instead of plain text or even one big binary
file that contains all sources and resources of the project.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ny particular division
> operator? Can work out whether the result should be integer or float,
> independent of any particular set of arguments? Seems unlikely.
The interpreter can at least print out warnings when a "normal" division
operator is called with two `int`\s at runtime.
Ci
On Wed, 19 Mar 2008 17:59:40 +0100, sam wrote:
> Can someone tell me why class-based OO is better that Prototype based,
> especially in scripting langage with dynamic types as Python is?
Is it better!?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman
object then I get a
> "UnicodeError" saying that the unicode 2029 can't be encoded...
>
> Can anyone please tell me how I should handle that paragraph seperator?
You have to encode the unicode object in an encoding that know this
character. UTF-8 might be a candidate encoding for th
call are
just *two* characters with a byte value of zero:
In [116]: len('\x00\x00')
Out[116]: 2
In [117]: print '\x00\x00'
In [118]: len('\\x00\\x00')
Out[118]: 8
In [119]: print '\\x00\\x00'
\x00\x00
The backslash has a special meaning in string literals. If you don't want
this meaning, you have to escape it with another backslash.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
t with the `seek()`
method.
That only works on "seekable" files and it's not a good idea anyway
because usually the files and the overhead of reading is greater than the
time to iterate over in memory data like the patterns.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
nebreak.
>
> Any idea why these are there or how to get rid of them?
Any chance you are doing this on Windows and Excel doesn't like the
return+linefeed line endings that Windows produces when writing files in
text mode? Try 'wb' as mode for the output file.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
del__()` the elements would get garbage collected just
fine. If you don't want to wait until the garbage collector in CPython
detects the cycle, you can use `weakref`\s for one of the two "pointers"
in each element.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 25 Mar 2008 12:32:17 -0700, blackpawn wrote:
> So what's the deal here? :) I want all objects to be freed when I
> shut down and their destruction functions to be properly called.
Then you want something that's not guaranteed by the language.
Ciao,
Marc
function? I didn't really get the meaning of
> those while reading the python user manual...
Usually `pickle` just works. Those methods can be used if you want to
customize the process, for example if you don't want to pickle the entire
object but just parts of it.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
value contains UTF-8
> stuff (differing number of bytes per character), the length of the
> resulting string (in characters) varies. How can I fix this?
Use unicode strings instead.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
= s.upper().lstrip(chars.upper())
> return s[len(s)-len(s2):]
> else:
> return s.lstrip(chars)
What about this:
def lstrip2(string, chars, ignore_case=True):
if ignore_case:
chars = chars.lower() + chars.upper()
return string.lstrip(chars)
Ciao,
7;before'
>
> Here I can write all symbols, but not read. I've tested it with python
> 2.6, 2.5 and 2.2 and WinXP SP2.
>
> Why is it so and is it possible to fix it?
\x1a is treated as "end of text" character in text files by Windows. So
if you want all, unaltered data, open the file in binary mode ('rb' and
'wb').
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
hat are all those line continuation characters ('\') for? You are aware
that they are unnecessary here?
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
w I could solve
> this problem, as with a google search i didn't find the solution.
Look into the `email` package in the standard library.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
vent adding attributes
dynamically. And it has some drawbacks when you inherit from such
classes.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
es" seems to be asking for trouble to me.
That's why those regions are usually "write protected" and "no execution
allowed" from the code in the user area of the virtual address space.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
gt; Why not? Just saying it isn't doesn't make it not.
Because "developer" means people who don't mess with implementation
details. So they respect the leading underscore convention. No use case
for enforced access restriction.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
t; currentDate:
> newInc = "01".zfill(2)
> serial = currentDate + newInc
> print "date is different"
> return serial
Both branches do almost the same. You should try to avoid such code
duplication.
if date == currentDate:
u mean by "suggests … extreme semantics"? Most natural thing
is to use numbers and there you *have* to be able to return something
different than `self` to get anything useful. For instance:
n *= 3
with `n` bound to a number different from zero can't return `self` from
`__imul
" by default and of course define
your own set of "value doesn't matter" names.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
rom within the editor.
>
> I don't know what an IBQ is.
+IBQ- seems to be the way your newsreader displays the dashes that where
in Ben's posting. I see "em dash" characters there:
In [84]: unicodedata.name(u'—')
Out[84]: 'EM DASH'
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ee IBQ too ... also weird is that he has Content-Type: text/plain;
> charset=utf-7
Why weird? Makes perfect sense:
In [98]: print '+IBQ-'.decode('utf-7')
—
In [99]: unicodedata.name('+IBQ-'.decode('utf-7'))
Out[99]: 'EM DASH'
So there are newsrea
gt;open("Chuck.S01E01.HDTV.XViD-YesTV.avi", "rb").read(1024)
> b'\x00\x00\x00\x00\x00\x00\x00'
As MRAB says, maybe the first 1024 actually *are* all zero bytes. Wild
guess: That's a file created by a bittorrent client which preallocates
the files
On Mon, 26 Jan 2009 12:22:18 +, Sion Arrowsmith wrote:
> content = a.readlines()
>
> (Just because we can now write "for line in file" doesn't mean that
> readlines() is *totally* redundant.)
But ``content = list(a)`` is shorter. :-)
Ciao,
Marc
On Mon, 26 Jan 2009 16:10:11 +0100, Andreas Waldenburger wrote:
> On 26 Jan 2009 14:51:33 GMT Marc 'BlackJack' Rintsch
> wrote:
>
>> On Mon, 26 Jan 2009 12:22:18 +, Sion Arrowsmith wrote:
>>
>> > content = a.readlines()
>> >
>> >
t; return line
def __repr__(self):
return '0x%X' % self.value
> __str__ = __repr__
This is unnecessary, the fallback of `__str__` is `__repr__` already.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 30 Jan 2009 21:59:34 +0100, Stef Mientki wrote:
> Marc 'BlackJack' Rintsch wrote:
>> On Fri, 30 Jan 2009 00:25:03 +0100, Stef Mientki wrote:
>>
>>
>>> try this:
>>>
>>> class MyRegClass ( int ) :
>>> def __init__ ( s
a class
> definition and see the declaration of a veryInterestingMember and forget
> that you're not supposed to access it. If you try to access it, the
> compiler will give you a diagnostic message at compile time.
I can't forget that because if I'm not supposed to acce
rting Java Access Protection for Unit Testing`_ for examples.
.. _Subverting Java Access Protection for Unit Testing:
http://www.onjava.com/pub/a/onjava/2003/11/12/reflection.html
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
inteheritance
> situations. For the simple case, though, like that presented by the OP,
> I believe super() is perfect.
But for the simple cases it is unnecessary because it was invented to
deal with multiple inheritance problems.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
perative way (this is not polite).
So I'm impolite. :-) I'm using multiple inheritance only for mixin
classes and even that quite seldom. No `super()` in my code.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
m? If not then
`ctypes` might be the wrong tool.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
ms*.
A revision or version control system (VCS) lets you record the evolution
of your software. You can tag versions with symbolic names like "Dev4"
or "Release-1.0" and can ask the VCS for a copy of the sources with a
given tag or even date.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
.2g/2048
>
> Could anyone please explain why this happens? It seems some memory are
> not freed.
It seems the memory is not given back to the operating system. This
doesn't mean that it is not freed by Python and can't be used again by
Python. Create the dictionary again a
_file.writelines(islice(lines, 7, 12))
if __name__ == "__main__":
main()
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
; guessed the wrong way. We have no way of knowing how many people guessed
> the right way.
Or how many worked through the tutorial, stumbled across the warning
about that behavior and got that question answered before they have even
known there's something to guess.
Ciao,
Marc
p, learned something new today. Naively, I though a list was
> index=value, where value=a single piece of data.
Your thought was correct, each value is a single piece of data: *one*
tuple.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
lf if
those methods are really methods, because they don't use `self` so they
could be as well be functions or at least `staticmethod`\s.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 25 Nov 2008 10:48:01 +, John O'Hagan wrote:
> On Tue, 25 Nov 2008, Marc 'BlackJack' Rintsch wrote:
>> On Tue, 25 Nov 2008 07:27:41 +, John O'Hagan wrote:
>> > Is it better to do this:
>> >
>> > class Class_a():
>>
your `unicode` object
so you get bytes to feed to the MD5 algorithm.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
undocumented parts of the code anymore, because
now every "docable" object has "documentation" like this just to make the
compiler happy:
def spam(foo, bar):
"""
:param foo: a foo object.
:param bar: a bar object.
"""
Which basically
t; I agree that for newcomers to Python, the class method definition might
> seem strange.
And after the change it continues to because they will run into *both*
variants in tutorials, code, and books, so it might be even more
confusing.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
beep in X-Windows so every desktop environment implements
something like audio notifications.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
are year and
month of release. So this year's releases have "version" 8 and the
latest is from october so it is 8.10.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
module named future_builtins
>
> Hmmm... does this mean that Python3 has no future? :-)
It is just not built in. So it is easier to change the future by
replacing the module. ;-)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
#x27;m usually using UTF-8 as default but offer the user ways, e.g. command
line switches, to change that.
If I have to display file names in a GUI I use a decoded version of the
byte string file name, but keep the byte string for operations on the
file.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
1301 - 1400 of 1811 matches
Mail list logo