« first day (2256 days earlier)      last day (1100 days later) » 

8:11 AM
select d.uuid,
d.name_passport_element,
d.period_upd_dir_id,
pud.days_amount,
mp.uuid,
mp.user_date,
mp.date_deadline,
(mp.user_date + days_amount) < CURRENT_DATE as valid
from document as d INNER JOIN period_update_dir pud on d.period_upd_dir_id = pud.uuid
JOIN passport mp on d.uuid = mp.document_type_id;
i try
query = session.query(Document, PeriodUpdateDirectory, Passport,\
(sqlalchemy.func.date_part('day', \
Passport.date_created + PeriodUpdateDirectory.days_amount ) \
> (sqlalchemy.func.current_date()).label('not_valid')))
but it caused an error
 
 
1 hour later…
9:18 AM
4 messages moved from Python
 
 
13 hours later…
10:02 PM
I noticed some unexpected weirdness in **computing intersection of key views on dicts, the naive approach is not insertion-order-preserving**. When you dig into the Python spec closely, this is implied but it's unexpected gotcha to the spirit but not the letter of the spec. The one-line summary seems to be "Dict keys views are hybrid set-like objects which preserve insertion order, but the moment you use set operations on them that order goes out the window".
- dicts preserve insertion order
- [Keys views are set-like, yet they also preserve insertion order](https://docs.python.org/3/librar
^ [I tried to get the formatting right in sandbox]
 
It has to to two separate posts I think. I'm happy to move that if you want to go again
 
@roganjosh Can you edit it to correctly format it? I've been unable to figure out how. Oh you mean one post for the list, one for the code? Ok then please move/delete.
 
I can't edit posts for you. I can shift the current post and you can post again as two messages - 1) blurb, 2) code
5 messages moved from Python
 

« first day (2256 days earlier)      last day (1100 days later) »