-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Sunday 08 September 2013 10:43 PM, Saager Mhatre wrote:
With a verb name like *register* I'd much prefer to call the
function as opposed to using it as a decorator. The more
idiomatic decorators have noun names, viz- property, classmethod,
For a while I had thought it would be interesting to hear tips/techniques you
find yourself often using - or perhaps found useful at one point (and thus
would be valuable to newbies).
It could be simple snippet, or some description of logic, technique or steps.
From simple to sophisticated
Bibhas,
You should be able to rest easy. In the 10+yrs I have been on this mailing
seldom/never have I seen someone bring in discord and
in-your-face as was done recently... I rather expect to go another 10yrs before
seeing it here again.
Now, to Bibhas' point about desiring to see
http://code.activestate.com/recipes/52308-the-simple-but-handy-collector-of-a-bunch-of-named/
With api responses after you have parsed the json, you start doing things
like:
api_response[attribute]
I would much prefer to do
api_response.attribute
Which the bunch pattern can enable.
I don't
Shabda Raaj sha...@agiliq.com writes:
http://code.activestate.com/recipes/52308-the-simple-but-handy-collector-of-a-bunch-of-named/
With api responses after you have parsed the json, you start doing things
like:
api_response[attribute]
I would much prefer to do
api_response.attribute
I
I generally like to use attributes instead of keys.
If you are parsing json, aren't you limited to using keys? The bunch
pattern can fix this, but its not widely known/used, so I don't use it as
frequently as I would like.
--
Thanks,
Shabda
Agiliq.com - Building Amazing Apps
agiliq.com/blog/
Shabda Raaj sha...@agiliq.com writes:
I generally like to use attributes instead of keys.
If you are parsing json, aren't you limited to using keys?
Of course. I was making a general statement about attributes vs. keys.
The bunch pattern can fix this, but its not widely known/used, so I
This is a popular talk on quircks of ruby/js
https://www.destroyallsoftware.com/talks/wat
What are the quircks/unexpected behavior you find in Python? (Aka Python
wats).
--
Thanks,
Shabda
Agiliq.com - Building Amazing Apps
agiliq.com/blog/ | github.com/agiliq
US: +13152854388 | IN:
On Tue, Sep 10, 2013 at 10:09 AM, Noufal Ibrahim nou...@nibrahim.net.inwrote:
Shabda Raaj sha...@agiliq.com writes:
I generally like to use attributes instead of keys.
If you are parsing json, aren't you limited to using keys?
Of course. I was making a general statement about attributes
On Tue, Sep 10, 2013 at 10:14 AM, Shabda Raaj sha...@agiliq.com wrote:
This is a popular talk on quircks of ruby/js
https://www.destroyallsoftware.com/talks/wat
What are the quircks/unexpected behavior you find in Python? (Aka Python
wats).
x = 10
class Foo:
print x
x = 0
On 10 September 2013 10:21, Anand Chitipothu anandol...@gmail.com wrote:
On Tue, Sep 10, 2013 at 10:14 AM, Shabda Raaj sha...@agiliq.com wrote:
This is a popular talk on quircks of ruby/js
https://www.destroyallsoftware.com/talks/wat
What are the quircks/unexpected behavior you find
https://github.com/webpy/webpy/blob/master/web/utils.py#L52
Wow, thats better than the bare bunch impl. Gonna use it now.
Unrelated tip:
Here is a one liner I use to generate passwords and other random strings.
''.join(random.choice(string.ascii_uppercase + string.digits) for x in
range(N))
On Tue, Sep 10, 2013 at 10:37 AM, Ramchandra Apte maniandra...@gmail.comwrote:
On 10 September 2013 10:21, Anand Chitipothu anandol...@gmail.com wrote:
On Tue, Sep 10, 2013 at 10:14 AM, Shabda Raaj sha...@agiliq.com wrote:
This is a popular talk on quircks of ruby/js
On Tue, Sep 10, 2013 at 10:39 AM, Shabda Raaj sha...@agiliq.com wrote:
https://github.com/webpy/webpy/blob/master/web/utils.py#L52
Wow, thats better than the bare bunch impl. Gonna use it now.
Unrelated tip:
Here is a one liner I use to generate passwords and other random strings.
I get UnboundLocalError: local variable 'x' referenced before assignment.
That's strange, I'd expect the first print statement to print 10, not
generate an exception.
On 10 September 2013 10:39, Anand Chitipothu anandol...@gmail.com wrote:
On Tue, Sep 10, 2013 at 10:37 AM, Ramchandra Apte
Anand Chitipothu anandol...@gmail.com writes:
[...]
I use it very often. Here is my random-password script.
[...]
I use mkpasswd(1) :)
--
Cordially,
Noufal
http://nibrahim.net.in
___
BangPypers mailing list
BangPypers@python.org
On Tue, Sep 10, 2013 at 10:45 AM, Noufal Ibrahim nou...@nibrahim.net.inwrote:
Anand Chitipothu anandol...@gmail.com writes:
[...]
I use it very often. Here is my random-password script.
[...]
I use mkpasswd(1) :)
$ sudo apt-cache search mkpasswd
libstring-mkpasswd-perl - Perl module
Real programmers pipe /dev/urandom :)
Let me preempt the xkcd: http://xkcd.com/378/
On Tue, Sep 10, 2013 at 10:47 AM, Anand Chitipothu anandol...@gmail.comwrote:
On Tue, Sep 10, 2013 at 10:45 AM, Noufal Ibrahim
nou...@nibrahim.net.inwrote:
Anand Chitipothu anandol...@gmail.com writes:
Anand Chitipothu anandol...@gmail.com writes:
[...]
$ sudo apt-cache search mkpasswd
libstring-mkpasswd-perl - Perl module implementing a random password
generator
I think that's something else.
noufal@sanitarium% dpkg -S =mkpasswd
whois: /usr/bin/mkpasswd
noufal@sanitarium% file
On Tue, Sep 10, 2013 at 10:46 AM, Ramchandra Apte maniandra...@gmail.comwrote:
I get UnboundLocalError: local variable 'x' referenced before assignment.
That's strange, I'd expect the first print statement to print 10, not
generate an exception.
A variable is either local or global. It is
A variable is either local or global. It is decided at the compile time.
Erm, compile?
Python's scoping rules are , erm, interesting:
http://me.veekun.com/blog/2011/04/24/gotcha-python-scoping-closures/
The mnemonic for scoping is LEGB:
On Tue, Sep 10, 2013 at 10:57 AM, Shabda Raaj sha...@agiliq.com wrote:
A variable is either local or global. It is decided at the compile time.
Erm, compile?
well, you may call it module/script load time. But python compiles the code
and generates bytecode before executing it.
$ file a.pyc
Eg: See this:
http://nbviewer.ipython.org/5151306
I was expecting datetime.date.today() == datetime.datetime.today()
to give me a True. (It is false).
For example this works as I expect:
http://nbviewer.ipython.org/5151398
However looks like __eq__ is doing a isinstance check - I would
Shabda Raaj sha...@agiliq.com writes:
Eg: See this:
http://nbviewer.ipython.org/5151306
I was expecting datetime.date.today() == datetime.datetime.today()
to give me a True. (It is false).
I'd expect it to be False. There will be a small amount of time between
the two invocations and the
Anand Chitipothu anandol...@gmail.com wrote:
On Tue, Sep 10, 2013 at 10:57 AM, Shabda Raaj sha...@agiliq.com
wrote:
A variable is either local or global. It is decided at the compile
time.
Erm, compile?
well, you may call it module/script load time. But python compiles the
code
and
Hi all,
I am looking for a reasonably experienced Flask developer to help us put
finishing touches on a product. Experience of remote configuration
management tools such as Salt Stack would be greatly appreciated.
Please get in touch if interested and feel free to pass my details onto
anyone you
I'd expect it to be False. There will be a small amount of time between
the two invocations and the time will change
Ok, that makes sense. Should have written a better test case. What about
this.
datetime.datetime(2013, 1, 1) == datetime.date(2013, 1, 1)
False
datetime.datetime.today() ==
27 matches
Mail list logo