Hello everyone,
I'm glad to announce a python package: pyarmor.
PA HREF=http://dashingsoft.com/products/pyarmor.html;Pyarmor
1.7.3/A - A python package could import/run encrypted python
scripts. (03-11-14)
Some python developer may be not want to distribute the literal
python scripts to his
On behalf of the Nikola team, I am pleased to announce the immediate
availability of Nikola v7.2.0. It features many bugfixes, and also
some new useful features.
What is Nikola?
===
Nikola is a static site and blog generator, written in Python. It can
use Mako and Jinja2 templates,
https://github.com/Veek/Python/tree/master/junk/hello
doesn't work.
I have:
hello.c which contains: int hello(void);
hello.h
To wrap that up, i have:
hello.py - _hello (c extension) - pyhello.c - method py_hello()
People using this will do:
python3.2 import hello
python3.2 hello.hello()
It
Hi,
I want to generate a unique variable name for list using python.
list1=...
list2=...
.
.
.
listx=... where x is a number.
You can remember it from saving a file in a directory. If you have already
created a new file, save dialog sugget that new file is already exist,
do you want to save
I seem to be stuck with some issues of Idle on macs.
The page https://www.python.org/download/mac/tcltk
seems to talk only of Tcl/Tk versions 8.5
Macports seem to have at 8.6
https://www.macports.org/ports.php?by=librarysubstr=tcl
With a direct download of Tcl/Tk there are some security warnings
4 Kasım 2014 Salı 13:29:34 UTC+2 tarihinde Fatih Güven yazdı:
Editted: Grammar revision.
Hi,
I want to generate a unique variable name for list using python.
list1=...
list2=...
.
.
.
listx=... where x is a number.
You can remember it from saving a file in a directory. If you have
Fatih Güven wrote:
I want to generate a unique variable name for list using python.
list1=...
list2=...
.
.
.
listx=... where x is a number.
You can remember it from saving a file in a directory. If you have already
created a new file, save dialog sugget that new file is already
Fatih Güven wrote:
4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih Güven yazd?:
I want to generate a unique variable name for list using python.
list1=...
list2=...
for x in range(1,10):
exec(list%d = [] % x)
--
https://mail.python.org/mailman/listinfo/python-list
On 2014-11-04 12:43:59 +, Rustom Mody said:
I seem to be stuck with some issues of Idle on macs.
The page https://www.python.org/download/mac/tcltk
seems to talk only of Tcl/Tk versions 8.5
System's 8.5 should be enough, if not there's explicit mention of the
ActiveTcl distribution.
Op 03-11-14 om 12:09 schreef Chris Angelico:
On Mon, Nov 3, 2014 at 10:04 PM, Antoon Pardon
antoon.par...@rece.vub.ac.be wrote:
Is it possible to have a default dictionary where the default is dependant
on the key?
I was hoping something like this might work:
m = defaultdict(lambda key:
Veek M wrote:
Fatih Güven wrote:
4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih Güven yazd?:
I want to generate a unique variable name for list using python.
list1=...
list2=...
for x in range(1,10):
exec(list%d = [] % x)
Why would you do this?
--
4 Kasım 2014 Salı 15:19:20 UTC+2 tarihinde Veek M yazdı:
Fatih Güven wrote:
4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih Güven yazd?:
I want to generate a unique variable name for list using python.
list1=...
list2=...
for x in range(1,10):
exec(list%d = [] % x)
This is
4 Kasım 2014 Salı 15:37:59 UTC+2 tarihinde Peter Otten yazdı:
Veek M wrote:
Fatih Güven wrote:
4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih Güven yazd?:
I want to generate a unique variable name for list using python.
list1=...
list2=...
for x in range(1,10):
Fatih Güven wrote:
This is okay but i can't use the method .append for example
list1.append(abc)
works for me
--
https://mail.python.org/mailman/listinfo/python-list
So How should I call this:
class ...dict(dict):
def __init__(self, fun):
self.fun = fun
def __missing__(self, key):
return self.fun(key)
I don't know how you should,
but I tried the following
which seems to work
class KeyPlusOne( dict ) :
def
Hi
I dont really understood how fill and expand
works with layout manager tkinter.pack()
Example:
from tkinter import *
root = Tk()
w = Label(root, text=Red, bg=red, fg=white)
w.pack(side=LEFT, fill = BOTH)
Here is the result:
http://cjoint.com/?0Kepj1E3Tv3
Why is the label w only extended
ast nom...@invalid.com a écrit dans le message de
news:5458dfc6$0$27505$426a7...@news.free.fr...
w.pack(side=LEFT, fill = BOTH)
Why is the label w only extended vertically and not horizontally too ?
with:
w.pack(side=TOP, fill = BOTH)
it expand horizontally but not vertically
with:
- Original Message -
From: Fatih Güven mfthgu...@gmail.com
I have a structured and repetitive data. I want to read a .txt file
line by line and classified it to call easily. For example employee1
has a name, a salary, shift, age etc. and employee2 and other 101
employee have all of
4 Kasım 2014 Salı 16:16:52 UTC+2 tarihinde ast yazdı:
Hi
I dont really understood how fill and expand
works with layout manager tkinter.pack()
Example:
from tkinter import *
root = Tk()
w = Label(root, text=Red, bg=red, fg=white)
w.pack(side=LEFT, fill = BOTH)
Here is the result:
I wish to automate the downloading from a particular site which has some ADs
and which requires to click on a lot of buttons before the download starts.
What library should I use to handle HTTP?
Also, I need to support big files ( 1 GB) so the library should hand the data
to me chunk by chunk.
On Tue, Nov 4, 2014 at 8:52 PM, Veek M vek.m1...@gmail.com wrote:
https://github.com/Veek/Python/tree/master/junk/hello
doesn't work.
I have:
hello.c which contains: int hello(void);
hello.h
To wrap that up, i have:
hello.py - _hello (c extension) - pyhello.c - method py_hello()
People
On Wed, Nov 5, 2014 at 1:53 AM, Kiuhnm gandal...@mail.com wrote:
I wish to automate the downloading from a particular site which has some ADs
and which requires to click on a lot of buttons before the download starts.
What library should I use to handle HTTP?
Also, I need to support big
Fatih Güven wrote:
4 Kasım 2014 Salı 15:37:59 UTC+2 tarihinde Peter Otten yazdı:
Veek M wrote:
Fatih Güven wrote:
4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih Güven yazd?:
I want to generate a unique variable name for list using python.
list1=...
list2=...
for x in
Hi-
Questions like this appear so often in various places (mailing lists,
forums, sites like Stack Overflow) that I think a very blunt/candid
answer is appropriate. This is especially true since there's always
someone who responds to the question as-is with some monstrosity of
exec() and string
On Tuesday, November 4, 2014 4:00:51 PM UTC+1, Chris Angelico wrote:
On Wed, Nov 5, 2014 at 1:53 AM, Kiuhnm gandal...@mail.com wrote:
I wish to automate the downloading from a particular site which has some
ADs and which requires to click on a lot of buttons before the download
starts.
On Tue, 2014-11-04 at 16:22 +0630, Veek M wrote:
https://github.com/Veek/Python/tree/master/junk/hello
doesn't work.
I have:
hello.c which contains: int hello(void);
hello.h
To wrap that up, i have:
hello.py - _hello (c extension) - pyhello.c - method py_hello()
People using this will
I'm not sure if it fits your needs, but we are very happy with calling c
libs directly from python using ctypes:
https://docs.python.org/2/library/ctypes.html
It requires a few extra lines in Python to handle the parameter and
return types.
import ctypes
result = ctypes.windll.Hello.hello()
I was wondering if I could get some feedback on the biggest thing I
have done as an amateur Python coder. The sidepots algorithm isn't
correct yet, but I haven't worked on it in a while and thought I would
get some advice before diving back in.
import random, os
4 Kasım 2014 Salı 17:01:17 UTC+2 tarihinde Peter Otten yazdı:
Fatih Güven wrote:
4 Kasım 2014 Salı 15:37:59 UTC+2 tarihinde Peter Otten yazdı:
Veek M wrote:
Fatih Güven wrote:
4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih Güven yazd?:
I want to generate a unique variable
Fatih Güven wrote:
4 Kasım 2014 Salı 17:01:17 UTC+2 tarihinde Peter Otten yazdı:
Fatih Güven wrote:
4 Kasım 2014 Salı 15:37:59 UTC+2 tarihinde Peter Otten yazdı:
Veek M wrote:
Fatih Güven wrote:
4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih Güven yazd?:
I want to
Søren wrote:
import ctypes
Hi, yeah i kind of liked it - still reading the docs though, Beazley has the
Python.h solution so I though I'd try that first.
--
https://mail.python.org/mailman/listinfo/python-list
Jason Swails wrote:
I've submitted a PR to your github repo showing you the changes
necessary to get your module working on my computer.
Segfaults :p which is an improvement :)
open(./_hello.cpython-32mu.so, O_RDONLY) = 5
read(5,
On Tue, 2014-11-04 at 21:45 +0630, Veek M wrote:
Jason Swails wrote:
I've submitted a PR to your github repo showing you the changes
necessary to get your module working on my computer.
Segfaults :p which is an improvement :)
What operating system are you running this on? It works fine
Jason Swails wrote:
What operating system are you running this on? It works fine for me on
Linux:
Wheezy Debian, Linux deathstar 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3
x86_64 GNU/Linux
gcc (Debian 4.7.2-5) 4.7.2
Python 3.2.3
I ran it through gdb - not very useful:
(gdb) bt
#0
I intend to write in lowest level of computer programming as a hobby.
It is true that is impossible write in binary code, the lowest level
of programming that you can write is in hex code?
What is the lowest level of programming computers that you can write ?
Is binary code?
Is hex code?
Is
On 2014-11-04, françai s romaper...@gmail.com wrote:
I intend to write in lowest level of computer programming as a hobby.
It is true that is impossible write in binary code,
No. You can write in binary if you want. If I were going to do
something like that I'd pick a CPU like a PDP11 with
static PyMethodDef hellomethods[] = {
{hello, py_hello, METH_VARARGS, py_hello_doc},
{NULL, NULL, 0, NULL},
};
It's basically the METH_VARARGS field that's giving the problem. Switching
it to NULL gives,
SystemError: Bad call flags in PyCFunction_Call. METH_OLDARGS is no longer
On Tue, 04 Nov 2014 05:45:04 -0800, Fatih Güven wrote:
4 Kasım 2014 Salı 15:19:20 UTC+2 tarihinde Veek M yazdı:
Fatih Güven wrote:
4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih Güven yazd?:
I want to generate a unique variable name for list using python.
list1=...
list2=...
On Tue, 04 Nov 2014 05:53:04 -0800, Fatih Güven wrote:
Call employee1.name or employee2.salary and assign it to a new variable,
something etc.
1) Put the file into a database.
2) database calls
--
Denis McMahon, denismfmcma...@gmail.com
--
On Tue, Nov 4, 2014 at 11:09 AM, Veek M vek.m1...@gmail.com wrote:
static PyMethodDef hellomethods[] = {
{hello, py_hello, METH_VARARGS, py_hello_doc},
{NULL, NULL, 0, NULL},
};
It's basically the METH_VARARGS field that's giving the problem. Switching
it to NULL gives,
okay got it working - thanks Jason! The 3.2 docs are slightly different.
--
https://mail.python.org/mailman/listinfo/python-list
On Tuesday, November 4, 2014 10:19:36 PM UTC+5:30, françai s wrote:
I intend to write in lowest level of computer programming as a hobby.
It is true that is impossible write in binary code, the lowest level
of programming that you can write is in hex code?
What is the lowest level of
Is there a way to do pkcs7 / 12 signing with python. I looked at various
cryptographic packages, but it's not clear if any of them can do this.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
Grant's statements are correct and his advice is sound.
I would not waste my time writing machine code, even as a hobby (and not even
if your other hobbies include juggling chain saws). It's too time-consuming,
tedious, bug-prone, and eyeglass-prescription-enhancing.
Programming in assembly
On Tuesday, November 4, 2014 8:49:36 AM UTC-8, françai s wrote:
I intend to write in lowest level of computer programming as a hobby.
It is true that is impossible write in binary code, the lowest level
of programming that you can write is in hex code?
What is the lowest level of
This list is for the development _of_ Python, not development _with_ Python.
Try asking on Python List.
(forwarding...)
On 11/04/2014 08:52 AM, Roberto Martínez wrote:
I am trying to replace dinamically the __call__ method of an object using
setattr.
Example:
$ cat testcall.py
class A:
On Tue, 2014-11-04 at 23:03 +0630, Veek M wrote:
okay got it working - thanks Jason! The 3.2 docs are slightly different.
What did you need to do to get it working?
--
https://mail.python.org/mailman/listinfo/python-list
On 2014-11-04 05:53, Fatih Güven wrote:
for x in range(1,10):
exec(list%d = [] % x)
Why would you do this?
I have a structured and repetitive data. I want to read a .txt file
line by line and classified it to call easily. For example
employee1 has a name, a salary, shift, age
sohcahto...@gmail.com a écrit dans le message de
news:e5c95792-f81f-42b4-9996-5545f5607...@googlegroups.com...
On Tuesday, November 4, 2014 8:49:36 AM UTC-8, françai s wrote:
I can't think of any reason why someone would WANT
to program in binary/hex machine code.
It happens if you design
Yikes, I didn't realize the difference in inheritance.
The thing with this is tricky. I need the change in the instance, not in
the class, because I have multiple instances and all of them must have
different implementations of __call__.
The workaround of calling a different method inside
On Tue, Nov 4, 2014 at 1:01 PM, Roberto Martínez robertomartin...@gmail.com
wrote:
The workaround of calling a different method inside __call__ is not valid
for my case because I want to change the *signature* of the function also
-for introspection reasons.
You could define __call__ like
- Original Message -
From: C Smith illusiontechniq...@gmail.com
To: python-list@python.org
Sent: Tuesday, 4 November, 2014 4:28:33 PM
Subject: Code review
I was wondering if I could get some feedback on the biggest thing I
have done as an amateur Python coder. The sidepots
On 11/04/2014 11:01 AM, Roberto Martínez wrote:
Yikes, I didn't realize the difference in inheritance.
The thing with this is tricky. I need the change in the instance, not in the
class, because I have multiple instances
and all of them must have different implementations of __call__.
The
On 11/04/2014 11:01 AM, Roberto Martínez wrote:
(Ethan, sorry for posting to python-dev, I thought that it was an
implementation detail of CPython 3.X)
No worries. It's good practice to post here first, just in case. ;)
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, Nov 4, 2014 at 8:06 PM, Skip Montanaro skip.montan...@gmail.com
wrote:
On Tue, Nov 4, 2014 at 1:01 PM, Roberto Martínez
robertomartin...@gmail.com wrote:
The workaround of calling a different method inside __call__ is not valid
for my case because I want to change the *signature*
On Tue, Nov 4, 2014 at 7:15 PM, Roberto Martínez
robertomartin...@gmail.com wrote:
On Tue, Nov 4, 2014 at 8:06 PM, Skip Montanaro skip.montan...@gmail.com
wrote:
On Tue, Nov 4, 2014 at 1:01 PM, Roberto Martínez
robertomartin...@gmail.com wrote:
The workaround of calling a different
On Tuesday, November 4, 2014 10:51:53 AM UTC-8, ast wrote:
sohcahtoa82 a écrit dans le message de
news:e5c95792-f81f-42b4-9996-5545f5607...@googlegroups.com...
On Tuesday, November 4, 2014 8:49:36 AM UTC-8, françai s wrote:
I can't think of any reason why someone would WANT
to program in
On 11/04/2014 08:45 AM, françai s wrote:
I intend to write in lowest level of computer programming as a hobby.
It is true that is impossible write in binary code, the lowest level
of programming that you can write is in hex code?
What is the lowest level of programming computers that you can
I am trying to add a key value pair of (Priority:1) to queue1,
(Priority:2) to queue2, and (Priority:3) to queue3.
When I just add (Priority:1) to queue1, it works.
But when I run the above code, (Priority:3) is being added to all the
queues.
This looks trivial and I don't understand why
On 11/04/2014 11:23 AM, Nathaniel Smith wrote:
(Or alternatively I guess you could go all in: Iä! Iä! Metaclasses Fhtagn!)
Metaclasses aren't that bad! I've written one.
And the dizzy spells are getting better!
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 2014-11-04, ast nom...@invalid.com wrote:
sohcahto...@gmail.com a écrit dans le message de
news:e5c95792-f81f-42b4-9996-5545f5607...@googlegroups.com...
On Tuesday, November 4, 2014 8:49:36 AM UTC-8, françai s wrote:
I can't think of any reason why someone would WANT
to program in
In article m3ajif$30o$1...@virtdiesel.mng.cu.mi.it,
Andrea D'Amore anddamnopsam+gru...@brapi.net wrote:
On 2014-11-04 12:43:59 +, Rustom Mody said:
I seem to be stuck with some issues of Idle on macs.
The page https://www.python.org/download/mac/tcltk
seems to talk only of Tcl/Tk
On 2014-11-04 19:37, Anurag Patibandla wrote:
I am trying to add a key value pair of (Priority:1) to queue1, (Priority:2) to queue2, and
(Priority:3) to queue3.
When I just add (Priority:1) to queue1, it works.
But when I run the above code, (Priority:3) is being added to all the
queues.
This
C Smith illusiontechniq...@gmail.com writes:
I was wondering if I could get some feedback on the biggest thing I
have done as an amateur Python coder.
Comments.
You need a *lot* more comments.
Like, every line or two of code should have a comment explaining what is
being accomplished.
On Tuesday, November 4, 2014 2:37:49 PM UTC-5, Anurag Patibandla wrote:
I am trying to add a key value pair of (Priority:1) to queue1,
(Priority:2) to queue2, and (Priority:3) to queue3.
When I just add (Priority:1) to queue1, it works.
But when I run the above code, (Priority:3) is being
On 2014-11-04 19:55:00 +, Ned Deily said:
[…] all Apple 8.5 version have serious bugs that have been fixed
upstream. The most
serious involves an immediate, unrecoverable crash in Tk when typing a
composition character in an edit window or the IDLE shell […]
I stand corrected, I wasn't
You could go to
http://incolor.inetnebr.com/bill_r/computer_simulators.htm and get the
Altair 8800 or IMSAI 8080 emulator. Run the program and toggle in
binary code for these easy to use 8 bit processors.
There's a short manual for the IMSAI on the same page and the manual
plus instruction
On Tuesday, November 4, 2014 12:35:32 PM UTC-8, John Gordon wrote:
C Smith illusiontechniq...@gmail.com writes:
I was wondering if I could get some feedback on the biggest thing I
have done as an amateur Python coder.
Comments.
You need a *lot* more comments.
Like, every line or
On Tuesday, November 4, 2014 4:10:59 PM UTC+1, Kiuhnm wrote:
On Tuesday, November 4, 2014 4:00:51 PM UTC+1, Chris Angelico wrote:
On Wed, Nov 5, 2014 at 1:53 AM, Kiuhnm gandal...@mail.com wrote:
I wish to automate the downloading from a particular site which has some
ADs and which
Hello,
please how can I detect mouse pointer type? I would like to print every
mouse pointer change (arrow, hand, ...) while moving my mouse over screen.
How can I do this? (for now I need it for windows, but cross-platform
solution is highly appreciated)
Many thanks.
--
When I call subprocess.check_output() I see the console window appear and
disappear very quickly. Is there a way to stop the console from showing up at
all?
--
https://mail.python.org/mailman/listinfo/python-list
On Wednesday, November 5, 2014 3:05:32 AM UTC+1, Kiuhnm wrote:
When I call subprocess.check_output() I see the console window appear and
disappear very quickly. Is there a way to stop the console from showing up at
all?
shell=True
does the trick!
--
On Wed, Nov 5, 2014 at 1:30 PM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote:
machine code typically implies an instruction set specific to that
machine... ALL computers operate in BINARY logic (a bit only holds 0 or 1).
How you get those bits into the computer is irrelevant.
Bah,
Example 1
def compose_greet_func():
def get_message():
return Hello there!
return get_message
greet = compose_greet_func()
print greet()
Example 2
def greet(name):
return hello +name
greet_someone = greet
print greet_someone(John
In Example 1, the function
Just to be clear, I was referring to these two lines
greet = compose_greet_func()
greet_someone = greet
On Wednesday, November 5, 2014 11:15:46 AM UTC+8, Max Nathaniel Ho wrote:
Example 1
def compose_greet_func():
def get_message():
return Hello there!
return
On 11/04/2014 08:52 AM, Roberto Martínez wrote:
I am trying to replace dinamically the __call__ method of an object
using setattr.
Example:
$ cat testcall.py
class A:
def __init__(self):
setattr(self, '__call__', self.newcall)
def __call__(self):
print(OLD)
On 04Nov2014 19:17, Max Nathaniel Ho maxhow...@gmail.com wrote:
Just to be clear, I was referring to these two lines
greet = compose_greet_func()
greet_someone = greet
Please don't top-post. Thanks.
Your first assignment:
greet = compose_greet_func()
_calls_ (runs) the
Jean-Michel wrote:
replace
if left_to_act is None:
left_to_act = []
self.left_to_act = left_to_act
by
self.left_to_act = left_to_act or []
I read that with 2.7 that I had to initialize class variables to
immutable types. I think because I was working with the lists before
they had been
On 04Nov2014 11:24, sohcahto...@gmail.com sohcahto...@gmail.com wrote:
On Tuesday, November 4, 2014 10:51:53 AM UTC-8, ast wrote:
sohcahtoa82 a écrit dans le message de
news:e5c95792-f81f-42b4-9996-5545f5607...@googlegroups.com...
On Tuesday, November 4, 2014 8:49:36 AM UTC-8, françai s wrote:
Robin Becker ro...@reportlab.com writes:
Is there a way to do pkcs7 / 12 signing with python.
Have you checked whether OpenSSL supports this kind of signing?
If it does, then you likely can use this via several Python wrappings
for OpenSSL.
--
If i have two functions:
function! foo()
python3 HERE
import mylib
pass
HERE
function! bar()
python3 HERE
import mylib
pass
HERE
The src says:
1. Python interpreter main program
3. Implementation of the Vim module for Python
So, is the python interpreter embedded in vim AND
On Wed, Nov 5, 2014 at 5:39 PM, Cameron Simpson c...@zip.com.au wrote:
Bah! He asked if there were lower levels than binary. Ergo: chip design!
(And microcode, the intermediate layer. Or one of the layers, depending
where you draw the line.) Should we stop before we reach the quantum foam of
On Wednesday, November 5, 2014 2:00:08 PM UTC+8, Cameron Simpson wrote:
On 04Nov2014 19:17, Max Nathaniel Ho maxhow...@gmail.com wrote:
Just to be clear, I was referring to these two lines
greet = compose_greet_func()
greet_someone = greet
Please don't top-post. Thanks.
Your first
Veek M wrote:
If i have two functions:
function! foo()
python3 HERE
import mylib
pass
HERE
function! bar()
python3 HERE
import mylib
pass
HERE
The src says:
1. Python interpreter main program
3. Implementation of the Vim module for Python
So, is the python
R. David Murray added the comment:
try the reflected operation is not our standard terminology. There is a
reason I suggested *copying* the parenthetical statement. We essentially have
two places where NotImplemented is described (language reference and library
reference), and the
R. David Murray added the comment:
Specifically, this works (in 2.7):
enumerate(sequence=myvar)
Changing sequence to iterable would break any code that was written like the
above.
--
___
Python tracker rep...@bugs.python.org
New submission from Sam Bishop:
The output of performing dir(__class__) during a class' __init__ method,
seems to be lacking the new '__qualname__' attribute in python 3.
This rough test can be pasted right into the python 3.4 REPL to see the issue.
Tested on 64bit python 3.4 running on OSX
New submission from INADA Naoki:
In [1]: import datetime
In [2]: datetime.datetime.utcfromtimestamp(0)
Out[2]: datetime.datetime(1970, 1, 1, 0, 0)
In [3]:
datetime.datetime.utcfromtimestamp(0).replace(tzinfo=datetime.timezone.utc)
Out[3]: datetime.datetime(1970, 1, 1, 0, 0,
Amaury Forgeot d'Arc added the comment:
Why did you specify during class initialization only? When I print
dir(Foo.Bar) at top-level, there is no __qualname__.
Then, note that '__name__' is not listed either, so it's not about new
attributes.
It was chosen that dir(someClass) tries to list
Georg Brandl added the comment:
@Amaury: this is not what I read there:
If the object is a type or class object, the list contains the names of its
attributes, and recursively of the attributes of its bases.
This implies that class attributes are definitely supposed to be in there.
Sam Bishop added the comment:
I specified 'during class initialisation' because that was the only case I
confirmed.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22790
___
Georg Brandl added the comment:
The missing attributes are some of those defined in type_getsets, i.e.
__name__
__qualname__
__bases__
__abstractmethods__
__text_signature__
The latter two are obscure enough that it probably doesn't matter, but the
first three should definitely be there.
Georg Brandl added the comment:
Ah yes, and some type_members are also missing.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22790
___
___
eryksun added the comment:
You won't find the __qualname__ data descriptor in dir(Foo.Bar) because it's
defined by the metaclass, `type`. Attributes from the metaclass have always
been excluded from the dir() of a class.
--
nosy: +eryksun
___
eryksun added the comment:
See type_dir:
https://hg.python.org/cpython/file/ab2c023a9432/Objects/typeobject.c#l2984
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22790
___
Antoine Pitrou added the comment:
This is similar to the idea of loading the stdlib from a zip file (but less
intrusive and more debugging-friendly). The time savings will depend on whether
the filesystem cache is cold or hot. In the latter case, my intuition is that
decompression will slow
New submission from housetier:
https://docs.python.org/3.4/library/string.html does not explain the replace()
function. I suppose it is very similar, if not identical, to 2.7:
https://docs.python.org/2.7/library/string.html#string.replace
--
components: Distutils
messages: 230601
Georg Brandl added the comment:
Attributes from the metaclass have always been excluded from the dir() of a
class.
Be that as it may, I think it is wrong. I can understand excluding methods of
the metaclass, but __qualname__ (and friends) are only defined in the metaclass
because they are
Georg Brandl added the comment:
BTW, the same implementation detail means that you can ask an instance for its
class' __module__, but not the __name__.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22790
eryksun added the comment:
Follow the String Methods link at the top of the string module documentation.
Or use this link:
https://docs.python.org/3.4/library/stdtypes.html#str.replace
See also help(str.replace) and help(str) in the interactive shell.
--
assignee: - docs@python
1 - 100 of 178 matches
Mail list logo